You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
muraoka17 edited this page Apr 27, 2012
·
5 revisions
API Errors
When PayPal API returns failure response, paypal-express raises Paypal::Exception::APIError.
Since PayPal IPNAPI returns Failure as string and PayPal NVPAPI (includes Express API) returns Hash (form-urlencoded params), Paypal::Exception::APIError#response is String for IPN and Paypal::Exception::APIError::Response instance for NVP.
begin# Invalid API RequestrescuePaypal::Exception::APIError=>ee.message# => 'PayPal API Error'e.response# => Paypal::Exception::APIError::Responsee.response.details# => Array of Paypal::Exception::APIError::Response::Detail. This includes error details for each payment request.end
See spec code for more details.
ref.) API Error Codes – PayPal Developers
https://cms.paypal.com/us/cgi-bin/?cmd=render-content&content_ID=developer/e_howto_api_nvperrorcodes
Appendix
When HTTP-level error occured, paypal-express raises Paypal::Exception::HttpError.
Both Paypal::Exception::HttpError and Paypal::Exception::APIError are subclass of Paypal::Exception.