3

我在实施贝宝隐式付款时遇到了一些困难,不幸的是,贝宝​​的错误消息响应中的细节非常有限。

这是请求:

{
    "actionType": "PAY", 
    "currencyCode": "USD", 
    "cancelUrl": "http://my_domain.com/cancel_url", 
    "returnUrl": "http://my_domain.com/return_url", 
    "requestEnvelope.errorLanguage": "en_US", 
    "requestEnvelope.detailLevel": "ReturnAll", 
    "senderEmail": "sender@email.com", 
    "receiverList.receiver(0).amount": 50, 
    "receiverList.receiver(0).email": "receiver@email.com"
}

这是我正在设置的标题:

    "Content-Type", "application/json"
    "Accept-Language", "en_US"

    "X-PAYPAL-SECURITY-USERID", "username"
    "X-PAYPAL-SECURITY-PASSWORD", "pwd"                           
    "X-PAYPAL-SECURITY-SIGNATURE", "sig"                           
    "X-PAYPAL-APPLICATION-ID", "My App id"
    "X-PAYPAL-REQUEST-DATA-FORMAT", "JSON"
    "X-PAYPAL-RESPONSE-DATA-FORMAT", "JSON"

这是回应:

{
    "responseEnvelope":{
      "timestamp":"2013-04-06T12:02:41.011-07:00",
      "ack":"Failure",
      "correlationId":"3842d361b077d",
      "build":"5563463"},"error":[{
         "errorId":"580001",
        "domain":"PLATFORM",
        "subdomain":"Application",
        "severity":"Error",
        "category":"Application",
        "message":"Invalid request: {0}"
      }]
}
4

5 回答 5

2

我只是遇到了完全相同的问题,在任何地方都找不到答案。原来我使用的是 GET 请求而不是 POST。奇怪的是,errorId 580001 在他们的文档中找不到。

于 2013-04-10T14:33:40.587 回答
0

自适应支付 API 不接受请求负载中的空格,请删除所有空格和换行符,然后再试一次。我花了很长时间才弄清楚这一点。

于 2014-09-11T14:37:00.843 回答
0

作为此问题的另一个原因,请确保amount每个接收器的属性不包含逗号,因为这也会中断。即1000.00代替1,000.00.

于 2018-02-22T18:36:16.250 回答
0

另一件需要注意的是编码。我遇到了这个错误,并意识到这是由于“备忘录”字段中的 & 符号造成的。如果您将请求作为 NVP 发送,请务必尽可能进行 URL 编码。

于 2015-08-17T08:40:36.653 回答
0
let payload={
  "actionType":"PAY",                             
  "currencyCode":"USD",                          
  "receiverList":{
    "receiver":[{
      "amount":1.00,                             
      "email":"buyer email"    
    }]
  },
  "returnUrl":"succes url", 
  "cancelUrl":"cancel url",  
  "requestEnvelope":{
  "errorLanguage":"en_US",                        
  "detailLevel":"ReturnAll"                        
  }
}
let url = "https://svcs.sandbox.paypal.com/AdaptivePayments/Pay";
    return this.http.post(url, payload, { headers: headers })
    headers.append('X-PAYPAL-SECURITY-USERID', 'security id');
    headers.append('X-PAYPAL-SECURITY-PASSWORD', 'password');
    headers.append('X-PAYPAL-SECURITY-SIGNATURE', 'signature');
    headers.append('X-PAYPAL-REQUEST-DATA-FORMAT', 'JSON');
    headers.append('X-PAYPAL-RESPONSE-DATA-FORMAT', 'JSON');
    headers.append('X-PAYPAL-APPLICATION-ID', 'APP-id');
于 2017-05-05T06:46:12.017 回答