gpt4 book ai didi

php - Laravel Paypal API 返回 500 错误

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

我正在为我的网站使用 Laravel 4.2,我正在设置付款。它似乎可以很好地连接到 PayPal,但是当返回到我的站点时,我收到 500 错误...

Got Http response code 500 when accessing https://api.sandbox.paypal.com/v1/payments/payment/PAY-6FJ919999H125543PK3G4NAY/execute. 

我正在记录事情并且可以看到,就在 500 开始之前,我在日志中得到以下内容:

[24-02-2016 03:05:08] PayPal\Core\PayPalHttpConnection: INFO    : Response Status   : 200
[24-02-2016 03:05:08] PayPal\Core\PayPalHttpConnection: INFO : POST https://api.sandbox.paypal.com/v1/payments/payment/PAY-6FJ919999H125543PK3G4NAY/execute
[24-02-2016 03:05:08] PayPal\Core\PayPalHttpConnection: INFO : Invalid or no certificate authority found - Retrying using bundled CA certs file
[24-02-2016 03:05:23] PayPal\Core\PayPalHttpConnection: INFO : Response Status : 500
[24-02-2016 03:05:23] PayPal\Core\PayPalHttpConnection: ERROR : Got Http response code 500 when accessing https://api.sandbox.paypal.com/v1/payments/payment/PAY-6FJ919999H125543PK3G4NAY/execute. {"name":"INTERNAL_SERVICE_ERROR","message":"An internal service error has occurred","information_link":"https://developer.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR","debug_id":"fdefbd463f7b7"}

我的Laravel代码如下(PayPal返回)

public function getPaymentStatus()
{
// Get the payment ID before session clear
$payment_id = Session::get('paypal_payment_id');

// clear the session payment ID
//Session::forget('paypal_payment_id');

$payerID = Input::get('PayerID');
$token = Input::get('token');

if(empty($payerID) || empty($token))
{
// Payment Failed....
Flash::error('Payment Failed!');
Redirect::back();
}

$payment = Payment::get($payment_id, $this->_api_context);

// PaymentExecution object includes information necessary
// to execute a PayPal account payment.
// The payer_id is added to the request query parameters
// when the user is redirected from paypal back to your site
$execution = new PaymentExecution();
$execution->setPayerId(Input::get('PayerID'));

//Execute the payment
$result = $payment->execute($execution, $this->_api_context);

echo "Session Data....";
echo "<hr />";
echo "<pre>";
var_dump(Session::all());
echo "</pre>";

echo '<pre>';print_r($result);echo '</pre>';exit; // DEBUG RESULT, remove it later

if ($result->getState() == 'approved')
{
// Payment Made (Now Set Account To Active & Set Users' Options)...

// Also Check Where Referrer Was (If was register - set account up)
dd(Session::all());

}
return Redirect::route('original.route')
->with('error', 'Payment failed');
}

同样值得指出的是,我正在进行本地安装。这也可能是什么问题?不确定

谢谢!

最佳答案

此错误消息“无效或未找到证书颁发机构 - 正在使用捆绑的 CA 证书文件重试”表示证书文件问题。请下载最新的证书文件并将其放在 keystore 中。引用https://www.paypal-knowledge.com/infocenter/index?page=content&widgetview=true&id=FAQ1766&viewlocale=en_US

关于php - Laravel Paypal API 返回 500 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35605774/

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