更新时间: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;
}