这是我的代码:
if($approved) {
$payerId = $_GET['PayerID'];
// Get payment_id from database
$paymentId = mysql_query("Select payment_id from transactions_paypal WHERE hash = '".$_SESSION['paypal_hash']."'");
$paymentId = mysql_fetch_array($paymentId);
$payment = Payment::get($paymentId, $apiContext);
echo "<pre>";
var_dump($payment);
echo "</pre>";
die();
}else {
header('Location: ../paypal/cancelled.php');
}
但我得到这个错误:
注意:第 322 行 C:\xampp\htdocs\Tipperen\test\PayPal-PHP-SDK\paypal\rest-api-sdk-php\lib\PayPal\Api\Payment.php 中的数组到字符串转换
或者
致命错误:访问https://api.sandbox.paypal.com/v1/payments/payment/Array时未捕获异常 'PayPal\Exception\PayPalConnectionException' 并带有消息'Got Http response code 404 。在 C:\xampp\htdocs\Tipperen\test\PayPal-PHP-SDK\paypal\rest-api-sdk-php\lib\PayPal\Core\PayPalHttpConnection.php:159 堆栈跟踪:#0 C:\xampp\htdocs \Tipperen\test\PayPal-PHP-SDK\paypal\rest-api-sdk-php\lib\PayPal\Transport\PayPalRestCall.php(74): PayPal\Core\PayPalHttpConnection->execute('') #1 C: \xampp\htdocs\Tipperen\test\PayPal-PHP-SDK\paypal\rest-api-sdk-php\lib\PayPal\Common\PayPalResourceModel.php(103): PayPal\Transport\PayPalRestCall->execute(Array, ' /v1/payments/pa...', 'GET', '', NULL) #2 C:\xampp\htdocs\Tipperen\test\PayPal-PHP-SDK\paypal\rest-api-sdk-php\lib \PayPal\Api\Payment.php(328): PayPal\Common\PayPalResourceModel::executeCall('/v1/payments/pa...', 'GET', '', NULL, Object(PayPal\Rest\ApiContext) , NULL) #3 C:
请帮我。