这是我的代码:
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');
}
但我得到了这个错误:
注意:数组转换为字符串 C:\ XAMPP \ htdocs中\ Tipperen \测试\贝宝PHP-SDK \贝宝\ REST的API-SDK-PHP \ LIB \贝宝\阿比\ Payment.php 在322行
或
致命错误:未捕获的异常 'PayPal \ Exception \ PayPalConnectionException',消息'Got Http 访问时的响应代码404 https://api.sandbox.paypal.com/v1/payments/payment/Array“。在 C:\ XAMPP \ htdocs中\ Tipperen \测试\贝宝PHP-SDK \贝宝\ REST的API-SDK-PHP \ lib中\贝\核心\ PayPalHttpConnection.php:159 堆栈跟踪:#0 C:\ XAMPP \ htdocs中\ Tipperen \测试\贝宝PHP-SDK \贝宝\ REST的API-SDK-PHP \ lib中\贝\运输\ PayPalRestCall.php(74): PayPal \ Core \ PayPalHttpConnection-&gt;执行('')#1 C:\ XAMPP \ htdocs中\ Tipperen \测试\贝宝PHP-SDK \贝宝\ REST的API-SDK-PHP \ lib中\贝\共同\ PayPalResourceModel.php(103): PayPal \ Transport \ PayPalRestCall-&gt;执行(数组,'/ v1 / payments / pa ...', 'GET','',NULL)#2 C:\ XAMPP \ htdocs中\ Tipperen \测试\贝宝PHP-SDK \贝宝\ REST的API-SDK-PHP \ lib中\贝\阿比\ Payment.php(328): 贝宝\ COMMON \ PayPalResourceModel :: executeCall( '/ V1 /支付/ PA ......', 'GET','',NULL,Object(PayPal \ Rest \ ApiContext),NULL)#3 C:\ XAMPP \ htdocs中\ Tipperen \测试\贝宝\ pay.php(20): PayPal \ Api \ Payment :: get(Array,Object(PayPal \ Rest \ ApiContext))in C:\ XAMPP \ htdocs中\ Tipperen \测试\贝宝PHP-SDK \贝宝\ REST的API-SDK-PHP \ LIB \贝宝\核心\ PayPalHttpConnection.php 在第159行
请帮帮我。