Developer's Guide
Table Of Contents
Website Payments Pro Developer’s Guide 51
PayPal Express Checkout Transaction Processing
PayPal Express Checkout Sale Transaction Example
6
In addition to the parameter values required by all transaction types described in Chapter 3,
“Creating a Simple Transaction Request,” and the minimum required parameters for a Sale
transaction described in Chapter 4, “Performing Direct Payment Credit Card Transactions,”
Set Express Checkout requires that you pass data for the following parameters.
ACTION
AMT
RETURNURL
CANCELURL
EXAMPLE 6.1 Set Express Checkout request parameter string for a Sale transaction
"TRXTYPE=S&ACTION=S&AMT=35.00&CANCELURL=http://www.order_page.com&PARTNER=P
ayPalUK&PWD=SuperUserPassword&RETURNURL=http://www.confirmation_page.com&TE
NDER=P&USER=SuperMerchant&VENDOR=SuperMerchant"
It is strongly recommended that RETURNURL be the URL of the final review page on your
website, where the customer confirms the order and payment. Likewise, CANCELURL
should be the URL of the original page on your website where the customer initially chose to
use PayPal.
EXAMPLE 6.2 Set Express Checkout response
RESULT=0&RESPMSG=Approved&TOKEN=EC-17C76533PL706494P
You use the TOKEN value in the response to refer to this particular transaction in the
following requests to PayPal (as shown in Figure 6.1 on page 48).
z In the HTTP request to redirect the customer’s browser to the PayPal website (described in
“Redirecting the Customer to PayPal Example” on page 51).
z In the Get Express Checkout Details request to obtain the customer’s billing information
(described in “Redirecting the Customer to PayPal Example” on page 51).
z In the Do Express Checkout Payment request to carry out the transaction (described in “Do
Express Checkout Payment (ACTION=D)” on page 53).
Redirecting the Customer to PayPal Example
After your buyer clicks the PayPal button and you submit the Set Express Checkout request,
you will want to automatically direct your customer to the PayPal website. The redirect URL
for this is:
"https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=<TOKEN>"
where TOKEN is the value returned in the Set Express Checkout response.
PayPal recommends that you use the HTTPS response 302 “Object Moved” with your URL as
the value of the Location header in the HTTPS response. Alternatively, you can generate a
web page for your buyer that includes a META REFRESH tag in the header. An example is
shown below. Remember to replace <TOKEN> with the token value that you received in the
Set Express Checkout response.