问题
I'm working with the PayPal REST API on the sandbox endpoint at https://api.sandbox.paypal.com/v1/ and nearly every single time I try to POST to payments/payment with a valid request (taking care not to be flagged as a duplicate attempt) it keeps returning a 503 error.
Only very occasionally does the request go through but it only did that earlier and now every request is failing with a 503 response. Even when I use PayPal's REST Playground at https://devtools-paypal.com/hateoas/index.html?interactive=ON&env=sandbox to build their sample template request I get the following response:
Response Header
HTTP Status Code : 503
{
"date": "Tue, 26 Apr 2016 04:19:28 GMT",
"server": "Apache",
"proxy_server_info": "host=slcsbplatformapiserv3002.slc.paypal.com;threadId=876",
"paypal-debug-id": "56fbd9db69555",
"connection": "close",
"set-cookie": [
"X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D1880%26app%3Dplatformapiserv%26TIME%3D1357651543%26HTTP_X_PP_AZ_LOCATOR%3D; Expires=Tue, 26 Apr 2016 04:49:58 GMT; domain=.paypal.com; path=/; Secure; HttpOnly",
"X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT"
],
"vary": "Authorization",
"content-length": "145",
"content-type": "application/json"
}
Response Body
{
"name": "INTERNAL_SERVICE_ERROR",
"information_link": "https://api.sandbox.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR",
"debug_id": "56fbd9db69555"
}
This is so incredibly annoying I can't stand it. Does anyone know if the sandbox site goes down from time to time? Has anyone run into this happening and realized they were doing something wrong in their request? Again, after I ran into the issue I tried submitting to the API using PayPal's very own example template in the REST Playground page.
回答1:
Regarding "INTERNAL_SERVICE_ERROR", in sandbox environment, the testing credit card in your API request is a generic one and there are lots of accounts attached to this credit card, when PayPal execute your API request, we need to load all the related accounts during transaction, so it caused time out error and internal service error, please try some rarely used card number, such as below:
VISA 16 digit
4916339731576481
4916037567876898
4024007171154213
4532782720397175
4556654893065114
4539432483175995
4716339122298416
4532325401406798
4539157680503828
4124138105007679
4485178251029161
4916231960500037
4058178241644969
Please have a try.
来源:https://stackoverflow.com/questions/36855265/paypal-sandbox-api-endpoint-returning-503-internal-service-error-error