3

I'm having some difficulty implementing paypal implicit payments and unfortunately there is very limited details in the error message response from paypal.

Here's the request:

{
    "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"
}

Here's the headers i'm setting:

    "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"

Here's the response:

{
    "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}"
      }]
}
Brock Haywood
  • 516
  • 2
  • 10

5 Answers5

2

I just had the exact same problem and couldn't find the answer anywhere. Turns out I was using a GET request instead of POST. It's odd though that the errorId 580001 is nowhere to be found in their docs.

antonagestam
  • 4,532
  • 3
  • 32
  • 44
  • 4
    Sadly, in my experience Paypal documentation is lacking in many ways... :-( – Max Apr 10 '13 at 14:52
  • 4
    @Max I'm just getting started with Paypal and the lack of good documentation has made the learning curve much steeper than it needs to be! – antonagestam Apr 11 '13 at 10:27
  • Here http://stackoverflow.com/q/9939960/1057961 you can find my experience with paypal (it mostly related to on-the-fly the creation of encrypted PayNow button for Third-party customers) – Max Apr 11 '13 at 12:18
0

The adaptive payments API doesn't accept whitespace in the request payload, remove all the spaces and newlines and give it another try. Took me ages to figure that out.

Conan
  • 2,288
  • 1
  • 28
  • 42
0

Another thing to look out for is encoding. I've had this error and realised that it was due to an ampersand in the "memo" field. If you send the request as NVP be sure to URL encode where possible.

Al B
  • 31
  • 1
  • 3
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');
rameez
  • 1
  • 1
  • It would be helpful only If you provide some details or explanation about the solution. Just code only answers are not useful. – Thangadurai May 05 '17 at 06:54
0

As another cause of this issue, make sure the amount property for each receiver does not contain a comma, as this will also break. I.e. 1000.00 instead of 1,000.00.

MattRogowski
  • 726
  • 2
  • 7
  • 22