わかりました、私はこれと他の多くのフォーラムを検索しましたが、解決策はありません.
私はこのコードを持っています:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sandbox.paypal.com/v1/payments/payment");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: Bearer ' . $this->auth['access_token']
));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array(
'intent' => 'sale',
'redirect_urls' => array(
'return_url' => 'http://andershagbard.wep.dk/goingpro/',
'cancel_url' => 'http://andershagbard.wep.dk/goingpro/'
),
'payer' => array (
'payment_method' => 'paypal'
),
'transactions' => array(
'amount' => array(
'total' => '5.00',
'currency' => 'USD'
),
'description' => 'This is the payment transaction description.'
)
)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
そして、それは戻ります
(
[name] => MALFORMED_REQUEST
[message] => Incoming JSON request does not map to API request
[information_link] => https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST
[debug_id] => 27f7487f9c07f