2007

Table Of Contents
NVP API Web Samples
Descriptions of the Samples
96 April 2007 Name-Value Pair API Developer Guide and Reference
The primary files for this sample are:
TABLE C.1 Express Checkout Files
File Description
SetExpressCheckout.
ext This is the main web page for the Express Checkout sample.
The page allows the user to enter amount and currency type. It
also accept input variable paymentType which becomes the
value of the PAYMENTACTION parameter.
When the user clicks the
Submit button, ReviewOrder.ext is
called.
Called by index.html or Default.htm.
Calls ReviewOrder.
ext.
ReviewOrder.
ext This file is called after the user clicks on a button during the
checkout process to use PayPal's Express Checkout. The user
logs in to their PayPal account.
This file is called twice.
On the first pass, the code executes the if statement:
if (! isset ($token))
The code collects transaction parameters from the form
displayed by SetExpressCheckout.
ext then constructs and
sends a SetExpressCheckout request string to the PayPal
server. The paymentType variable becomes the
PAYMENTACTION parameter of the request string. The
RETURNURL parameter is set to this file; this is how
ReviewOrder.
ext is called twice.
On the second pass, the code executes the else statement.
On the first pass, the buyer completed the authorization in their
PayPal account; now the code gets the payer details by sending
a GetExpressCheckoutDetails request to the PayPal
server. Then the code calls GetExpressCheckoutDetails.
ext.
N OTE: Be sure to check the value of PAYPAL_URL. The buyer
is sent to this URL to authorize payment with their
PayPal account. For testing purposes, this should be set
to the PayPal sandbox.
Called by SetExpressCheckout.
ext.
Calls GetExpressCheckoutDetails.
ext, CallerService.ext, and
Display.
ext.
GetExpressCheckoutDetails.
ext This functionality is called after the buyer returns from PayPal
and has authorized the payment.
Displays the payer details returned by the
GetExpressCheckoutDetails response and calls
DoExpressCheckoutPayment.
ext to complete the payment
authorization.
Called by ReviewOrder.
ext.
Calls DoExpressCheckoutPayment.
ext and CallerService.ext.