php - Paypal API - GetVerifiedStatus - Invalid request -
i'm trying integrate paypal api in php application. use curl call remote method getverifiedstatus, i'm getting error 580023 - invalid request.
my request:
'requestenvelope.errorlanguage=en_us&requestenvelope.detaillevel=returnall&emailaddress=email%40address.com&firstname=john&lastname=doe&matchcriteria=name'
response after converting json:
{ "responseenvelope.timestamp":"2013-07-25t05:36:26.695-07:00", "responseenvelope.ack":"failure", "responseenvelope.correlationid":"e540c8c04a5b4", "responseenvelope.build":"6679946", "error(0).errorid":"580023", "error(0).domain":"platform", "error(0).subdomain":"application", "error(0).severity":"error", "error(0).category":"application", "error(0).message":"cannot determine paypal account status" }
curl code
function hash_call_account($methodname, $nvpstr) { //declaring of global variables $this->api_endpoint_adaptive_account .= "/" . $methodname; //setting curl parameters. $ch = curl_init(); curl_setopt($ch, curlopt_url,$this->api_endpoint_adaptive_account); curl_setopt($ch, curlopt_verbose, 1); //turning off server , peer verification(trustmanager concept). curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_ssl_verifyhost, false); curl_setopt($ch, curlopt_returntransfer,1); curl_setopt($ch, curlopt_post, 1); // set http headers curl_setopt($ch, curlopt_httpheader, array( 'x-paypal-request-data-format: nv', 'x-paypal-response-data-format: nv', 'x-paypal-security-userid: ' . $this->api_username, 'x-paypal-security-password: ' .$this->api_password, 'x-paypal-security-signature: ' . $this->api_signature, 'x-paypal-application-id: ' . $this->api_appid )); //if use_proxy constant set true in constants.php, proxy enabled. //set proxy name proxy_host , port number proxy_port in constants.php if($this->use_proxy) curl_setopt ($ch, curlopt_proxy, $this->proxy_host. ":" . $this->proxy_port); // requestenvelope fields $detaillevel = urlencode("returnall"); // see detaillevelcode in wsdl valid enumerations $errorlanguage = urlencode("en_us"); // should standard rfc 3066 language identification tag, e.g., en_us // nvprequest submitting server $nvpreq = "requestenvelope.errorlanguage=$errorlanguage&requestenvelope.detaillevel=$detaillevel"; $nvpreq .= "&$nvpstr"; //echo $nvpreq; die; //setting nvpreq post field curl curl_setopt($ch, curlopt_postfields, $nvpreq); //getting response server $response = curl_exec($ch); //converting nvpresponse associative array $nvpresarray=$this->deformatnvp($response); $nvpreqarray=$this->deformatnvp($nvpreq); $_session['nvpreqarray']=$nvpreqarray; if (curl_errno($ch)) { // moving display page display curl errors $_session['curl_error_no']=curl_errno($ch) ; $_session['curl_error_msg']=curl_error($ch); //execute error handling module display errors. } else { //closing curl curl_close($ch); } return $nvpresarray; }
config:
configure::write('parallelpaypalapi.url', 'https://svcs.sandbox.paypal.com/adaptivepayments'); configure::write('parallelpaypalapi.adaptiveaccounturl', 'https://svcs.sandbox.paypal.com/adaptiveaccounts'); configure::write('parallelpaypalapi.api_username', user); configure::write('parallelpaypalapi.api_password', password); configure::write('parallelpaypalapi.api_signature', signature); configure::write('parallelpaypalapi.business', business); configure::write('parallelpaypalapi.paymentdetailurl', 'https://svcs.sandbox.paypal.com/adaptivepayments/paymentdetails'); configure::write('parallelpaypalapi.appid', appid);
could problem version of api? there problem nvp request?
i ran same problem , contacted paypal technical support , solution error 580023 normal behavior when name fails match email of paypal account. confusing because there nothing wrong @ request, contrary response message implies. example, if having same issue need change john doe first name , last name of user associated paypal email trying match against.
transcript convo paypal mts:
"the error receiving expected. in order response of verified or unverified, name provide must match email address provide."
Comments
Post a Comment