Created
August 28, 2012 21:13
-
-
Save xcommerce-gists/3504409 to your computer and use it in GitHub Desktop.
How to Make a Delayed Chained Payment Using Adaptive Payments.curl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HTTP Headers | |
| ------------ | |
| -H "X-PAYPAL-SECURITY-USERID: insert_developer_user_name" | |
| -H "X-PAYPAL-SECURITY-PASSWORD: insert_developer_password" | |
| -H "X-PAYPAL-SECURITY-SIGNATURE: insert_developer_signature" | |
| -H "X-PAYPAL-REQUEST-DATA-FORMAT: NV" | |
| -H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV" | |
| -H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" #Standard Sandbox App ID | |
| Endpoint | |
| -------- | |
| https://svcs.sandbox.paypal.com/AdaptivePayments/ExecutePayment | |
| Input Parameters | |
| ---------------- | |
| payKey=AP-9HY848657G6071234 #Value of the pay key, received in the Pay call above | |
| &requestEnvelope.errorLanguage=en_US | |
| Response | |
| -------- | |
| responseEnvelope.ack=Success | |
| &paymentExecStatus=COMPLETED | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HTTP Headers | |
| ------------ | |
| -H "X-PAYPAL-SECURITY-USERID: insert_developer_user_name_here" | |
| -H "X-PAYPAL-SECURITY-PASSWORD: insert_developer_password_here" | |
| -H "X-PAYPAL-SECURITY-SIGNATURE: insert_developer_signature_here" | |
| -H "X-PAYPAL-REQUEST-DATA-FORMAT: NV" | |
| -H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV" | |
| -H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" #Standard Sandbox App ID | |
| Endpoint | |
| -------- | |
| https://svcs.sandbox.paypal.com/AdaptivePayments/Pay | |
| Input Parameters | |
| ---------------- | |
| actionType=PAY_PRIMARY #The PAY_PRIMARY action type delays payment to non-primary receivers | |
| &clientDetails.applicationId=APP-80W284485P519543T #Standard Sandbox App ID | |
| &clientDetails.ipAddress=127.0.0.1 #Address from which request is sent | |
| ¤cyCode=USD #The currency, e.g. US dollars | |
| &feesPayer=EACHRECEIVER | |
| &memo=Example | |
| &receiverList.receiver(0).amount=25.00 #The payment amount for the first receiver | |
| &receiverList.receiver(0).email=insert_email_of_receiver1 | |
| &receiverList.receiver(0).primary=true #Receiver designation (there can be only 1 primary receiver) | |
| &receiverList.receiver(1).amount=5.00 #The payment amount for the second receiver | |
| &receiverList.receiver(1).email=insert_email_of_receiver2 | |
| &receiverList.receiver(1).primary=false | |
| &requestEnvelope.errorLanguage=en_US | |
| &returnUrl=http://www.yourdomain.com/success.html #For use if the consumer proceeds with payment | |
| &cancelUrl=http://www.yourdomain.com/cancel.html #For use if the consumer decides not to proceed with payment | |
| Response | |
| -------- | |
| responseEnvelope.ack=Success | |
| &payKey=AP-9HY848657G6071234 #Value of the pay key, for use in a redirect to the PayPal site | |
| &paymentExecStatus=CREATED #Indicates that a payment is set up, ready for a sender to click Pay on the PayPal site | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HTTP Headers | |
| ------------ | |
| -H "X-PAYPAL-SECURITY-USERID: insert_developer_user_name" | |
| -H "X-PAYPAL-SECURITY-PASSWORD: insert_developer_password" | |
| -H "X-PAYPAL-SECURITY-SIGNATURE: insert_developer_signature" | |
| -H "X-PAYPAL-REQUEST-DATA-FORMAT: NV" | |
| -H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV" | |
| -H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" #Standard Sandbox App ID | |
| Endpoint | |
| -------- | |
| https://svcs.sandbox.paypal.com/AdaptivePayments/PaymentDetails | |
| Input Parameters | |
| ---------------- | |
| payKey=AP-9HY848657G6071234 #Value of the pay key, received in the Pay call above | |
| &requestEnvelope.errorLanguage=en_US | |
| Response | |
| -------- | |
| responseEnvelope.ack=Success | |
| &cancelUrl=http%3A%2F%2Fwww.yourdomain.com%2Fcancel.html | |
| &returnUrl=http%3A%2F%2Fwww.yourdomain.com%2Fsuccess.html | |
| ¤cyCode=USD | |
| &memo=example | |
| &paymentInfoList.paymentInfo(0).transactionId=9EM14068G28701234 | |
| &paymentInfoList.paymentInfo(0).transactionStatus=COMPLETED | |
| &paymentInfoList.paymentInfo(0).receiver.amount=25.00 | |
| &paymentInfoList.paymentInfo(0).receiver.email=email_of_receiver_number_1 | |
| &paymentInfoList.paymentInfo(0).receiver.primary=true | |
| &paymentInfoList.paymentInfo(0).receiver.paymentType=SERVICE | |
| &paymentInfoList.paymentInfo(0).refundedAmount=0.00 | |
| &paymentInfoList.paymentInfo(0).pendingRefund=false | |
| &paymentInfoList.paymentInfo(0).senderTransactionId=66E25325WG7781234 | |
| &paymentInfoList.paymentInfo(0).senderTransactionStatus=COMPLETED | |
| &paymentInfoList.paymentInfo(1).receiver.amount=5.00 | |
| &paymentInfoList.paymentInfo(1).receiver.email=email_of_receiver_number_2 | |
| &paymentInfoList.paymentInfo(1).receiver.primary=false | |
| &paymentInfoList.paymentInfo(1).receiver.paymentType=SERVICE | |
| &paymentInfoList.paymentInfo(1).refundedAmount=0.00 | |
| &paymentInfoList.paymentInfo(1).pendingRefund=false | |
| &status=INCOMPLETE #Indicates that the secondary receiver has not been paid | |
| &payKey=AP-9HY848657G6071234 | |
| &actionType=PAY_PRIMARY | |
| &feesPayer=EACHRECEIVER | |
| &reverseAllParallelPaymentsOnError=false | |
| &sender.email=sender_email | |
| &sender.useCredentials=false | |
| ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment