Integration Guide

Table Of Contents
Express Checkout Integration Guide May 2010 45
Testing an Express Checkout Integration
5
<form method=post action=https://api-3t.sandbox.paypal.com/nvp>
<input type=hidden name=USER value= API_username>
<input type=hidden name=PWD value= API_password>
<input type=hidden name=SIGNATURE value= API_signature>
<input type=hidden name=VERSION value=52.0>
<input type=hidden name=PAYMENTACTION value=Sale>
<input name=AMT value=19.95>
<input type=hidden name=RETURNURL
value=http://www.YourReturnURL.com>
<input type=hidden name=CANCELURL
value=http://www.YourCancelURL.com>
<input type=submit name=METHOD value=SetExpressCheckout>
</form>
NOTE: The API username is a Sandbox business test account for which a signature exists. See
the Test Certificates tab of the Sandbox to obtain a signature. If you are not using a
signature, you must use a different Sandbox server.
2. Review the response string from the SetExpressCheckout API operation.
PayPal responds with a message, such as the one shown below. Note the status, which
should include ACK set to Success, and a token that is used in subsequent steps.
TIMESTAMP=2007%2d04%2d05T23%3a23%3a07Z
&CORRELATIONID=63cdac0b67b50
&ACK=Success
&VERSION=52%2e000000
&BUILD=1%2e0006
&TOKEN=EC%2d1NK66318YB717835M
3. If the operation was successful, use the token and redirect your browser to the Sandbox to
log in, as follows:
https://www.sandbox.paypal.com/cgi-bin/webscr?
cmd=_express-checkout
&token=EC-1NK66318YB717835M
NOTE: The token in the command line is an HTTP request parameter and not the NVP
field; this parameter name must be lowercase.
You may need to replace hexadecimal codes with ASCII codes; for example, you may need
to replace %2d in the token with a hyphen ( - ).
You must log in to https://developer.paypal.com before you log in to a Sandbox
test account. You then log in to the test account that represents the buyer, not the
API_username business test account that represents you as the merchant.
4. After logging into the buyer test account, confirm the details.
When you confirm, the Sandbox redirects your browser to the return URL you specified
when invoking the SetExpressCheckout API operation, as in the following example: