Why did it capture fail and order status is PAYER_ACTION_REQURIED?

hieeee
Contributor
Contributor

Hi ,guys

We have encountered some difficulties in integrating paypal payment.We hope to get your help, the problem is as follows.

 

Things have happened according to the following steps

First,We created a payment order via paypal JavaScript SDK,the user logged into the paypal account and approved the payment

Then,We  updated some order information through the following API.

logs is as follows,everything is normal

request:

{"bankUrl":"https://www.sandbox.paypal.com/v2/checkout/orders/3J713866BV8279823","encoding":"UTF-8","mimeType":"application/json","params":{"URL_PARAM_VALUE_ENCODE":"true","HTTP_CONNECT_TIMEOUT":"50000","HTTP_READ_TIMEOUT":"50000","HTTP_CONNECTION_REQUEST_TIMEOUT":"50000"},"requestData":"[{\"op\":\"add\",\"path\":\"/purchase_units/@reference_id=='default'/invoice_id\",\"value\":\"20230216TR25029012257716721256\"},{\"op\":\"replace\",\"path\":\"/purchase_units/@reference_id=='default'/amount\",\"value\":{\"value\":\"1301.26\",\"currency_code\":\"EUR\"}},{\"op\":\"add\",\"path\":\"/purchase_units/@reference_id=='default'/shipping/address\",\"value\":{\"country_code\":\"FR\",\"admin_area_1\":\"GOUZON\",\"address_line_1\":\"ZONE ARTISANALE DE BELLEVUE\",\"admin_area_2\":\"GOUZON\",\"postal_code\":\"23230\"}},{\"op\":\"add\",\"path\":\"/purchase_units/@reference_id=='default'/shipping/options\",\"value\":[{\"amount\":{\"value\":\"0.00\",\"currency_code\":\"EUR\"},\"id\":\"PICKUP0\",\"label\":\"Store Pickup\",\"type\":\"PICKUP\",\"selected\":true}]},{\"op\":\"add\",\"path\":\"/purchase_units/@reference_id=='default'/shipping/name\",\"value\":{\"full_name\":\"S2S DELICES DES ABEILLES (Relais Colis G3226)\"}}]","requestHeaders":{"Authorization":"Basic QVdGbXBpMnBPc3lLTHdCRFFXVm43R1RkTHA3dGpJVnpoVUJtREJabDRhWjhrbkhkYWx5ck1Ic05NUDBwWkdLQnJ2ejk5UEhiVUNVSVo1Zkc6RUdCeHI0LW81Tm9fQ0pZNThqdE5ac1RCNXVYbFpCRl9BSlRlQ1MtQTBQWGxURjU4eHEwMUJEbmNSQmZFUlRudHBnRWF1Rl82ZjN6N2hiUEc=","Content-Type":"application/json"},"requestMethod":"PATCH","resultType":"STRING"}

response:

{"charset":"ISO-8859-1","httpReasonPhrase":"No Content","httpStatusCode":204,"responseHeaders":{"X-Cache":"MISS, MISS","Paypal-Debug-Id":"f983379dfdafa","Connection":"keep-alive","Date":"Thu, 16 Fe[Removed. Phone #s not permitted]GMT","Via":"1.1 varnish, 1.1 varnish","X-Timer":"S1676534517.345262,VS0,VE551","Accept-Ranges":"bytes","Strict-Transport-Security":"max-age=63072000; includeSubDomains; preload","Cache-Control":"max-age=0, no-cache, no-store, must-revalidate","Origin-Trial":"AlIogV3KFtnbfVCyl9Z2NprE7FD8PYCt+TQiYdE3ppeJjJ0xJKcthYwOxXpRCNopxVWdOIENMcNSvQCGAmj0fw0AAAB2eyJvcmlnaW4iOiJodHRwczovL3BheXBhbC5jb206NDQzIiwiZmVhdHVyZSI6IlNlbmRGdWxsVXNlckFnZW50QWZ0ZXJSZWR1Y3Rpb24iLCJleHBpcnkiOjE2ODQ4ODYzOTksImlzU3ViZG9tYWluIjp0cnVlfQ==","X-Served-By":"cache-lhr7367-LHR, cache-cdg20757-CDG","Set-Cookie":"x-cdn=fastly:CDG; Domain=paypal.com; Path=/; Secure","Accept-Ch":"Sec-CH-UA-Full","X-Cache-Hits":"0, 0"}}

 

Finally, we tried to capture and it failed.

log is as follow

request:

https://www.sandbox.paypal.com/v2/checkout/orders/3J713866BV8279823/capture

response:

{\"name\":\"UNPROCESSABLE_ENTITY\",\"details\":[{\"issue\":\"PAYER_ACTION_REQUIRED\",\"description\":\"Payer needs to perform the following action before proceeding with payment.\"}],\"message\":\"The requested action could not be performed, semantically incorrect, or failed business validation.\",\"debug_id\":\[Removed. Phone #s not permitted]",\"links\":[{\"href\":\"https://developer.paypal.com/docs/api/orders/v2/#error-PAYER_ACTION_REQUIRED\",\"rel\":\"information_link\",\"method\":\"GET\"}]}

 

We read paypal's api documentation and found the following introduction about PAYER_ACTION_REQUIRED.

 

But we don't know how this failure is triggered, what is its cause?

Can you guys tell us why?How to avoid capture failed like this?

 

Looking forward to your reply.

regards.

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.