paypal GetBasicPersonalData The + X-PAYPAL-APPLICATION-ID + header + contains + an + invalid + value issue php

时间:2018-08-21 05:53:45

标签: php paypal paypal-adaptive-payments

$accessToken = $parsed['token'];
$tokenSecret = $parsed['tokenSecret'];
$url = "https://api.sandbox.paypal.com/nvp";

$auth = new AuthSignature();
$response = $auth->genSign($apiCred_user ,$apiCred_pass ,$accessToken,$tokenSecret,'POST',$url);

$authString = "token=".$accessToken.",signature=".$response['oauth_signature'].",timestamp=".$response['oauth_timestamp'];              
$header_bacic[] = "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T";
$header_bacic[] = "X-PAYPAL-REQUEST-DATA-FORMAT: NV";
$header_bacic[] = "X-PAYPAL-RESPONSE-DATA-FORMAT: NV";
$header_bacic[] = "X-PAYPAL-AUTHORIZATION: " .$authString;

$url_api = "https://svcs.paypal.com/Permissions/GetBasicPersonalData";

$curl_session =  curl_init();
curl_setopt($curl_session, CURLOPT_URL,$url_api );
curl_setopt($curl_session, CURLOPT_HTTPHEADER, $header_bacic);
curl_setopt($curl_session, CURLOPT_POST, 1);
curl_setopt($curl_session, CURLOPT_POSTFIELDS, "requestEnvelope.errorLanguage=en_US&attributeList.attribute(0)=http://axschema.org/contact/email");
curl_setopt($curl_session, CURLOPT_CONNECTTIMEOUT,10); 
curl_setopt($curl_session, CURLOPT_TIMEOUT, 10);                
curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_session, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($curl_session);           
curl_close($curl_session);

此请求返回以下错误:

The+X-PAYPAL-APPLICATION-ID+header+contains+an+invalid+value

0 个答案:

没有答案