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.
我正在用PHP开发一个电子商务网站。它使用贝宝进行支付。我已经成功地使用了(从通过SetExpressCheckout发送请求字符串到DoExpressCheckoutPayment到GetExpressCheckoutDetails到在MySQL数据库中存储支付细节)贝宝的沙箱模式,使用他们的经典API ExpressCheckout (NVP),从去年年底到现在。直到昨晚,一切都很顺利,而且该网站的贝宝部分也没有发生重大变化。现在我在https://www.sandbox.paypal.com/cgi-bin/webscr?对于每个付款请求,cmd=_express-checkout&token=[TOKEN]。
Walkthrough:
介绍:
- Parse payment request: "...&PAYMENTREQUEST_0_PAYMENTACTION=...",
- 解析付款请求:“…&PAYMENTREQUEST_0_PAYMENTACTION =…”
- Call "SetExpressCheckout",
- 叫“SetExpressCheckout”,
- Get [ACK] => Success (No error = no LONGMESSAGE),
- 获取[ACK] =>成功(无错误=无长消息),
- Redirect to provided token https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=[TOKEN],
- 重定向到提供的令牌https://www.sandbox.paypal.com/cgi-bin/webscr?
- Get "Internal Server Error" at above link every time.
- 每次在上面的链接获取“内部服务器错误”。
What I see:
我所看到的:
Paypal SetExpressCheckout return:
贝宝SetExpressCheckout返回:
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, webmaster@paypal.com 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.
- 大多数解决方案都指向产品和沙箱URL / API凭证之间的不匹配。这不是问题所在。我已经用Sandbox链接成功地使用Sandbox证书一段时间了。
- 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.
- 我发现的所有PayPal内部服务器错误问题都适用于使用REST API(或使用IPN)的用户。我正在使用经典api驱动的快速检出,我没有看到任何debug_id返回,也没有看到我如何得到它。
- 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.
- 过去的所有问题都可以通过查看返回的错误消息(ACK=Failure&L_ERRORCODE0=['some error code']]&L_SHORTMESSAGE0=['short error message']]]&L_LONGMESSAGE0=['detail error message']来解决)。这里没有错误消息,因为它注册为成功。
- 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).
- 我尝试过更改API凭证并获取标准的安全标头错误(然后切换回来,错误消失,然后返回到内部服务器错误重定向)。
- 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.
- 我尝试过修改请求字符串,但我非常确信这不是问题,因为当我故意把它搞砸时,我得到了标准的错误消息。
2 个解决方案
#1
2
After reporting this issue with a log to PayPal they responded by confirming this is a known issue on their end.
在向贝宝报告这个问题后,他们的回应是确认这是一个众所周知的问题。
Dear Philip,
亲爱的菲利普,
Thank you for contacting PayPal Merchant Technical Services about the internal server error on the sandbox environment. This is a known issue currently that is being investigated and hopefully will be resolved soon. I will let you know when I have confirmation the issue is fixed. Thank you.
感谢您联系贝宝商户技术服务,了解沙箱环境的内部服务器错误。这是目前正在调查的一个已知问题,有望很快得到解决。我确认后会通知你问题已经解决。谢谢你!
Sincerely,
真诚地,
Mike
迈克
Merchant Technical Support
商家技术支持
PayPal, an eBay Company
贝宝,易趣公司
Update from PayPal:
更新从贝宝:
Dear Philip, The Sandbox issue should be resolved now and you should not be seeing the Internal Server 500 error. If you haave any other issues please let us know, https://www.paypal.com/mts
亲爱的Philip,沙箱问题现在应该解决了,您不应该看到内部服务器500错误。如果您有其他问题,请告诉我们,https://www.paypal.com/mts。
Sincerely,
真诚地,
Mike
迈克
Merchant Technical Support
商家技术支持
PayPal, an eBay Company
贝宝,易趣公司
I've tested and it does appear to be fixed.
我已经测试过了,它看起来是固定的。
#2
2
Internal Server Error means internal to the PayPal server. This is PayPal's "Help! I give up!" error message.
内部服务器错误是指贝宝服务器的内部错误。这是贝宝的“救命!错误信息。
This does not rule out the possibility that there is something you have done wrong that has lead PayPal's code off the green path and into the woods where it was eaten by a bear, but regardless: do as the error page says and contact PayPal support. They should be able to look up your correlation ID and see what happened. Then they can let you know whether you can work around the issue by making a change on your end or whether your code is all good and it is 100% their issue. And then they can improve their code so that the next person who may make an error similar to yours gets better feedback.
这并不排除你做错了什么事情,导致贝宝的代码偏离了绿道,进入了被熊吃掉的森林,但不管怎样:按错误页面说的做,联系贝宝支持。他们应该能够查到你的相关ID,看看发生了什么。然后他们可以让你知道你是否可以通过改变你的代码来解决这个问题,或者你的代码是否都很好,这是他们100%的问题。然后他们可以改进他们的代码,以便下一个犯类似错误的人得到更好的反馈。
(Although in the case of a page such as this that is normally displayed to your customer, not to you, PayPal generally gives only a relatively generic failure message.)
(尽管对于通常显示给客户而不是您的页面,贝宝通常只给出一个相对通用的失败消息。)
And a few other things I would check if you want to work on this a bit more while you wait for PayPal to get back to you: you verified that the API seems to actually be working as it claims. Sensible thing to check, but the error is on the web redirect so focus on that: what do you get if you pass a known-bogus token? WHat happens on another computer or after you clear your cookies? What do you get if you try to do a button payment (not express checkout) with the same pair of accounts?
如果你想在等待贝宝回复你的时候多做一些其他的事情,我可以检查一下:你验证了这个API看起来确实像它声称的那样工作。检查是明智的,但是错误是在web重定向上,所以请关注这一点:如果传递一个已知的伪令牌,会得到什么?在你清理完你的cookie后,在另一台电脑上发生了什么?如果您尝试使用相同的一对帐户进行按钮付款(而不是快速结帐),您会得到什么?
#1
2
After reporting this issue with a log to PayPal they responded by confirming this is a known issue on their end.
在向贝宝报告这个问题后,他们的回应是确认这是一个众所周知的问题。
Dear Philip,
亲爱的菲利普,
Thank you for contacting PayPal Merchant Technical Services about the internal server error on the sandbox environment. This is a known issue currently that is being investigated and hopefully will be resolved soon. I will let you know when I have confirmation the issue is fixed. Thank you.
感谢您联系贝宝商户技术服务,了解沙箱环境的内部服务器错误。这是目前正在调查的一个已知问题,有望很快得到解决。我确认后会通知你问题已经解决。谢谢你!
Sincerely,
真诚地,
Mike
迈克
Merchant Technical Support
商家技术支持
PayPal, an eBay Company
贝宝,易趣公司
Update from PayPal:
更新从贝宝:
Dear Philip, The Sandbox issue should be resolved now and you should not be seeing the Internal Server 500 error. If you haave any other issues please let us know, https://www.paypal.com/mts
亲爱的Philip,沙箱问题现在应该解决了,您不应该看到内部服务器500错误。如果您有其他问题,请告诉我们,https://www.paypal.com/mts。
Sincerely,
真诚地,
Mike
迈克
Merchant Technical Support
商家技术支持
PayPal, an eBay Company
贝宝,易趣公司
I've tested and it does appear to be fixed.
我已经测试过了,它看起来是固定的。
#2
2
Internal Server Error means internal to the PayPal server. This is PayPal's "Help! I give up!" error message.
内部服务器错误是指贝宝服务器的内部错误。这是贝宝的“救命!错误信息。
This does not rule out the possibility that there is something you have done wrong that has lead PayPal's code off the green path and into the woods where it was eaten by a bear, but regardless: do as the error page says and contact PayPal support. They should be able to look up your correlation ID and see what happened. Then they can let you know whether you can work around the issue by making a change on your end or whether your code is all good and it is 100% their issue. And then they can improve their code so that the next person who may make an error similar to yours gets better feedback.
这并不排除你做错了什么事情,导致贝宝的代码偏离了绿道,进入了被熊吃掉的森林,但不管怎样:按错误页面说的做,联系贝宝支持。他们应该能够查到你的相关ID,看看发生了什么。然后他们可以让你知道你是否可以通过改变你的代码来解决这个问题,或者你的代码是否都很好,这是他们100%的问题。然后他们可以改进他们的代码,以便下一个犯类似错误的人得到更好的反馈。
(Although in the case of a page such as this that is normally displayed to your customer, not to you, PayPal generally gives only a relatively generic failure message.)
(尽管对于通常显示给客户而不是您的页面,贝宝通常只给出一个相对通用的失败消息。)
And a few other things I would check if you want to work on this a bit more while you wait for PayPal to get back to you: you verified that the API seems to actually be working as it claims. Sensible thing to check, but the error is on the web redirect so focus on that: what do you get if you pass a known-bogus token? WHat happens on another computer or after you clear your cookies? What do you get if you try to do a button payment (not express checkout) with the same pair of accounts?
如果你想在等待贝宝回复你的时候多做一些其他的事情,我可以检查一下:你验证了这个API看起来确实像它声称的那样工作。检查是明智的,但是错误是在web重定向上,所以请关注这一点:如果传递一个已知的伪令牌,会得到什么?在你清理完你的cookie后,在另一台电脑上发生了什么?如果您尝试使用相同的一对帐户进行按钮付款(而不是快速结帐),您会得到什么?