Quick Summary:
I'm developing an e-commerce site using PHP. It uses PayPal to make payments. I have been successfully using (from sending the request string via SetExpressCheckout to DoExpressCheckoutPayment to GetExpressCheckoutDetails to storing payment details in the MySQL database) PayPal's Sandbox mode with their Classic API Express Checkout (NVP) from sometime late last year till now. It was all working fine until last night and no major changes have been made to the PayPal section of the site. Now I get an "Internal Server Error" at https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=[TOKEN] on every payment request.
Walkthrough:
- Parse payment request: "...&PAYMENTREQUEST_0_PAYMENTACTION=...",
- Call "SetExpressCheckout",
- Get [ACK] => Success (No error = no LONGMESSAGE),
- Redirect to provided token https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=[TOKEN],
- Get "Internal Server Error" at above link every time.
What I see:
Paypal SetExpressCheckout return:
Array
(
[TOKEN] => XX-XXXXXXXXXXXXXXXXX
[TIMESTAMP] => 2015-03-28T20:27:25Z
[CORRELATIONID] => XXXXXXXXXXXXX
[ACK] => Success
[VERSION] => 109.0
[BUILD] => 15840636
)
PayPal Sandbox error message at link listed above:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Why I can't find an answer:
- The generic "Internal Server Error" message means I have no clue where to start looking since I'm not sure if the problem is with me (which would be my default assumption) or with PayPal.
- Most solutions point to a mismatch between production and sandbox URL / API credentials. This is NOT the problem. I have been successfully using Sandbox credentials with the Sandbox link for some time now.
- All PayPal Internal Server Error problems that I have found are for people using the REST API (or with IPN). I am using the Classic-API-driven Express Checkout and I don't see any debug_id returned or how I would get it.
- All problems in the past could be solved by looking at the returned error message (ACK=Failure&L_ERRORCODE0=['some error code']&L_SHORTMESSAGE0=['short error message']&L_LONGMESSAGE0=['detailed error message']). There is no error message here because it registers as a success.
- I have tried changing the API credentials and get the standard security headers error (I then switch back and the error goes away and returns to the Internal Server Error on redirect).
- I have tried tinkering with the request string but I feel fairly confident that is not the problem since when I deliberately mess it up I get the standard error message for that.