Online Book Reader

Home Category

PayPal APIs_ Up and Running_ A Developer's Guide - Michael Balderas [6]

By Root 140 0

Checkout step Generic checkout Express Checkout

Select the checkout button ✓ ✓

Enter shipping info ✓ -

Select payment method ✓ -

Enter payment information ✓ -

Review order ✓ ✓

Confirm order ✓ ✓

Express Checkout Flow


To fully implement Express Checkout, you must allow your customers two entry points into the Express Checkout payment process. Figure 2-3 outlines the complete checkout flow for Express Checkout.

Figure 2-3. Complete Express Checkout flow

As you can see, customers can enter into the Express Checkout flow at either the Shopping Cart Checkout entry point (dotted arrow) or the Payment Methods entry point (solid arrow). Including both methods in your checkout routines is easy to implement.

Figure 2-4 outlines the Checkout Entry Point, which requires the following steps:

Customer clicks the “Check out with PayPal” button.

Customer logs into PayPal.

Customer confirms shipping and billing information on PayPal’s site.

Customer is returned to your application for final review and clicks the Purchase button.

Customer is returned to a confirmation screen related to the purchase.

Figure 2-4. Checkout Entry Point

Figure 2-5 outlines the Payment Method Entry Point, which requires the following steps:

Customer clicks the checkout button on your application.

Customer inputs shipping information into your application.

Customer chooses PayPal from the list of payment methods.

Customer logs into PayPal.

Customer reviews payment information on PayPal’s site.

Customer is returned to your application for final review and clicks the Purchase button.

Customer is returned to a confirmation screen related to the purchase.

A token is a value assigned by PayPal that associates the execution of API operations and commands with a specific instance of a user experience flow. Tokens are not shown in Figures 2-1 through 2-5.

Figure 2-5. Payment Method Entry Point

PayPal Express Checkout API Operations


The PayPal NVP API provides four key methods related to Express Checkout. These operations initialize the transaction, obtain the buyer information and handle the payment, and then complete the transaction. Table 2-2 outlines these methods.

Table 2-2. Express Checkout API operations

API operation Description

SetExpressCheckout Sets up the Express Checkout transaction. You can specify information to customize the look and feel of the PayPal site and the information it displays. You must include the following information:

URL to the page on your website to which PayPal redirects after the buyer logs into PayPal and approves the payment successfully

URL to the page on your website to which PayPal redirects if the buyer cancels the transaction

Total amount of the order or your best estimate of the total (this should be as accurate as possible)

GetExpressCheckoutDetails Obtains information about the buyer from PayPal, including shipping information.

DoExpressCheckoutPayment Completes the Express Checkout transaction, including the actual total amount of the order.

Callback Updates the PayPal Review page with the relevant shipping options, insurance, and tax information .

Let’s break down each API operation into its smaller components and outline the related request and response fields.

SetExpressCheckout


SetExpressCheckout initializes the Express Checkout session. It allows you to pass variables that format how the PayPal pages look and specify where to redirect the buyer’s browser based upon success of the payment transaction.Table 2-3 outlines the fields required for SetExpressCheckout requests, and Table 2-4 outlines the field required for SetExpressCheckout responses.

Table 2-3. SetExpressCheckout request fields

Field Description Required?

METHOD Must be SetExpressCheckout Yes

RETURNURL URL to which the customer’s browser is returned after choosing to pay with PayPal. PayPal recommends that the value be the final review page on which the customer confirms the order and payment or billing agreement.

Limitation:

Return Main Page Previous Page Next Page

®Online Book Reader