dongxu4580 2013-11-27 20:20
浏览 65
已采纳

580001无效请求:{0} PayPal(PHP)

I'm sending userid and password from this page: https://www.paypal.com/us/cgi-bin/webscr?cmd=_profile-api-signature

And the AppId is the ID I use in my android app to create payments: https://apps.paypal.com/user/my-account/applications

I'm using the follow function:

function verify_paypal($payKey, $appID)
{
  global $payPalUser_Id, $payPalPassword, $payPalSig;
$headerArray = array(
'X-PAYPAL-SECURITY-USERID:'.$payPalUser_Id,
'X-PAYPAL-SECURITY-PASSWORD:'.$payPalPassword,
'X-PAYPAL-SECURITY-SIGNATURE:'.$payPalSig,
'X-PAYPAL-REQUEST-DATA-FORMAT:JSON',
'X-PAYPAL-RESPONSE-DATA-FORMAT:XML',
'X-PAYPAL-APPLICATION-ID:'.$appID
);

$url="https://svcs.paypal.com/AdaptivePayments/PaymentDetails?payKey={$payKey}&requestEnvelope.errorLanguage=en_US";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headerArray);
$adaptiveResponse = curl_exec($ch);
curl_close($ch);
return $adaptiveResponse;
}

But it gives this error:

<?xml version='1.0' encoding='UTF-8'?>
<ns3:FaultMessage xmlns:ns3="http://svcs.paypal.com/types/common" xmlns:ns2="http://svcs.paypal.com/types/ap">
<responseEnvelope>
<timestamp>2013-11-27T14:58:07.463-08:00</timestamp>
<ack>Failure</ack>
<correlationId>d97c635f935b3</correlationId>
<build>7935900</build>
</responseEnvelope>
<error>
<errorId>580001</errorId>
<domain>PLATFORM</domain>
<subdomain>Application</subdomain>
<severity>Error</severity>
<category>Application</category>
<message>Invalid request: {0}</message>
</error>
</ns3:FaultMessage>
  • 写回答

1条回答 默认 最新

  • douhui8163 2013-11-28 00:46
    关注

    REQUEST-DATA-FORMAT should be NV:

    $headerArray = array(
    'X-PAYPAL-SECURITY-USERID:'.$payPalUser_Id,
    'X-PAYPAL-SECURITY-PASSWORD:'.$payPalPassword,
    'X-PAYPAL-SECURITY-SIGNATURE:'.$payPalSig,
    'X-PAYPAL-REQUEST-DATA-FORMAT:NV',
    'X-PAYPAL-RESPONSE-DATA-FORMAT:JSON',
    'X-PAYPAL-APPLICATION-ID:'.$appID
    );
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?