amzn / amazon-pay-sdk-ruby

Amazon Pay Ruby SDK
https://pay.amazon.com/developer
Apache License 2.0
59 stars 34 forks source link

Handling Declined Authorizations #3

Closed pchaganti closed 9 years ago

pchaganti commented 9 years ago

When the authorize_on_billing_agreement fails, Amazon Payments is supposed to return a code that signifies why the operation failed. This is different from 200/400 status codes. Is there anyway to get that info from the response object?

http://docs.developer.amazonservices.com/en_US/pay_with_amazon_automatic_payments/APAGuide_HandlingDeclines.html#APAGuide_DeclinedAuthorizations

thanks

samir-khoja commented 9 years ago

If the API call you are making fails, the status code returned from MWS will be 404. You can then return the response.body value to see the details of the error you are receiving. Below is a link to the README with more information on how to parse the response:

https://github.com/amzn/login-and-pay-with-amazon-sdk-ruby#response-parsing

Please let me know if you have additional questions.

pchaganti commented 9 years ago

Ah, got it. We have been using FPS for a long time (7 years) and are now migrating over to MWS. This gem has been quite useful.

thanks!