Question

I'm developing a Python binding for Paypal's Adaptive Payments API, currently I'm implementing the parallel/chained payments calls but I'm stuck in a rather cryptic error.

I've already implemented the basic "PAY" operation as detailed in Pay API Operation with the parameters as follows:

{'actionType': 'PAY',
'cancelUrl': 'http://my_domain.com/cancel_url',
'clientDetails.applicationId': 'My Application ID',
'clientDetails.ipAddress': 'MY IP',
'currencyCode': 'USD',
'receiverList.receiver(0).amount': 15,
'receiverList.receiver(0).email': 'sandbox_test_account@email.com',
'requestEnvelope.detailLevel': 'ReturnAll',
'requestEnvelope.errorLanguage': 'en_US',
'returnUrl': 'http://my_domain.com/cancel_url'}

And it's working really well, but when I try to add more receivers in the receiverList object Paypal's returning me an error that doesn't say anything:

{'error(0).category': ['Application'],
'error(0).domain': ['PLATFORM'],
'error(0).errorId': ['580001'],
'error(0).message': ['Invalid request: {0}'],
'error(0).severity': ['Error'],
'error(0).subdomain': ['Application'],
'responseEnvelope.ack': ['Failure'],
'responseEnvelope.build': ['2486531'],
'responseEnvelope.correlationId': ['f454f1118f799'],
'responseEnvelope.timestamp': ['2012-03-18T17:48:10.534-07:00']}

And it's all, it doesn't state where the request is invalid and I really can't find anything wrong with changing the first parameter set to add:

'receiverList.receiver(1).amount': 15,
'receiverList.receiver(1).email': 'sandbox_2nd_test_account@email.com'

Do I have to enable something to test chained/parallel payments in Sandbox or did I forget some configuration in the basic headers/params to send?

Thanks for any help

Was it helpful?

Solution

After contacting PayPal they told me to try to send the receiverList object in order, ex.:

{'actionType': 'PAY',
'cancelUrl': 'http://my_domain.com/cancel_url',
'clientDetails.applicationId': 'My Application ID',
'clientDetails.ipAddress': 'MY IP',
'currencyCode': 'USD',
'receiverList.receiver(0).amount': 15,
'receiverList.receiver(0).email': 'sandbox_test_account@email.com',
'receiverList.receiver(1).amount': 15,
'receiverList.receiver(1).email': 'sandbox_test_account@email.com',
'requestEnvelope.detailLevel': 'ReturnAll',
'requestEnvelope.errorLanguage': 'en_US',
'returnUrl': 'http://my_domain.com/cancel_url'}

As I was implementing the body as a Python dictionary it became unordered, so I started to use a OrderedDict which did the trick for me :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top