PayPal Website Payments Standard Integration Guide

Transcription

Website PaymentsStandard IntegrationGuideLast updated: June 2008

PayPal Website Payments Standard Integration GuideDocument Number: 100000.en US-200806 2008 PayPal, Inc. All rights reserved. PayPal is a registered trademark of PayPal, Inc. The PayPal logo is a trademark of PayPal, Inc. Othertrademarks 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., Société en Commandite par Actions. Registered office: 22-24 Boulevard Royal, L2449, Luxembourg, R.C.S. Luxembourg B 118 349Consumer advisory: The PayPal payment service is regarded as a stored value facility under Singapore law. As such, it does not require the approvalof the Monetary Authority of Singapore. You are advised to read the terms and conditions carefully.Notice of non-liability:PayPal, Inc. is providing the information in this document to you “AS-IS” with all faults. PayPal, Inc. makes no warranties of any kind (whether express,implied or statutory) with respect to the information contained herein. PayPal, Inc. assumes no liability for damages (whether direct or indirect), causedby errors or omissions, or resulting from the use of this document or the information contained in this document or resulting from the application or useof the product or service described herein. PayPal, Inc. reserves the right to make changes to any information herein without further notice.

ContentsPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11About This Guide. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Intended Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Where to Go for More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Documentation Feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Chapter 1Single-Item Payments – Buy Now Buttons . . . . . . . . . 15Getting Started With Buy Now Buttons. . . . . . . . . . . . . . . . . . . . . . . . . . . . 15The Checkout Experience With Buy Now Buttons . . . . . . . . . . . . . . . . . . . . . . 16Begin – Buyers are Ready to Purchase Your Item on Your Website . . . . . . . . . . 171 – Buyers Enter Their Billing Information or They Log In to PayPal . . . . . . . . . . 182 – Buyers Confirm Their Transaction Details Before Paying . . . . . . . . . . . . . . 203 – Buyers View and Print Their PayPal Payment Confirmations . . . . . . . . . . . . 20End – Buyers Receive Payment Authorization Notices by Email . . . . . . . . . . . . 22Enhanced Checkout Experiences . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Managing Buy Now Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Using Email Notices to Track Buy Now Transactions . . . . . . . . . . . . . . . . . . 24Using Recent Activity to Track Buy Now Transactions . . . . . . . . . . . . . . . . . 25Using Transaction History to Track Buy Now Transactions . . . . . . . . . . . . . . . 25Using Downloadable History Logs to Track Buy Now Transactions . . . . . . . . . . . 26Using Instant Payment Notification to Track Buy Now Transactions . . . . . . . . . . 26Creating Advanced Buy Now Buttons on the PayPal Website . . . . . . . . . . . . . . . . 26Buy Now Code for Payment Buttons and Email Payment Links. . . . . . . . . . . . . 26Pages in the Button Creation Tool for Buy Now Buttons. . . . . . . . . . . . . . . . . 26Specifying the Basic Features of the Buy Now Button. . . . . . . . . . . . . . . . . . 27Adding More Details to the Buy Now Button. . . . . . . . . . . . . . . . . . . . . . . 30Copying and Pasting the Buy Now Code . . . . . . . . . . . . . . . . . . . . . . . . 33Avoiding Problems With Pasted HTML Code . . . . . . . . . . . . . . . . . . . . . . 35Sample HTML Code for a Buy Now Button . . . . . . . . . . . . . . . . . . . . . . . . . 35Sample URL Code for a Buy Now Email Payment Link . . . . . . . . . . . . . . . . . . . 37Website Payments Standard Integration GuideJune 20083

ContentsChapter 2Contribution Payments – Donate Buttons . . . . . . . . . . 39Getting Started With Donate Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39The Checkout Experience With Donate Buttons . . . . . . . . . . . . . . . . . . . . . . . 40Begin – Donors are Ready to Contribute on Your Website . . . . . . . . . . . . . . . 411 – Donors Enter Their Billing Information or They Log In to PayPal . . . . . . . . . . 422 – Donors Confirm Their Contribution Details Before Paying. . . . . . . . . . . . . . 443 – Donors View and Print Their PayPal Contribution Confirmations . . . . . . . . . . 44End – Donors Receive Contribution Authorization Notices by Email . . . . . . . . . . 46Enhanced Checkout Experiences . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47Managing Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49Using Email Notices to Track Donate Transactions . . . . . . . . . . . . . . . . . . . 49Using Recent Activity to Track Donate Transactions . . . . . . . . . . . . . . . . . . 49Using Transaction History to Track Donate Transactions . . . . . . . . . . . . . . . . 50Using Downloadable History Logs to Track Donate Transactions . . . . . . . . . . . . 50Using Instant Payment Notification to Track Donate Transactions . . . . . . . . . . . 50Creating Advanced Donate Buttons on the PayPal Website. . . . . . . . . . . . . . . . . 51Donate Code for Payment Buttons and Email Payment Links. . . . . . . . . . . . . . 51Pages in the Button Creation Tool for Donate Buttons . . . . . . . . . . . . . . . . . 51Specifying the Basic Features of the Donate Button. . . . . . . . . . . . . . . . . . . 51Adding More Details to the Donate button . . . . . . . . . . . . . . . . . . . . . . . . 53Copying and Pasting the Donation Code . . . . . . . . . . . . . . . . . . . . . . . . 56Avoiding Problems With Pasted HTML Code . . . . . . . . . . . . . . . . . . . . . . 57Sample HTML Code for Donate Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . 57Sample URL Code for Donate Email Payment Links . . . . . . . . . . . . . . . . . . . . 59Chapter 3Recurring Payments – Subscribe Buttons. . . . . . . . . 61Getting Started With Subscribe Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . 61The Checkout Experience With Subscribe Buttons . . . . . . . . . . . . . . . . . . . . . 63Begin – Subscribers Are Ready to Sign Up on Your Website . . . . . . . . . . . . . . 641 – Subscribers Enter Their Billing Information or They Log In to PayPal . . . . . . . . 642 – Subscribers Confirm Their Subscription Details Before Signing Up . . . . . . . . . 673 – Subscribers View and Print Their Subscription Confirmations. . . . . . . . . . . . 68End – Subscribers Receive Subscription Authorization Notices by Email . . . . . . . . 69Enhanced Checkout Experiences . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70Managing Subscriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71Tracking Subscription Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . 71How Billing Cycles and Recurring Payments Work . . . . . . . . . . . . . . . . . . . 74Downloading Subscriber Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754June 2008Website Payments Standard Integration Guide

ContentsCanceling Individual Subscriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . 76Canceling Multiple Subscriptions at One Time . . . . . . . . . . . . . . . . . . . . . 77End of Term Messages Sent Through Instant Payment Notification. . . . . . . . . . . 79Advanced Features of Subscribe Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . 80Offering Trial Periods and Introductory Rates With Subscribe Buttons . . . . . . . . . 80Limiting the Number of Billing Cycles With Subscribe Buttons . . . . . . . . . . . . . 81Working With Modify Subscription Buttons . . . . . . . . . . . . . . . . . . . . . . . 81Working With Cancel Subscription Buttons . . . . . . . . . . . . . . . . . . . . . . . 84Generating Usernames and Passwords With Subscribe Buttons . . . . . . . . . . . . 85Reattempting Failed Recurring Payments With Subscribe Buttons . . . . . . . . . . . 87Creating Advanced Subscribe Buttons on the PayPal Website . . . . . . . . . . . . . . . 88Subscribe Code for Payment Buttons and Email Payment Links . . . . . . . . . . . . 88Pages in the Button Creation Tool for Subscribe Buttons . . . . . . . . . . . . . . . . 89Specifying The Basic Features of the Subscribe Button . . . . . . . . . . . . . . . . . 89Adding More Details to the Subscribe Button . . . . . . . . . . . . . . . . . . . . . . 92Copying and Pasting the Subscribe Code . . . . . . . . . . . . . . . . . . . . . . . . 95Avoiding Problems With Pasted HTML Code . . . . . . . . . . . . . . . . . . . . . . 98Sample HTML Code for Subscribe Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 98Sample HTML Code for a Basic Subscribe Button . . . . . . . . . . . . . . . . . . . 98Sample HTML Code for a Subscribe Button With Trial Periods . . . . . . . . . . . . . 99Sample HTML Code for a Subscribe Button With Limits on Billing Cycles . . . . . . .100Sample HTML Code for a Modify Subscription Button . . . . . . . . . . . . . . . . .101Sample HTML Code for a Cancel Subscription Button . . . . . . . . . . . . . . . . .102Sample HTML Code for a Subscribe Button With Password Management . . . . . . .103Sample HTML Code for a Subscribe Button That Reattempts Payments . . . . . . . .103Sample URL Code for Subscribe Email Payment Links . . . . . . . . . . . . . . . . . . .104Chapter 4The PayPal Shopping Cart – Add to Cart and View CartButtons . . . . . . . . . . . . . . . . . . . . . . . . . . 107Getting Started With The PayPal Shopping Cart. . . . . . . . . . . . . . . . . . . . . . .107Getting Started With Add To Cart Buttons . . . . . . . . . . . . . . . . . . . . . . . .108Getting Started With View Cart Buttons . . . . . . . . . . . . . . . . . . . . . . . . .109The Checkout Experience With the PayPal Shopping Cart . . . . . . . . . . . . . . . . . 110Begin – Shoppers Add Your Items to the PayPal Shopping Cart . . . . . . . . . . . . 1121 – Shoppers Enter Their Billing Information or They Log In To PayPal. . . . . . . . . 1132 – Shoppers Confirm Their Transaction Details Before Paying. . . . . . . . . . . . . 1153 – Shoppers View and Print Their PayPal Payment Confirmations . . . . . . . . . . 115End – Shoppers Receive Payment Authorization Notices by Email . . . . . . . . . . . 117Enhanced Checkout Experiences . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119Website Payments Standard Integration GuideJune 20085

ContentsManaging PayPal Shopping Cart Transactions . . . . . . . . . . . . . . . . . . . . . . .120Using Email Notices to Track PayPal Shopping Cart Transactions . . . . . . . . . . .120Using Recent Activity to Track PayPal Shopping Cart Transactions . . . . . . . . . .121Using Transaction History to Track PayPal Shopping Cart Transactions . . . . . . . .121Using Downloadable History Logs to Track PayPal Shopping Cart Transactions . . . .122Using Instant Payment Notification to Track PayPal Shopping Cart Transactions . . .122Creating Advanced PayPal Shopping Cart Buttons on the PayPal Website . . . . . . . . .122HTML Code for Add to Cart and View Cart Buttons . . . . . . . . . . . . . . . . . . .122Pages in the Button Creation Tool for Add to Cart and View Cart Buttons . . . . . . .123Pricing Items in Multiple Currencies . . . . . . . . . . . . . . . . . . . . . . . . . . .123Specifying the Basic Features of the Add to Cart Button . . . . . . . . . . . . . . . .123Adding More Details to the PayPal Shopping Cart Button. . . . . . . . . . . . . . . .125Copying and Pasting the PayPal Shopping Cart HTML Code . . . . . . . . . . . . . .129Avoiding Problems With Pasted HTML Code . . . . . . . . . . . . . . . . . . . . . .130Sample HTML Code for Add to Cart Buttons . . . . . . . . . . . . . . . . . . . . . . . .130Sample HTML Code for View Cart Buttons . . . . . . . . . . . . . . . . . . . . . . . . .132Chapter 5Third-Party Shopping Carts – The Cart Upload Command 135How A Third Party Shopping Cart Works . . . . . . . . . . . . . . . . . . . . . . . . . .135What The Shopper Sees With Third Party Shopping Carts . . . . . . . . . . . . . . .135What Merchants See . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140Integrating PayPal with Third Party Shopping Carts . . . . . . . . . . . . . . . . . . . . .141Required Third Party Shopping Cart Variables . . . . . . . . . . . . . . . . . . . . .141Passing Individual Item Details to PayPal . . . . . . . . . . . . . . . . . . . . . . . .141Setting the Tax for the Entire Cart . . . . . . . . . . . . . . . . . . . . . . . . . . . .143Setting the Shipping Charge for the Entire Cart . . . . . . . . . . . . . . . . . . . . .143Passing the Aggregate Shopping Cart Amount to PayPal. . . . . . . . . . . . . . . .143Securing Your Shopping Cart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143Chapter 6Securing Your Website Payments Standard Buttons . . . 145Creating an Encrypted Button on the PayPal Website . . . . . . . . . . . . . . . . . . . .146Verifying Each Payment Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .146Verifying Payments With Instant Payment Notification. . . . . . . . . . . . . . . . . . . .147Encrypting Buttons Dynamically With Encrypted Website Payments . . . . . . . . . . . .147Prerequisites for Using Encrypted Website Payments . . . . . . . . . . . . . . . . .148Public Key Encryption Background . . . . . . . . . . . . . . . . . . . . . . . .

Using Downloadable History Logs to Track Buy Now Transactions . . . . . . . . . . . 26 Using Instant Payment Notification to Track Buy Now Transactions . . . . . . .