Developer's Guide

Table Of Contents
Adaptive Payments Developer Guide August 7, 2012 103
Pay API Operation
Pay Examples Using NVP and CURL
curl -s --insecure
-H "X-PAYPAL-SECURITY-USERID: api_username"
-H "X-PAYPAL-SECURITY-PASSWORD: api_password"
-H "X-PAYPAL-SECURITY-SIGNATURE: api_signature"
-H "X-PAYPAL-REQUEST-DATA-FORMAT: NV"
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV"
-H "X-PAYPAL-APPLICATION-ID: app_id"
https://svcs.sandbox.paypal.com/AdaptivePayments/Pay -d
"actionType=PAY
&cancelUrl=http://your_cancel_url
&currencyCode=USD
&feesPayer=EACHRECEIVER
&memo=Preapproval-payment-example
&preapprovalKey=PA-9JR04288NR0519129
&receiverList.receiver(0).amount=100.00
&receiverList.receiver(0).email=receiver1@domain
&receiverList.receiver(0).primary=false
receiverList.receiver(1).amount=50.00
receiverList.receiver(1).email=receiver2@domain
receiverList.receiver(1).primary=false
&requestEnvelope.errorLanguage=en_US
&returnUrl=http://your_return_url
&reverseAllParallelPaymentsOnError=true
&senderEmail=sender@domain
Response:
responseEnvelope.timestamp=2009-07-13T12%3A34%3A29.316-07%3A00
&responseEnvelope.ack=Success
&responseEnvelope.correlationId=d615a365bed61
&responseEnvelope.build=DEV
&payKey=AP-42706441J12795911
&paymentExecStatus=COMPLE TED
Digital goods payment
In this example, the sender makes a payment of $1 to a PayPal-registered receiver. The sender
must explicitly approve the payment.
NOTE: The sample code below uses the insecure setting to work around the certificate for
testing in a sandbox environment. For actual implementations, you must specify the
location of the certificate.
Request: