0
我有麻煩讓此代碼工作。它不斷返回「API憑據不正確」,但在Paypal API Explorer中使用它的工作原理相同!paypal憑證不正確外部的Api Explorer
$headers = array(
"X-PAYPAL-SECURITY-USERID" => "****",
"X-PAYPAL-SECURITY-PASSWORD" => "****",
"X-PAYPAL-SECURITY-SIGNATURE" => "****",
"X-PAYPAL-APPLICATION-ID" => "APP-80W284485P519543T",
"X-PAYPAL-REQUEST-DATA-FORMAT" => "JSON",
"X-PAYPAL-RESPONSE-DATA-FORMAT" => "JSON",
"X-PAYPAL-DEVICE-IPADDRESS" => "****",
"X-PAYPAL-REQUEST-SOURCE" => "merchant-php-sdk-2.0.96"
);
$data = array(
'emailAddress' => '[email protected]',
'matchCriteria' => 'NONE'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://svcs.sandbox.paypal.com/AdaptiveAccounts/GetVerifiedStatus");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = json_decode(curl_exec($ch),true);
print_r($response);
curl_close ($ch);