我在基于 C# 的项目中遇到了这个问题,但我也可以用 curl 重现它。该代码几天前可以使用,但现在不行了,我很确定我没有更改它。
我有一笔已获得授权的付款,并且我的 ID 是正确的(当我使用他们的在线工具关闭交易时,我得到 AUTHORIZATION_ALREADY_COMPLETED 而不是 Server 500 错误)。
这是我用 curl 复制它的方法,敏感信息已编辑:
// check if the AUTHIDHERE code is correct:
curl -v -X GET https://api.paypal.com/v1/payments/authorization/AUTHIDHERE -H "Content-Type:application/json" -H "Authorization:Bearer BEARER123"
上述调用有效并返回: { "id": "AUTHIDHERE", "create_time": "2013-07-17T21:17:58Z", "update_time": "2013-07-17T21:18:00Z", "state ": "授权", "金额": { "total": "1.35", "currency": "USD", "details": { "subtotal": "1.35" } }, "parent_payment": "PAY-SOMELONGIDHERE ", "valid_until": "2013-08-15T21:17:58Z", "links": ...一大堆在这里]} }
然后我打电话给捕获
curl -v https://api.paypal.com/v1/payments/authorization/AUTHIDHERE/capture \
-H "Content-Type:application/json" -H "Authorization:Bearer BEARER123" \
-d '{"amount":{"currency":"USD","total":"1.32"},"is_final_capture":true}
我得到这个 HTTP 500 状态:
{
"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": "7edadeba20509"
}
其他一些 debug_id 值为:062fc6964d9a8、6eebc751504eb