gpt4 book ai didi

php - 即使交易正常,今天也有多个 ACCOUNT_CANNOT_BE_FETCHED 错误

转载 作者:太空宇宙 更新时间:2023-11-03 16:21:15 24 4
gpt4 key购买 nike

今天我第一次在几个客户交易的返回 url 上遇到多个 ACCOUNT_CANNOT_BE_FETCHED 错误。

这是发生错误的具体行

$payment = \PayPal\Api\Payment::get($paymentId, $apiContext);

这是上下文配置中定义的 PayPal 日志捕获的消息

[12-04-2019 06:14:12] PayPal\Core\PayPalHttpConnection : ERROR: Got Http response code 400 when accessing https://api.paypal.com/v1/payments/payment/PAYID-xxxxxxxxxxxxxxxxxxxxxxxx. {"name":"ACCOUNT_CANNOT_BE_FETCHED","message":"Account can not be fetched.","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"xxxxxxxxxxxxx"}

有关错误的文档不是很清楚。

问题是既然交易成功了,不知道是退款还是绕过这个错误继续进行其他操作。

正如这里所建议的那样,简短的异常(exception)

[url:PayPal\Exception\PayPalConnectionException:private] => https://api.paypal.com/v1/payments/payment/PAYID-xxxxxxxxxxxxxxxxxxxxxxxx
[data:PayPal\Exception\PayPalConnectionException:private] => {"name":"ACCOUNT_CANNOT_BE_FETCHED","message":"Account can not be fetched.","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"xxxxxxxxxxxxx"}
[message:protected] => Got Http response code 400 when accessing https://api.paypal.com/v1/payments/payment/PAYID-xxxxxxxxxxxxxxxxxxxxxxxx.
[string:Exception:private] =>
[code:protected] => 400
[file:protected] => /path/to/library/PayPal/Core/PayPalHttpConnection.php
[line:protected] => 177

有什么想法吗?

谢谢

最佳答案

    try {
$payment = \PayPal\Api\Payment::get($paymentId, $apiContext);
} catch (PayPal\Exception\PPConnectionException $ex) {
var_dump(json_decode($ex->getData()));
exit(1);
}

这还不是一个答案,但它是一段代码,可以帮助调试它并有望变成一个答案。请尝试将其包装在您的代码中并发布您获得的 JSON 结果,它应该有助于调试问题。

关于php - 即使交易正常,今天也有多个 ACCOUNT_CANNOT_BE_FETCHED 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55655093/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com