【问题标题】:Laravel PayPal API Returning 500 ErrorLaravel PayPal API 返回 500 错误
【发布时间】:2016-06-06 22:57:35
【问题描述】:

我正在为我的网站使用 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');
    }

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

谢谢!

【问题讨论】:

  • 此页面是否受到身份验证保护?

标签: php laravel paypal


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2017-11-27
    • 2017-11-13
    • 2015-12-26
    • 2022-07-04
    • 2017-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-23
    相关资源
    最近更新 更多