【发布时间】:2014-12-03 02:36:22
【问题描述】:
我在我的 PHP 应用程序中使用“paypal/rest-api-sdk-php”,过去一个月在沙盒中进行了完美测试。今晚移至 LIVE 以完成产品前测试,现在收到此响应。
[03-12-2014 01:46:32] PayPal\Core\PPHttpConnection: FINE: Response : {"name":"INTERNAL_SERVICE_ERROR","message":"An internal service error has occurred","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#INTERNAL_SERVICE_ERROR","debug_id":"9a4e0771d4d79"}
任何我搜索过但没有找到合适答案的建议。
这是我要发送的有效负载(为安全起见,已删除 URL 返回)
PayPal\Core\PPHttpConnection: FINE: Payload :
{"intent":"sale","payer":{"payment_method":"paypal"},"redirect_urls":
{"return_url":"XXX","cancel_url":"XXX"},"transactions":
[{"amount":{"currency":"USD","total":"37.50","details":
{"shipping":"0.00","handling_fee":"2.50","tax":"0.00","subtotal":"35.00"}},"item_list":
{"items":[{"name":"Full Event","description":"This is a full event membership","sku":"547e5ff327a7c","currency":"USD","quantity":1,"price":"35.00"}]},"description":
"Purchase from Site","invoice_number":"547e69aad333b"}]}
【问题讨论】:
-
PayPal REST API 中的典型内部服务器错误是由未遵循正确格式的 JSON 有效负载引起的。您尝试运行哪个操作?
-
为什么我在测试期间看不到沙箱中的这些错误?
-
您的请求中的项目描述似乎超过了最大字符数,您可以发布完整的 API 请求吗?
-
最大是多少?我会做一个 substr(x,0,?) 来修复
-
我在项目 desc 中添加了一个 substr,它解决了问题,非常感谢您的帮助。