Reputation: 516
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": "[email protected]",
"receiverList.receiver(0).amount": 50,
"receiverList.receiver(0).email": "[email protected]"
}
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}"
}]
}
Upvotes: 3
Views: 2081
Reputation: 866
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
.
Upvotes: 0
Reputation: 1
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');
Upvotes: 0
Reputation: 31
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.
Upvotes: 0
Reputation: 2348
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.
Upvotes: 0
Reputation: 4789
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.
Upvotes: 2