Reputation: 43
I am using Paypal-PHP. SDK, a I want to get code errors. When I put wrong credit card data, I am getting this JSON as answer:
{
"name":"CREDIT_CARD_REFUSED",
"message":"Credit card was refused",
"information_link":"https://developer.paypal.com/webapps/developer/docs/api /#CREDIT_CARD_REFUSED",
"debug_id":"63a9cf220d272"
}
or this:
{"name":"VALIDATION_ERROR",
"details":[
{"field":"payer.funding_instruments[0].credit_card.expire_month","issue":"Must not be blank"},
{"field":"payer.funding_instruments[0].credit_card.expire_year","issue":"Must not be blank"},
{"field":"payer.funding_instruments[0].credit_card.cvv2","issue":"Must be numeric"}],
"message":"Invalid request - see details","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#VALIDATION_ERROR","debug_id":"8e61a15a1bf4a"}
But I need error code. How Can I get it?
Thanks
Upvotes: 1
Views: 173
Reputation: 6463
REST API usually do not return error codes like classic API. There are no error codes associated with the error message.
It just returns the error object with name
debug_id
message
information_link
details
Upvotes: 1