0
我想在我的系統中整合paypal的單筆付款方式,因爲我想在請求退款時向我的賣家匯款。我爲此生成了一個「訪問令牌密鑰」,並從PHP腳本進行卷曲調用。但迴應是空白字符串。我試過curl_error($curl);
,但這也沒有做任何事情。下面是我的代碼paypal單筆付款空白回覆
// data to be sent
$data = [
'sender_batch_header' => [
'email_subject' => "You have a payment",
'sender_batch_id' => "125458268"
],
'items' => [
[
'recipient_type' => "EMAIL",
'amount' => [
'value' => "12.00",
'currency' => "USD"
],
'receiver' => '[email protected]',
'note' => 'A trial for single payout',
'sender_item_id' => "2014031400456"
],
],
];
//curl link for single payout with sync off
$curl = curl_init("https://api.sandbox.paypal.com/v1/payments/payouts?sync_mode=true");
$header = array(
"Content-Type: application/json",
"Authorization: Bearer ".$access_token ,
);
$options = array(
CURLOPT_HTTPHEADER => $header,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_POSTFIELDS => json_encode($values),
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_TIMEOUT => 10
);
curl_setopt_array($curl, $options);
$rep = curl_exec($curl);
$response = json_decode($rep, true);
curl_close($curl);
但在這裏我代表$是一個空字符串,試圖讓單一的支付細節爲好,但也將返回一個空字符串......請help..thanx提前。