私はこの問題と5日間戦ってきました。それは私にとって謎です。このコードがエラー 52003 を返す理由、API 資格情報が正しくない理由を誰でも知ることができますか? あなたの助けや新鮮な見解は大歓迎です。
<?php
$USER_ID="userid";
$USER_PASS="userpass";
$USER_SIG="usersig";
$APP_ID="appid";
$apiUrl="https://svcs.sandbox.paypal.com/AdaptivePayments/Pay";
$headers = array(
"X-PAYPAL-SECURITY-USERID: ".$USER_ID,
"X-PAYPAL-SECURITY-PASSWORD: ".$USER_PASS,
"X-PAYPAL-SECURITY-SIGNATURE: ".$USER_SIG,
"X-PAYPAL-APPLICATION-ID: ".$APP_ID,
"X-PAYPAL-REQUEST-DATA-FORMAT: JSON",
"X-PAYPAL-RESPONSE-DATA-FORMAT: JSON"
);
$createPacket = array (
"actionType"=>"PAY",
"currencyCode"=>"EUR",
"receiverList"=> array (
"receiver"=> array(
array(
"amount"=> "1",
"email"=>"merchant1@someemail.sk"
),
array(
"amount"=> "2",
"email"=>"merchant2@someemail.sk"
)
)
),
"returnUrl"=>"https://www.sandbox.paypal.com/",
"cancelUrl"=>"https://www.sandbox.paypal.com/",
"requestEnvelope"=>array(
"errorLanguage"=>"en_US"
)
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($createPacket));
curl_setopt($ch, CURLOPT_HEADER, array($headers));
$result= curl_exec($ch);
curl_close($ch);
echo $result;
?>