Created
October 31, 2012 21:47
-
-
Save xcommerce-gists/3990132 to your computer and use it in GitHub Desktop.
How to Create and Process an Order Using Express Checkout.curl
This file contains 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
Request | |
------- | |
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp | |
HTTP method: POST | |
POST data: | |
USER=merchant_user_name | |
&PWD=merchant_password | |
&SIGNATURE=merchant_signature | |
&METHOD=DoCapture | |
&VERSION=95 | |
&AUTHORIZATIONID=75324566RU7001234 #Specify the DoAuthorization response's TRANSACTIONID value | |
&AMT=11 | |
&CURRENCYCODE=USD | |
&COMPLETETYPE=NotComplete #If more authorizations will occur for this order, specify NotComplete; otherwise, specify Complete | |
Response | |
-------- | |
AUTHORIZATIONID=75324566RU7001234 | |
&ACK=Success | |
&TRANSACTIONID=0HL73671RY5781234 | |
&PARENTTRANSACTIONID=75324566RU7001234 | |
&TRANSACTIONTYPE=expresscheckout | |
&PAYMENTTYPE=instant | |
&ORDERTIME=2012%2d10%2d31T00%3a49%3a28Z | |
&AMT=11%2e00 | |
&FEEAMT=0%2e62 | |
&TAXAMT=0%2e00 | |
&CURRENCYCODE=USD | |
&PAYMENTSTATUS=Completed | |
... |
This file contains 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
Request | |
------- | |
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp | |
HTTP method: POST | |
POST data: | |
USER=merchant_user_name | |
&PWD=merchant_password | |
&SIGNATURE=merchant_signature | |
&METHOD=DoExpressCheckoutPayment | |
&VERSION=95 | |
&TOKEN=EC-40319508UX6051234 #URL-decoded token obtained from the SetExpressCheckout response | |
&PAYERID=3TXTXECKF1234 #Customer account ID, obtained from the GetExpressCheckoutDetails response | |
&PAYMENTREQUEST_0_PAYMENTACTION=Order #Creates an order, including an agreement to pay multiple authorized amounts | |
&PAYMENTREQUEST_0_AMT=20 #The amount authorized for the order | |
&PAYMENTREQUEST_0_CURRENCYCODE=USD | |
Response | |
-------- | |
TOKEN=EC%2d40319508UX6051234 | |
&ACK=Success | |
&PAYMENTINFO_0_TRANSACTIONID=O%2d2GN90824037101234 #URL-decode this value for use in the DoAuthorization API calls | |
&PAYMENTINFO_0_ORDERTIME=2012%2d10%2d31T00%3a43%3a00Z | |
&PAYMENTINFO_0_AMT=20%2e00 | |
&PAYMENTINFO_0_SECUREMERCHANTACCOUNTID=QJSRDC4JW1234 | |
&PAYMENTINFO_0_ACK=Success | |
... |
This file contains 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
Request | |
------- | |
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp | |
HTTP method: POST | |
POST data: | |
USER=merchant_user_name | |
&PWD=merchant_password | |
&SIGNATURE=merchant_signature | |
&METHOD=GetExpressCheckoutDetails | |
&VERSION=95 | |
&TOKEN=EC-40319508UX6051234 #URL-decoded token obtained in the SetExpressCheckout response | |
Response | |
-------- | |
TOKEN=EC%2d40319508UX6051234 | |
&ACK=Success | |
&PAYERID=3TXTXECKF1234 #Customer account ID, for use in the DoExpressCheckoutPayment call | |
... |
This file contains 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
Request | |
------- | |
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp | |
HTTP method: POST | |
POST data: | |
USER=merchant_user_name | |
&PWD=merchant_password | |
&SIGNATURE=merchant_signature | |
&METHOD=SetExpressCheckout | |
&VERSION=95 | |
&PAYMENTREQUEST_0_PAYMENTACTION=Order #Sets up an authorization for an order | |
&PAYMENTREQUEST_0_AMT=20 #The amount authorized | |
&PAYMENTREQUEST_0_CURRENCYCODE=USD #The currency, e.g. US dollars | |
&cancelUrl=http://www.yourdomain.com/cancel.html | |
&returnUrl=http://www.yourdomain.com/success.html | |
Response | |
-------- | |
TOKEN=EC%2d40319508UX6051234 | |
&ACK=Success | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment