且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

0-访问https://api.sandbox.paypal.com/v1/payments/payment时获得Http响应代码400

更新时间:2022-05-29 06:02:53

如果将调用包装在try/catch块中并捕获PPConnectionException,则可以检查数据以查看错误的确切原因:

If you wrap your call in a try/catch block and catch the PPConnectionException, you can examine the data to see exactly what the error is:

// ...
try {
    $response = $pp_payment->create();
} catch (PayPal\Exception\PPConnectionException $pce) {
    // Don't spit out errors or use "exit" like this in production code
    echo '<pre>';print_r(json_decode($pce->getData()));exit;
}