0
我爲我的網站使用Laravel 4.2,我正在設置付款。這似乎讓貝寶罰款,但返回回到我的網站的時候,我得到一個500錯誤...Laravel PayPal API返回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代碼如下(貝寶返回)
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');
}
還值得指出的是,我是在本地工作的插件高。這也可能是任何問題?不確定
謝謝!
此頁auth保護? – Derek