gpt4 book ai didi

php - fatal error : Uncaught exception PAYPAL

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

我在进行 paypal 付款时遇到了错误。

Fatal error: Uncaught exception 'PayPal\Exception\PayPalConnectionException' with message 'Got Http response code 400 when accessing https://api.sandbox.paypal.com/v1/payments/payment.' in C:\xampp\htdocs\paypal\workload\third_party\vendor\paypal\rest-api-sdk-php\lib\PayPal\Core\PayPalHttpConnection.php:159 Stack trace: #0 C:\xampp\htdocs\paypal\workload\third_party\vendor\paypal\rest-api-sdk-php\lib\PayPal\Transport\PayPalRestCall.php(74): PayPal\Core\PayPalHttpConnection->execute('{"intent":"sale...') #1 C:\xampp\htdocs\paypal\workload\third_party\vendor\paypal\rest-api-sdk-php\lib\PayPal\Common\PayPalResourceModel.php(103): PayPal\Transport\PayPalRestCall->execute(Array, '/v1/payments/pa...', 'POST', '{"intent":"sale...', NULL) #2 C:\xampp\htdocs\paypal\workload\third_party\vendor\paypal\rest-api-sdk-php\lib\PayPal\Api\Payment.php(303): PayPal\Common\PayPalResourceModel::executeCall('/v1/payments/pa...', 'POST', '{"intent":"sale...', NULL, Object(PayPal\Rest\ApiContext), NULL) #3 C:\xampp\htdocs\paypal\workload\modules\member\librari in C:\xampp\htdocs\paypal\workload\third_party\vendor\paypal\rest-api-sdk-php\lib\PayPal\Core\PayPalHttpConnection.php on line 159

最佳答案

您可以捕获 PayPalHttpConnection 异常并打印详细消息,说明它失败的原因。为此,请在您的代码周围添加一个 try catch block 。

try {
$creditCard->create($apiContext);
echo $creditCard;
}
catch (\PayPal\Exception\PayPalConnectionException $ex) {
echo $ex->getData();
}

关于php - fatal error : Uncaught exception PAYPAL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29464890/

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