Reputation: 63
I have integrated PayPal REST API with PayPal SDK. It's working fine on sandbox when we are using sandbox credentials but when using live PayPal credentials, the save card functionality on PayPal (using REST API) is working fine, but when we try to make payments using the card id of PayPal (generated by PayPal like CARD-8K0630766A878805HYRGHBCD), We are facing an error like;
Exception: Got Http response code 401 when accessing https://api.paypal.com/v1/payments/payment. Retried 0 times.
{
"name":"UNAUTHORIZED_PAYMENT",
"message":"Unauthorized payment",
"information_link":"https://developer.paypal.com/webapps/developer/docs/api/#UNAUTHORIZED_PAYMENT",
"debug_id":"3424fdf3dac86"
}
We have done lot of R&D but could not get the issue.
Please let me know what we are missing or the mistake from our end so that the issue is resolved as soon as possible.
Upvotes: 3
Views: 1291
Reputation: 423
Upvotes: 0
Reputation: 1305
To switch Sandbox to Live, you need to change "mode" from "sandbox" to "live", and use Live client/secret pair. Any object/paypal-entities you have created using sandbox mode will no longer work, you have to re-create them using live credentials.
Upvotes: 1
Reputation: 170
Since you have an authorize failed, have you ever enable your live Credentials as it's not enabled by default.
Upvotes: 1