Study Guide

Table Of Contents
PayPal Certified Developer Program Study Guide March 2008 127
Sandbox Testing
Testing PayPal NVP APIs
9
<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>
N OTE: The API username is a Sandbox business test account for which a signature exists.
To obtain a signature, see the Test Certificates tab of the Sandbox.
2. PayPal responds with a message, like 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=3%3e300000
&BUILD=1%2e0006
&TOKEN=EC%2d1NK66318YB717835M
3. If the operation was successful, use the token and redirect your browser to the Sandbox, as
follows:
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout
&token=EC-1NK66318YB717835M
N OTE: You may need to replace hexadecimal codes in the token with ASCII codes; for
example, you may need to replace %2d in the token with a hyphen ( - ).
4. Log into the Sandbox and confirm details. You must log in to https://developer.paypal.com
and select the test account that represents the buyer, not the
API_username business test
account that represents you as the merchant. Then click Enter Sandbox Test Site.
When you confirm, the Sandbox redirects your browser to the return URL you specified
when calling SetExpressCheckout, as in the following example:
http://www.YourReturnURL.com/
?token=EC-1NK66318YB717835M&PayerID=7AKUSARZ7SAT8
5. Invoke a form on your site that calls the GetExpressCheckout API on the Sandbox:
<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=3.3>
<input name=TOKEN value=EC-1NK66318YB717835M>
<input type=submit name=METHOD value=GetExpressCheckoutDetails>
</form>