Payment buttons - create order succeeds, capture order fails with TRANSACTION_REFUSED

Smiffytech
Contributor
Contributor

Hi

 

I am following the workflow here:

https://developer.paypal.com/docs/platforms/checkout/set-up-payments/

 

Seller has been onboarded successfully.

 

Hit the payment button rendered by your specified JavaScript. It calls our backend, which creates an order. Response:

{"id":"44J46507WS247260W","status":"CREATED","links":[{"href":"https://api.sandbox.paypal.com/v2/checkout/orders/44J46507WS247260W","rel":"self","method":"GET"},{"href":"https://www.sandbox.paypal.com/checkoutnow?token=44J46507WS247260W","rel":"approve","method":"GET"},{"href":"https://api.sandbox.paypal.com/v2/checkout/orders/44J46507WS247260W","rel":"update","method":"PATCH"},{"href":"https://api.sandbox.paypal.com/v2/checkout/orders/44J46507WS247260W/capture","rel":"capture","method":"POST"}]}

 

So I definitely have an order in the system.

 

The capture back end then POSTs  back to capture the order. I grabbed the details and did this manually, to make sure it wasn't my code causing issues.

 

curl -v -k -X POST https://api.sandbox.paypal.com/v2/checkout/orders/44J46507WS247260W/capture \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer A21AAIMSjNishvitNy7Z4p9ujjpvdnzaeUeEL8nrTqsXSNx8SBcD7Momzocu2gtruCEAwTEZk-BHUNxYRbLfIr-Wuuqdu1sEg' \
-d '{}'

 

Response was HTTP/1.1 422 Unprocessable Entity

{"name":"UNPROCESSABLE_ENTITY","details":[{"issue":"TRANSACTION_REFUSED","description":"The request was refused"}],"message":"The requested action could not be performed, semantically incorrect, or failed business validation.","debug_id":"bdc0ec7a8d0e7","links":[{"href":"https://developer.paypal.com/docs/api/orders/v2/#error-TRANSACTION_REFUSED","rel":"information_link","method":"GET"}]}

 

Does anyone have any ideas?

 

Cheers

 

 

 

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.