Express Checkout Integration Guide Last updated: May 2010
Express Checkout Integration Guide Document Number: 100010.en_US-201005 © 2010 PayPal, Inc. All rights reserved. PayPal is a registered trademark of PayPal, Inc. The PayPal logo is a trademark of PayPal, Inc. Other trademarks and brands are the property of their respective owners. The information in this document belongs to PayPal, Inc. It may not be used, reproduced or disclosed without the written approval of PayPal, Inc. Copyright © PayPal. All rights reserved. PayPal S.à r.l. et Cie, S.C.A.
Contents Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Intended Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Where to Go for More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Chapter 1 Introducing Express Checkout . . . . . . . . . . . . . . . 11 The Express Checkout Experience . . . . . . . . . . . .
Contents Static PayPal Button and Mark Images Source Requirements . . . . . . . . . . . . . . . 25 Chapter 3 PayPal Name-Value Pair API Basics . . . . . . . . . . . . . 27 PayPal API Client-Server Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 PayPal Name-Value Pair API Requests and Responses . . . . . . . . . . . . . . . . 28 Multiple API Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Obtaining API Credentials . . . . . . . . . . . . . . . . . .
Contents Adding a Survey Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 PayPal Page Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Custom Page Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Individual Page Style Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Changing the Locale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Confirmed Address . . . . .
Contents Post-Integration Experience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 Name-Value Pair Syntax Supporting Parallel Payments . . . . . . . . . . . . . . . . . . . 99 Integrating Parallel Payments Using the NVP API . . . . . . . . . . . . . . . . . . . . . .100 Integrating Parallel Payments Using the SOAP API . . . . . . . . . . . . . . . . . . . . .103 Handling Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents Chapter 12 Using Other PayPal API Operations . . . . . . . . . . . . 127 Issuing Refunds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 Handling Payment Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128 Chapter 13 Integrating giropay with Express Checkout . . . . . . . . 131 giropay Page Flows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .131 giropay Payment Page Flow . . . . . . . . . . . . . . . . . . .
Contents 8 May 2010 Express Checkout Integration Guide
Preface This document describes Express Checkout integration. Intended Audience This document is intended for merchants and developers implementing Express Checkout. Where to Go for More Information For information on the administrative tasks you can perform from your PayPal account, see the Merchant Setup and Administration Guide. The guide is located on the Documentation page linked to the Library tab in Developer Central. Revision History Revision history for Express Checkout Integration Guide.
Revision History TABLE 1.1 Revision history 10 Date Description 06/04/2009 Added a chapter on pre-populating the PayPal review page. Updated PayPal Review pages. Moved some customization topics out of this guide. They are now in the Merchant Setup and Administration Guide. 04/30/2009 Created first edition for Enterprise-level merchants and added chapter on reference transactions. 04/08/2009 Added a chapter describing the Instant Update Callback API.
1 Introducing Express Checkout Express Checkout is PayPal’s premier checkout solution, which streamlines the checkout process for buyers and keeps them on the merchant’s site after making a purchase.
1 Introducing Express Checkout Express Checkout Integration Steps The following diagram shows the Express Checkout flow: Express Checkout Flow In the Express Checkout flow, the buyer: 1. Chooses Express Checkout by clicking Check out with PayPal 2. Logs into PayPal to authenticate his or her identity 3. Reviews the transaction on PayPal NOTE: Optionally, (not shown in the diagram), the buyer can then proceed to review the order on your site.
Introducing Express Checkout Express Checkout Integration Steps 1 Configuring and Customizing the Express Checkout Experience After you implement and test your basic Express Checkout integration, you should configure the additional features of Express Checkout to customize it to meet your needs. Carefully evaluate each feature because the more you streamline the checkout process and make Express Checkout seamless to buyers, the more likely your sales will increase.
1 Introducing Express Checkout Express Checkout Flow Express Checkout Flow To implement Express Checkout, you must offer it both as a checkout option and as a payment method. Typically, you initiate the Express Checkout flow on your shopping cart page and on your payment options page. You add Express Checkout to your existing flow by placing the Checkout with PayPal button on your Shopping Cart page and by placing the PayPal mark on your Payment Methods page.
Introducing Express Checkout Express Checkout Building Blocks 1 Integrating Express Checkout from the Shopping Cart page Payment Option Entry Point The payment option entry point is one of the places where you must implement Express Checkout. Buyers initiate the Express Checkout flow on your payment methods page by selecting PayPal as the default option.
1 Introducing Express Checkout Express Checkout Building Blocks The following conceptual diagram identifies the building blocks that you use to integrate Express Checkout on your website: Express Checkout Integration 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. NOTE: Tokens are not shown in the diagram. Express Checkout Buttons PayPal provides buttons and images for you to place on your website.
Introducing Express Checkout Express Checkout Building Blocks 1 Express Checkout API Operations The PayPal API provides three API operations for Express Checkout, which sets up the transaction, obtains information about the buyer, and handles the payment and completes the transaction. 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.
1 Introducing Express Checkout Express Checkout Building Blocks z The token that was included in the redirect to PayPal z The buyer’s unique identifier (Payer ID) If the buyer cancels, PayPal redirects to the cancel URL with the token that was included in the redirect to PayPal. Express Checkout Token Usage Express Checkout uses a token to control access to PayPal and execute Express Checkout API operations.
2 Express Checkout Button and Logo Image Integration PayPal hosts the PayPal button and logo images that you use on your website. Using PayPal’s buttons and logos is convenient and standardizes appearance on websites that use PayPal as a payment option.
2 Express Checkout Button and Logo Image Integration Dynamic Images z Static image The dynamic images enable PayPal to change their appearance dynamically. If, for example, you have signed up to participate in a PayPal campaign, PayPal can change the appearance of the image dynamically for the duration of that campaign based on parameter information you append to the image URL. By default, the Express Checkout images appears as shown above. The static images cannot be changed dynamically.
Express Checkout Button and Logo Image Integration Configuring the Dynamic Image 2 Set Up the Default Image The following URL points to the default Check out with PayPal image: https://fpdbs.paypal.com/dynamicimageweb?cmd=_dynamic-image To make the image dynamic, you need only add parameters to this URL to specify the changes you want displayed. To test in the Sandbox environment, send the image to the following Sandbox URL: https://fpdbs.sandbox.paypal.
2 Express Checkout Button and Logo Image Integration Dynamic Image Command Reference Change the Locale To specify the locale of the image, append the locale parameter set to the code for the appropriate country to the image URL. If a country does not have a localized image or if you do not pass a locale value, the default US image displays. This example displays the image for the Spanish locale: https://fpdbs.paypal.
Express Checkout Button and Logo Image Integration Dynamic Image Command Reference 2 Dynamic Image Parameters The table below describes the dynamic image name-value pair parameters. Dynamic-Image Command Variable Descriptions Type: encrypted PayPal account number (Optional) Unique identification number. When merchants sign up for a PayPal business account, PayPal assigns them an account number.
2 Express Checkout Button and Logo Image Integration Dynamic Image Command Reference Country codes, language priorities, and locale values 24 Country code Language priority Locale AT language_0 de_DE AT language_1 en_US AU language_0 en_AU BE language_0 en_US BE language_1 nl_NL BE language_2 fr_FR C2 language_0 en_US C2 language_1 zh_XC C2 language_2 fr_XC C2 language_3 es_XC CH language_0 de_DE CH language_1 fr_FR CH language_2 en_US CN language_0 zh_CN def
Express Checkout Button and Logo Image Integration Static PayPal Button and Mark Images Source Requirements Country code Language priority Locale IE language_0 en_US IT language_0 it_IT IT language_1 en_US JP language_0 ja_JP JP language_1 en_US MQ language_0 fr_FR MQ language_1 en_US NL language_0 nl_NL NL language_1 en_US PL language_0 pl_PL PL language_1 en_US RE language_0 fr_FR RE language_1 en_US US language_0 en_US US language_1 fr_XC US language_2 e
2 26 Express Checkout Button and Logo Image Integration Static PayPal Button and Mark Images Source Requirements Country Links to HTML Code for Displaying PayPal-Hosted Images Austria https://www.paypal.com/at/cgibin/webscr?cmd=xpt/Merchant/merchant/ExpressCheckoutButtonCode-outside Belgium https://www.paypal.com/be/cgibin/webscr?cmd=xpt/Merchant/merchant/ExpressCheckoutButtonCode-outside Canada https://www.paypal.
3 PayPal Name-Value Pair API Basics The Name-Value Pair (NVP) API provides parameter-based association between request and response fields of a message and their values. The request message is sent via the API from your website and a response message is returned by PayPal using a client-server model in which your site is a client of the PayPal server.
3 PayPal Name-Value Pair API Basics PayPal API Client-Server Architecture PayPal Name-Value Pair API Requests and Responses To perform a PayPal NVP API operation, you send an NVP-formatted request to a PayPal NVP server and interpret the response. In the following diagram, your website generates a request. The request is executed on a PayPal server and the response is returned to your site.
PayPal Name-Value Pair API Basics PayPal API Client-Server Architecture 3 Token Usage Typically, the API operation that sets up a redirection to PayPal returns a token. This token is passed as a parameter in the redirect to PayPal. The token also might be required in related API operations.
3 PayPal Name-Value Pair API Basics Obtaining API Credentials Obtaining API Credentials To use the PayPal API, you must have API credentials that identify you as a PayPal Business account holder who is authorized to perform various API operations. Although you can use either an API signature or a certificate for credentials, PayPal recommends you use a signature. IMPORTANT: Although you can have both a signature and certificate, you cannot use both at the same time.
PayPal Name-Value Pair API Basics Creating an NVP Request 3 5. Click Done to complete the process. Creating an API Certificate Create an API certificate only if your website requires it. Typically, you want to create an API signature for your credentials instead. If you do need a certificate, follow the instructions at https://www.paypal.com/IntegrationCenter/ic_api-certificate.html.
3 PayPal Name-Value Pair API Basics Creating an NVP Request Specifying the PayPal API Operation For the NVP version of the PayPal API, you must specify the name of the PayPal API operation to execute in each request along with the version of the API operation. The following diagram shows the API operation part of an NVP request: A method specifies the PayPal operation you want to execute and each method is associated with a version.
PayPal Name-Value Pair API Basics Creating an NVP Request 3 To enable PayPal to authenticate your request 1. Specify the API user name associated with your account. USER=API_username 2. Specify the password associated with the API user name. PWD=API_password 3. If you are using an API signature and not an API certificate, specify the API signature associated with the API username.
3 PayPal Name-Value Pair API Basics Executing NVP API Operations List Syntax for Name-Value Pairs The PayPal API uses a special syntax for NVP fields defined as lists. The NVP interface to the PayPal API requires a unique name for each field. In the API, lists are prefixed by L_. To identify an element within the list, use the offset from the beginning of the list, starting with 0 as the first element. For example, L_DESC0 is the first line of a description, L_DESC1, is the second line, and so on.
PayPal Name-Value Pair API Basics Responding to an NVP Response 3 All responses to PayPal API operations contain information that may be useful for debugging purposes. You should log the Correlation ID, which identifies the API operation to PayPal, and response-specific information, such as the transaction ID, which you can use to review a transaction on the PayPal website or through the API. You can log other information that may be useful, such as the timestamp.
3 PayPal Name-Value Pair API Basics Responding to an NVP Response URL Decoding All responses to HTTP POST operations used by the PayPal NVP API must be decoded. The PayPal NVP API uses the HTTP protocol to send requests and receive responses from a PayPal API server. You must decode all data returned using the HTTP protocol so that it can be displayed properly. Most programming languages provide a way to decode strings. NOTE: 36 Most browsers decode responses to HTTP requests automatically.
4 Implementing the Simplest Express Checkout Integration The simplest Express Checkout integration requires the following PayPal API operations: SetExpressCheckout, DoExpressCheckoutPayment, and optionally, GetExpressCheckoutDetails.
4 Implementing the Simplest Express Checkout Integration Setting Up the Express Checkout Transaction 2. Specify the return URL. The return URL is the page to which PayPal redirects your buyer’s browser after the buyer logs into PayPal and approves the payment. Typically, this is a secure page (https://...) on your site. NOTE: You can use the return URL to piggyback parameters between pages on your site. For example, you can set your Return URL to specify additional parameters using the https://www.
Implementing the Simplest Express Checkout Integration Obtaining Express Checkout Transaction Details NOTE: 4 The following example uses the PayPal Sandbox server: https://www.sandbox.paypal.com/webscr ?cmd=_express-checkout&token=tokenValue &AMT=amount &CURRENCYCODE=currencyID &RETURNURL=return_url &CANCELURL=cancel_url Obtaining Express Checkout Transaction Details To obtain details about an Express Checkout transaction, you can invoke the GetExpressCheckoutDetails API operation.
4 Implementing the Simplest Express Checkout Integration Completing the Express Checkout Transaction GetExpressCheckoutDetails API before calling the DoExpressCheckoutPayment API. In the simplest case, you set the total amount of the order when you call the SetExpressCheckout API. However, you can change the amount before calling the DoExpressCheckoutPayment API if you did not know the total amount when you called the SetExpressCheckout API.
Implementing the Simplest Express Checkout Integration Completing the Express Checkout Transaction 4 5. Execute the DoExpressCheckoutPayment API to complete the Express Checkout transaction. 6. Examine the values returned by the API if the transaction completed successfully.
4 42 Implementing the Simplest Express Checkout Integration Completing the Express Checkout Transaction May 2010 Express Checkout Integration Guide
5 Testing an Express Checkout Integration You can test your Express Checkout integration in the Sandbox. This example shows how to simulate your web pages using HTTP forms and supplying the values for API operations from these forms. You can use this strategy for your initial testing; however, for more complete testing, you will want to replace these forms with your web pages containing actual code. The following diagram shows the Express Checkout execution flow, which uses the Sandbox as the API server.
5 Testing an Express Checkout Integration Express Checkout Execution Flow The following steps match the circled numbers in the diagram. Perform the actions in each step to test Express Checkout. 1. Invoke a form on your site that calls the SetExpressCheckout API on the Sandbox. To invoke the API, set form fields whose names match the NVP names of the fields you want to set, specify their corresponding values, and then post the form to a PayPal Sandbox server, such as https://api-3t.sandbox.paypal.
Testing an Express Checkout Integration 5
5 Testing an Express Checkout Integration http://www.YourReturnURL.com/ ?token=EC-1NK66318YB717835M&PayerID=7AKUSARZ7SAT8 5. Invoke a form on your site that calls the GetExpressCheckoutDetails API operation on the Sandbox:
Testing an Express Checkout Integration 5
5 48 Testing an Express Checkout Integration May 2010 Express Checkout Integration Guide
6 Customizing Express Checkout You can specify options in Express Checkout API requests that change the appearance, behavior, and flow of the checkout process.
6 Customizing Express Checkout PayPal Review Page Order Details PayPal calculates the value in the Amount (6) column as the product of line-item unit price and line-item unit quantity. You can also show other detailed information about the order: (7) – Item total and tax. These are the respective total of all items in the order and the tax. (8) – Shipping and handling. PayPal sums the shipping and handling amounts in this field. (You determine actual shipping and handling amounts.
Customizing Express Checkout PayPal Review Page Order Details 6 PayPal Review page with order details Special Instructions to Merchant You can allow the buyer to send you special instructions about an order. This feature is especially helpful to buyers who want to customize merchandise. A buyer also might want to tell you to ship their order at a later date because they are out of the country. NOTE: Users of this feature should be sure to read the instructions the buyer sends.
6 Customizing Express Checkout PayPal Review Page Order Details Continue, the instructions are returned in the responses to GetExpressCheckoutDetails and DoExpressCheckoutPayment. Special Instructions text box Integrating Order Details into the Express Checkout Flow To integrate order details into the checkout flow, pass the Express Checkout parameters described in SetExpressCheckout Order Details Parameters to SetExpressCheckout.
Customizing Express Checkout PayPal Review Page Order Details 6 SetExpressCheckout Order Details Parameters NVP Field SOAP Field Description and Comments L_NAMEn Name Item name. L_NUMBERn Number Item number. L_DESCn Description Item description. The DESC (NVP) and OrderDescription (SOAP) fields still exist for backwards compatibility.
6 Customizing Express Checkout PayPal Review Page Order Details Request Parameters: [requiredSecurityParameters] &METHOD=SetExpressCheckout &RETURNURL=http://... &CANCELURL=http://... &PAYMENTACTION=Sale &NAME=J Smith &SHIPTOSTREET=1 Main St &SHIPTOCITY=San Jose &SHIPTOSTATE=CA &SHIPTOCOUNTRYCODE=US &SHIPTOZIP=95131 &L_NAME0=10% Decaf Kona Blend Coffee &L_NUMBER0=623083 &L_DESC0=Size: 8.8-oz &L_AMT0=9.95 &L_QTY0=2 &L_NAME1=Coffee Filter bags &L_NUMBER1=623084 &L_DESC1=Size: Two 24-piece boxes &L_AMT1=39.
Customizing Express Checkout PayPal Review Page Order Details 6 eBay-Issued Incentives If the buyer’s checkout includes eBay auction items, you must set additional fields in the call to SetExpressCheckout to enable buyers to choose from eBay-issued incentives such as eBay gift certificates, coupons, vouchers, and gift cards that may apply to their order. To enable the display of eBay incentives on the PayPal Review page, you also must provide line item detail information for each eBay item.
6 Customizing Express Checkout PayPal Review Page Order Details New Total after applying incentives Integrating eBay Incentives into the Express Checkout Flow To integrate eBay incentives into the checkout flow: 1. Pass the following parameters and settings in the call to SetExpressCheckout. – PAYMENTACTION must be Sale – CHANNELTYPE must be eBayItem NOTE: For eBay auctions, you cannot set PAYMENTACTION to Authorization or Order. You must set PAYMENTACTION to Sale. 2.
Customizing Express Checkout PayPal Review Page Order Details 6 – Buyer protection programs require it – It enables buyers to see the transaction details in My eBay and in PayPal transaction details – It enables buyers to redeem coupons and incentives they may have received from eBay NOTE: Passing the same order details and eBay incentive parameters in the call to DoExpressCheckoutPayment as well as SetExpressCheckout ensures that this information displays on the PayPal Review page and payment is properl
6 Customizing Express Checkout Providing Gift Options Request Parameters: [requiredSecurityParameters] &METHOD=SetExpressCheckout &RETURNURL=http://coffee2go.com &CANCELURL=http://cancel.com &PAYMENTACTION=Sale &EMAIL=jsmith01@example.com &NAME=J Smith &SHIPTOSTREET=1 Main St &SHIPTOCITY=San Jose &SHIPTOSTATE=CA &SHIPTOCOUNTRYCODE=US &SHIPTOZIP=95131 &L_NAME0=Photo &L_NUMBER0=32768923 &L_DESC0=Plastic Frame- An EBay item &L_AMT0=25.
Customizing Express Checkout Providing Gift Options z Gift message — This feature displays a text box in which the buyer can enter a gift message. z Gift receipt — This feature provides a checkbox for the buyer to check if they would like a gift receipt included. z Gift wrap — This feature provides a checkbox for the buyer to check if they would like to have the gift wrapped. The gift wrap feature can include a label describing the gift wrapping, for example, “Decorator box and bow.
6 Customizing Express Checkout Getting Buyer Consent to Receive Promotional Email Getting Buyer Consent to Receive Promotional Email You can get the buyer’s consent to receive email promotions on the PayPal Review page. PayPal returns the email address that the buyer enters in the response to GetExpressCheckoutDetails and DoExpressCheckoutPayment. NOTE: This feature is available with API Version 61.0 or later.
Customizing Express Checkout Adding a Survey Question 6 SetExpressCheckout. Provide an alphanumeric string that clearly identifies you as the merchant. The following request example sets this field: Request Parameters [requiredSecurityParameters] &METHOD=SetExpressCheckout &RETURNURL=https://... &CANCELURL=https://... &AMT=10.
6 Customizing Express Checkout PayPal Page Style Request Parameters [requiredSecurityParameters] &METHOD=SetExpressCheckout &RETURNURL=https://... &CANCELURL=https://... &AMT=10.
Customizing Express Checkout PayPal Page Style z Header background color z Page background color 6 For instructions on how to customize page styles and create Page Style Names, see the Merchant Setup and Administration Guide. To set a custom page style in a call to SetExpressCheckout: 1. Include the optional PAGESTYLE parameter in the call to SetExpressCheckout. 2. Set PAGESTYLE to the Page Style Name you defined in your account.
6 Customizing Express Checkout PayPal Page Style 2. Store the URL to the image on a secure (https) server so your buyer’s web browser does not display a message that the payment contains insecure items. 3. Assign the URL to the HDRIMG parameter in the call to SetExpressCheckout. The following example sets HDRIMG to a custom header image. Request Parameters [requiredSecurityParameters] &METHOD=SetExpressCheckout &RETURNURL=https://... &CANCELURL=https://... &AMT=10.
Customizing Express Checkout PayPal Page Style 6 Review page with custom header image The following example sets colors for the header background (HDRBACKCOLOR) and header border (HDRBORDERCOLOR). Request Parameters [requiredSecurityParameters] &METHOD=SetExpressCheckout &RETURNURL=https://... &CANCELURL=https://... &AMT=10.
6 Customizing Express Checkout Changing the Locale Response Parameters [successResponseFields] &TOKEN=EC-17C76533PL706494P The figure below shows the PayPal Login page with HDRBACKCOLOR and HDRBORDERCOLOR set to custom colors. PayPal Login page with custom header background and border colors Changing the Locale You can change the locale of PayPal pages to match the language on your website.
Customizing Express Checkout Changing the Locale 6 The following example sets LOCALCODE to ES (Spain). Request Parameters [requiredSecurityParameters] &METHOD=SetExpressCheckout &RETURNURL=https://... &CANCELURL=https://... &AMT=10.
6 Customizing Express Checkout Handling Shipping Addresses Handling Shipping Addresses You can specify several shipping address options that affect the PayPal Review page. In your SetExpressCheckout request, you can specify the following options: z Require a confirmed address z Not display the shipping address on the review page z Display an alternative address on the review page.
Customizing Express Checkout Handling Shipping Addresses 6 Request Parameters [requiredSecurityParameters] &METHOD=SetExpressCheckout &RETURNURL=https://... &CANCELURL=https://... &AMT=10.
6 Customizing Express Checkout Handling Shipping Addresses PayPal review page with a required address Suppressing the Buyer’s Shipping Address You can suppress the display of the buyer’s shipping address on the PayPal pages. You might want to do this in these cases: z You are selling a product or service that does not require shipping. z You prefer to handle addresses completely on your own and do not want to let buyers choose from their PayPal address book.
Customizing Express Checkout Handling Shipping Addresses 6 Request Parameters [requiredSecurityParameters] &METHOD=SetExpressCheckout &RETURNURL=https://... &CANCELURL=https://... &AMT=10.
6 Customizing Express Checkout Handling Shipping Addresses Shipping Address Override You can override the buyer’s shipping address stored on PayPal. You would want to do this if, for example, your website registration already requested the buyer’s shipping address. Overriding the shipping address stored on PayPal replaces it with one you specify in the call to SetExpressCheckout. The buyer cannot edit the overridden address.
Customizing Express Checkout Automatically Filling Out the PayPal Login Page 6 PayPal review page with shipping address override Automatically Filling Out the PayPal Login Page When you pass the buyer’s shipping address and contact information (telephone number and email address) parameters in the call to SetExpressCheckout, PayPal automatically fills out the account creation form fields for the buyer on the PayPal Login page.
6 Customizing Express Checkout Automatically Filling Out the PayPal Login Page Request Parameters [requiredSecurityParameters] &METHOD=SetExpressCheckout &RETURNURL=https://... &CANCELURL=https://... &AMT=10.00 &PAYMENTACTION=Sale &SHIPTOSTREET=1 Main Street &SHIPTOCITY=San Jose &SHIPTOSTATE=CA &SHIPTOCOUNTRYCODE=US &SHIPTOZIP=95131 &EMAIL=jsmith01@example.
Customizing Express Checkout Buyer Pays on PayPal 6 Pre-populated PayPal Login page Buyer Pays on PayPal If you do not require the buyer to explicitly review and confirm the payment on your site, you can configure Express Checkout such that the user commits the payment on PayPal. This configuration reduces a step in the checkout flow. You may want to eliminate your Review Your Payment page if there is no additional information you want to collect from the buyer before he or she completes the transaction.
6 Customizing Express Checkout Buyer Pays on PayPal read Pay Now. (After the buyer returns from the PayPal site, you must call DoExpressCheckoutPayment to actually complete the transaction.) To display Pay Now on the button: 1. Get the token from the response to SetExpressCheckout. The response to SetExpressCheckout is the buyer’s token. For example, if the value of RETURNURL passed to SetExpressCheckout is https://www.websitename.com/snagECvalues, the URL to which PayPal redirects appears as https://www.
7 Implementing the Instant Update API The Instant Update API is a callback you can use to obtain the buyer’s shipping address. z About the Instant Update API z How the Callback Works in the Express Checkout Flow z Following Instant Update API Best Practices z Setting Up the Callback z Using the Callback About the Instant Update API The Instant Update API is a server call to your callback server that instantly updates the PayPal review page.
7 Implementing the Instant Update API About the Instant Update API 3. Modify the existing Express Checkout API calls to accommodate new parameters. – Send the callback URL, shipping, insurance, and tax information to PayPal in the call to SetExpressCheckout. – Call GetExpressCheckoutDetails to obtain the buyer’s final choices for shipping and insurance, if applicable. – Call DoExpressCheckoutPayment with the buyer’s final selections. 4. Eliminate your shipping options page. 5.
Implementing the Instant Update API About the Instant Update API 7 PayPal Review Page With Shipping Options, Insurance, and Tax You control which options are displayed and instantly updated on the page.
7 Implementing the Instant Update API How the Callback Works in the Express Checkout Flow How the Callback Works in the Express Checkout Flow The figure below shows how the callback integrates into the Express Checkout flow. Callback integrated into Express Checkout flow From left to right, the following events are represented. Text in boldface describes events supporting the callback. 1.
Implementing the Instant Update API Following Instant Update API Best Practices 7 4. The buyer is redirected to PayPal. 5. When the buyer first logs in to the PayPal site, PayPal obtains the buyer’s shipping address and sends it in the callback request (red down arrow) to your callback server at the specified URL. NOTE: If the buyer changes their shipping address on the PayPal Review page, PayPal will make subsequent calls to the callback request. 6.
7 Implementing the Instant Update API Setting Up the Callback Setting Up the Callback To set up the callback, you establish a connection with PayPal by providing the location where PayPal calls your callback server, along with your shipping options. To start, you must build and operate a secure, reliable, and fast callback server that computes shipping options, corresponding insurance options, and tax, based on your business rules.
Implementing the Instant Update API Setting Up the Callback 7 GetExpressCheckoutDetails and DoExpressCheckoutPayment Changes When you implement the callback, you need to call GetExpressCheckoutDetails and DoExpressCheckoutPayment. GetExpressCheckoutDetails and DoExpressCheckoutPayment include new parameter fields in support of the Instant Update API. You must call the GetExpressCheckoutDetails API operation to obtain the buyer’s final shipping option selections.
7 Implementing the Instant Update API Setting Up the Callback Example PayPal Review Page When Callback Times Out You Do Not Ship to the Buyer’s Shipping Address If you do not ship to the buyer’s shipping address that PayPal sends in the callback request, set NO_SHIPPING_OPTION_DETAILS to 1 in the callback response.
Implementing the Instant Update API Using the Callback 7 The sample code below illustrates the callback response when you do not ship to the buyer’s address. METHOD=CallbackResponse NO_SHIPPING_OPTION_DETAILS=1 The figure below illustrates the PayPal Review page when your callback servers sends the above response. The page has these features: z A message at the top of the page describes the error. z The shipping and handling section and the insurance section are dimmed.
7 Implementing the Instant Update API Using the Callback – The buyer enters a new shipping address z Provide values for the following required parameters: – Provide values for the line-item details parameters such as L_NAMEn, L_NUMBERn, L_DESCn, L_AMTn, and L_QTYn shown in the example below. – Provide values for the flat-rate shipping options: n, L_SHIPPINGOPTIONISDEFAULTn, L_SHIPPINGOPTIONNAMEn, and L_SHIPPINGOPTIONAMOUNTn. – Set SHIPPINGAMT to the amount set for the default flat-rate shipping option.
Implementing the Instant Update API Using the Callback 7 Request Parameters: [requiredSecurityParameters] &METHOD=SetExpressCheckout &RETURNURL=http://... &CANCELURL=http://... &PAYMENTACTION=Sale &NAME=J Smith &SHIPTOSTREET=1 Main St &SHIPTOCITY=San Jose &SHIPTOSTATE=CA &SHIPTOCOUNTRYCODE=US &SHIPTOZIP=95131 &L_NAME0=10% Decaf Kona Blend Coffee &L_NUMBER0=623083 &L_DESC0=Size: 8.8-oz &L_AMT0=9.95 &L_QTY0=2 &L_NAME1=Coffee Filter bags &L_NUMBER1=6230 &L_DESC1=Size: Two 24-piece boxes &L_AMT1=39.
7 Implementing the Instant Update API Using the Callback Callback Request The PayPal sends the parameters in the callback request to the location you specified for CALLBACK. The callback request parameters include: z Line-item details you sent in the call to SetExpressCheckout. PayPal also sends back any line-item description details you may have specified such as the L_ITEMWEIGHTUNIT1 and L_ITEMWEIGHTVALUE1 values shown in the example below.
Implementing the Instant Update API Using the Callback 7 METHOD=CallbackResponse &OFFERINSURANCEOPTION=true &L_SHIPPINGOPTIONNAME0=UPS Next Day Air &L_SHIPPINGOPTIONAMOUNT0=20.00 &L_TAXAMT0=2.20 &L_INSURANCEAMOUNT0=1.51 &L_SHIPPINGOPTIONISDEFAULT0=false &L_SHIPPINGOPTIONNAME1=UPS Express 2 Days &L_SHIPPINGOPTIONAMOUNT1=10.00 &L_TAXAMT1=2.00 &L_INSURANCEAMOUNT1=1.35 &L_SHIPPINGOPTIONISDEFAULT1=true &L_SHIPPINGOPTIONNAME2=UPS Ground2 to 7 Days &L_SHIPPINGOPTIONAMOUNT2=9.99 &L_TAXAMT2=1.
7 90 Implementing the Instant Update API Using the Callback May 2010 Express Checkout Integration Guide
8 Immediate Payment Immediate Payment ensures a buyer pays for a purchase immediately after commiting to it.
8 Immediate Payment About Immediate Payment For Third Party Checkout z By design, it does not support non-instant funds like Electronic Funds Transfer, eCheck, or ELV. z It is limited to Express Checkout for eBay auctions only. z It is limited to processing a single payment per transaction; the buyer can check out with only one item at a time. z Sale is the only payment action supported. z It does inventory checking at eBay and attempts to purchase the item.
Immediate Payment Integrating Immediate Payment for Third-Party Checkout 8 2. In the call to the SetExpressCheckout API operation, you must pass the following Immediate Payment information: – ALLOWEDPAYMENTMETHOD: This is the payment method type. For immediate payment, the value is InstantPaymentOnly. – BUYERUSERNAME: eBay provides you with this value. – L_EBAYITEMCARTIDn: eBay provides you with this value.
8 Immediate Payment About Immediate Payment For Express Checkout To integrate Immediate Payment into the SetExpressCheckout call: 1. Set ALLOWEDPAYMENTMETHODTYPE to InstantPaymentOnly. This blocks all pending funding sources and transactions that end up in a pending state. 2. Pass BUYERUSERNAME and L_EBAYITEMCARTIDn. 3. Set CHANNELTYPE to eBayItem. 4. Set L_EBAYITEMNUMBERn to the number of the eBay item. 5. Specify the buyer’s shipping address. 6. Be prepared to handle Immediate Payment errors.
Immediate Payment Integrating Immediate Payment for Express Checkout 8 Immediate Payment for Express Checkout has the following caveats: z By design, it does not support non-instant funds like Electronic Funds Transfer, eCheck, or ELV. z It is open for use by all merchants, whether or not they are selling on eBay. z Sale is the only payment action supported.
8 96 Immediate Payment Integrating Immediate Payment for Express Checkout May 2010 Express Checkout Integration Guide
9 Implementing Parallel Payments Not only can Express Checkout support payment between a single buyer and merchant, but it can support parallel payments. Parallel payments enables a single buyer to pay multiple merchants in a single checkout session. z About Parallel Payments z Name-Value Pair Syntax Supporting Parallel Payments z Integrating Parallel Payments Using the NVP API z Integrating Parallel Payments Using the SOAP API NOTE: Parallel payments is available with API version 63.0 and later.
9 Implementing Parallel Payments About Parallel Payments Post-Integration Experience After you integrate parallel payments, the PayPal Review page shows summary information for each payment. The example below shows summary information for an online travel agency with payments to an airline and a hotel. The figure below shows expanded details on the airline purchase. The figure below shows expanded details on the hotel payment.
Implementing Parallel Payments Name-Value Pair Syntax Supporting Parallel Payments 9 Name-Value Pair Syntax Supporting Parallel Payments The PayPal API uses a special syntax for NVP fields to support parallel payments. The NVP interface to the PayPal API supports up to a maximum of 10 parallel payments in a transaction. To accommodate this, request fields have the format shown below, where n is a number in the range 0 to 9 representing a payment.
9 Implementing Parallel Payments Integrating Parallel Payments Using the NVP API The following syntax represents the total amount of the first payment: PAYMENTREQUEST_0_AMT The following represents the second line of the name for the third payment: L_PAYMENTREQUEST_2_NAME1 Integrating Parallel Payments Using the NVP API To integrate parallel payments using the NVP API, you need to use the syntax for creating unique NVP request field names and create a unique set of fields for each payment.
Implementing Parallel Payments Integrating Parallel Payments Using the NVP API 9 – The merchant’s Payer Id (secure merchant account Id) If errors are returned, check the response data in the PAYMENTERROR field for each payment. It is possible that errors are returned only for a subset of the payments, while other payments are successful. For failed payments, you should ask the buyer for an alternate payment method.
9 Implementing Parallel Payments Integrating Parallel Payments Using the NVP API Request Parameters: [requiredSecurityParameters] &METHOD=SetExpressCheckout &RETURNURL=http://... &CANCELURL=http://... &PAYMENTACTION=Order &PAYMENTREQUEST_0_CURRENCYCODE=USD &PAYMENTREQUEST_0_AMT=300 &PAYMENTREQUEST_0_ITEMAMT=200 &PAYMENTREQUEST_0_TAXAMT=100 &PAYMENTREQUEST_0_DESC=Summer Vacation trip &PAYMENTREQUEST_0_INSURANCEAMT=0 &PAYMENTREQUEST_0_SHIPDISCAMT=0 &PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID=seller-139@paypal.
Implementing Parallel Payments Integrating Parallel Payments Using the SOAP API 9 Response Parameters [successResponseFields] &TOKEN=EC-17C76533PL706494P Integrating Parallel Payments Using the SOAP API Parallel payments uses the PaymentDetailsType structure to pass data for each merchant receiving payment. You can pass up to a 10 structures in a single call to SetExpressCheckout and DoExpressCheckoutPayment.
9 Implementing Parallel Payments Integrating Parallel Payments Using the SOAP API If errors are returned, check the response data in the PaymentInfo.PaymentError field. PaymentError returns the ErrorType information. It is possible that errors are returned only for a subset of payments, while other payments are successful. For failed payments, you should ask the buyer for an alternate payment method.
Implementing Parallel Payments Integrating Parallel Payments Using the SOAP API 9 PaymentDetailsType[] PaymentDetailsArray = new PaymentDetailsType[9]; //******************************************************* //merchant 1 //******************************************************* PaymentDetailsType payment1 = new PaymentDetailsType(); payment1.PaymentAction = PaymentActionCodeType.Order; payment1.PaymentActionSpecified = true; payment1.SellerDetails = new SellerDetailsType(); payment1.SellerDetails.
9 Implementing Parallel Payments Integrating Parallel Payments Using the SOAP API } if (Key.Amount != null) { item_total = decimal.Add(item_total, decimal.Multiply(decimal.Parse(Key.Amount.Value), decimal.Parse(Key.Quantity))); } } payment1.ShippingTotal = new BasicAmountType(); payment1.ShippingTotal.currencyID = CurrencyCodeType.USD; payment1.ShippingTotal.Value = "3.00"; payment1.ItemTotal = new BasicAmountType(); payment1.ItemTotal.currencyID = CurrencyCodeType.USD; payment1.ItemTotal.
Implementing Parallel Payments Integrating Parallel Payments Using the SOAP API 9 payment2_item2.Name = "payment2_item2_name"; payment2_item2.Number = "payment2_item2_number"; payment2_item2.Quantity = "1"; payment2_items_array.SetValue(payment2_item1, 0); payment2_items_array.SetValue(payment2_item2, 1); //bind the items payment2.PaymentDetailsItem = payment2_items_array; //mandatory for api call payment2.PaymentRequestID = System.Guid.NewGuid().
9 Implementing Parallel Payments Handling Errors Handling Errors It is possible for some merchant payments to succeed while others fail. Parallel payments creates multiple independent payments, and each payment is subject to its own validation and review. When this happens, the ACK value is PartialSuccess. To find the error, check the value returned in PAYMENTINFO_n_ERRORCODE in the response to DoExpressCheckoutPayment.
10 Handling Payment Settlements You can use PayPal API operations to handle the capture of payments authorized using Express Checkout and manage Express Checkout authorization and order payment actions. z Sale Payment Action for Express Checkout z Authorization Payment Action for Express Checkout z Order Payment Action for Express Checkout Sale Payment Action for Express Checkout A sale payment action represents a single payment that completes a purchase for a specified amount.
10 Handling Payment Settlements Order Payment Action for Express Checkout An authorization enables you to capture multiple payments up to 115% of, or USD $75 more than, the amount you specify in the DoExpressCheckoutPayment request. Choose this payment action if you need to ship the goods before capturing the payment or if there is some reason not to accept the payment immediately. The honor period, for which funds can be held, is three days.
Handling Payment Settlements Order Payment Action for Express Checkout z 10 Drop shipments, which are shipments from other vendors for which you accept the payment You cannot reauthorize an authorization. You handle the need to reauthorize, for example when the hold period or valid period of an authorization expires, simply by creating another authorization. You can void an order or an authorization created from the order.
10 112 Handling Payment Settlements Order Payment Action for Express Checkout May 2010 Express Checkout Integration Guide
11 Handling Recurring Payments Set up a recurring payment to handle subscription and other payments that occur on a fixed schedule.
11 Handling Recurring Payments Recurring Payments Terms z Update the details of the recurring payments profile. z Bill the outstanding amount of the recurring payments profile. Limitations The current release of the Recurring Payments API has the following limitations: z A profile can have at most one optional trial period and a single regular payment period. z The profile start date may not be earlier than the profile creation date.
Handling Recurring Payments Options for Creating a Recurring Payments Profile Term Definition Payment amount The amount to be paid by the buyer for each billing cycle. Outstanding balance If a payment fails for any reason, that amount is added to the profile’s outstanding balance. Profile ID An alphanumeric string (generated by PayPal) that uniquely identifies a recurring profile.
11 Handling Recurring Payments Options for Creating a Recurring Payments Profile NVP SOAP Description AMT ScheduleDetails. PaymentPeriod.Amount Amount to bill for each billing cycle. You can optionally include a value for TOTALBILLINGCYCLES (SOAP field ScheduleDetails.PaymentPeriod.TotalBillingCycles), which specifies the total number of billing cycles in the regular payment period. If no value is specified or if the value is 0, the payments continue until the profile is canceled or suspended.
Handling Recurring Payments Recurring Payments With Express Checkout 11 If this field is not set or is set to CancelOnFailure, PayPal will create the recurring payment profile, but will place it into a pending status until the initial payment is completed. If the initial payment clears, PayPal will notify you by IPN that the pending profile has been activated. If the payment fails, PayPal will notify you by IPN that the pending profile has been canceled.
11 Handling Recurring Payments Recurring Payments With Express Checkout The circled numbers in the diagram correspond to the following steps: 118 May 2010 Express Checkout Integration Guide
Handling Recurring Payments Recurring Payments With Express Checkout 11 Recurring payments processing flow Step Merchant... PayPal... 1 Calls SetExpressCheckout with one or more billing agreement details in the request 2 3 Returns a token, which identifies the transaction, to the merchant. Redirects buyer’s browser to: https://www.paypal.com/cgibin/webscr?cmd=_express-checkout &token= Displays login page.
11 Handling Recurring Payments Recurring Payments With Express Checkout z Initiating the processing flow to create one or more billing agreements for recurring payments with no associated one-time purchase or recurring payment NOTE: You can also initiate the processing flow using SetCustomerBillingAgreement for orders that contain only a single recurring payment.
Handling Recurring Payments Recurring Payments With Express Checkout 11 https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout& token= For redirecting the buyer’s browser to the PayPal login page, PayPal recommends that you use the HTTPS response 302 “Object Moved” with the URL above as the value of the Location header in the HTTPS response. Ensure that you use an SSL-enabled server to prevent browser warnings about a mix of secure and insecure graphics.
11 Handling Recurring Payments Recurring Payments Profile Status Recurring Payments Profile Status The recurring payments actions you may take, depend on the status of the profile. A recurring payments profile can have one of the following status values: z ActiveProfile z PendingProfile z ExpiredProfile z SuspendedProfile z CancelledProfile If the profile is successfully created, it has an ActiveProfile status.
Handling Recurring Payments Modifying a Recurring Payments Profile z Total number of failed billing cycles z Date of the last successful payment received z Amount of the last successful payment received 11 Modifying a Recurring Payments Profile Use the UpdateRecurringPaymentsProfile API to modify a recurring payments profile. NOTE: You can also modify recurring payments profiles from the PayPal website.
11 Handling Recurring Payments Billing the Outstanding Amount of a Profile Updating Addresses When you update the subscriber shipping address, you must enter all of address fields, not just those that are changing: For example, if you want to update the subscriber’s street address, you must specify all of the address fields listed in the Name-Value Pair Developer Guide and Reference or SOAP API Reference, not just the field for the street address.
Handling Recurring Payments Recurring Payments Notifications 11 Recurring Payments Notifications You are notified of recurring payments events through IPN and email; however, using GetTransactionDetails to obtain the information you need is typically sufficient. You are notified of certain events through IPN. For recurring payments profiles created using Express Checkout, buyers are also notified of specific events by email. The following table indicates when IPN and emails are generated.
11 126 Handling Recurring Payments Recurring Payments Notifications May 2010 Express Checkout Integration Guide
12 Using Other PayPal API Operations You can use additional PayPal API operations to implement additional features for your buyers or to provide “back office” support. z Issuing Refunds z Handling Payment Review Issuing Refunds You can use the RefundTransaction PayPal API operation to issue refunds. Use the RefundTransaction API to issue one or more refunds associated with a transaction, such as a transaction created by a capture of a payment.
12 Using Other PayPal API Operations Handling Payment Review REFUNDTYPE=Partial 3. For a partial refund, specify the refund amount, including the currency. AMT=amount CURRENCYCODE=currencyID 4. For a partial refund, specify the memo description. NOTE=description 5. Execute the RefundTransaction operation. 6. Check the acknowledgement status in the RefundTransaction response to ensure that the operation was successful.
Using Other PayPal API Operations Handling Payment Review NOTE: 12 You must use version 58.0 to obtain the initial status information provided by DoExpressCheckoutPayment, DoReferenceTransaction, DoAuthorization, or DoReauthorization. To use payment review with the DoExpressCheckoutPayment, DoReferenceTransaction, DoAuthorization, and DoReauthorization PayPal API operations, you must 1.
12 Using Other PayPal API Operations Handling Payment Review IMPORTANT: 130 For best results, call the GetTransactionDetails API operation every six hours; PayPal recommends not calling it more frequently than once per hour.
13 Integrating giropay with Express Checkout You must modify your Express Checkout implementation to use giropay, a common German funding source. z giropay Page Flows z giropay Integration giropay Page Flows If you accept giropay, you must redirect to the giropay website to collect the funds after completing the Express Checkout transaction. When your buyer selects giropay as a funding source during the Express Checkout flow, you redirect the buyer to a static PayPal URL after your order review page.
13 Integrating giropay with Express Checkout giropay Page Flows Page flow for a successful giropay payment Cancelled or Unsuccessful giropay Payment Page Flow If the giropay payment fails for any reason, such as insufficient funds or the buyer cancels, PayPal provides details to the buyer to do a bank transfer from their bank account. This transaction will remain pending until PayPal receives the funds, at which time the transaction will be complete.
Integrating giropay with Express Checkout giropay Integration 13 giropay Integration If you offer the giropay payment option, you must take additional steps to integrate with the Express Checkout flow. Initiate the Flow with SetExpressCheckout To support giropay payments, you pass the following three URLs as part of the SetExpressCheckout request. These URLs tell PayPal where to redirect the buyer based on the success or failure of each type of payment transaction.
13 Integrating giropay with Express Checkout giropay Integration Complete the Transaction Corresponding to the three fields passed to SetExpressCheckout, you must add the following three additional pages to your website: Additional pages required for giropay integration NVP Field Description Order Completion The GIROPAYSUCCESSURL page that PayPal redirects the buyer to after a successful giropay payment.