Pro Paypal E-Commerce

Damon Williams

Introduction to PayPal
The PayPal Account
 Basic Website Payments
Encrypted Website Payments
Postpayment Processing
The PayPal API
Payflow Gateway
Reporting
Managing Online Disputes
PayPal Reference

e-books shop
e-books shop
Purchase Now !
Just with Paypal



Book Details
 Price
 3.00 USD
 Pages
 306 p
 File Size
 4,291 KB
 File Type
 PDF format
 ISBN-13 (pbk) 
 ISBN-10 (pbk)
 978-1-59059-750-7
 1-59059-750-8
 Copyright   
 2007 by Damon Williams  

About the Author
DAMON WILLIAMS has worked at PayPal since 2004, where he has
specialized in making life easier for people trying to integrate PayPal
into websites and applications. His background includes experience
in software engineering, information architecture, community
building, and publishing. Before working at PayPal, Damon spent
five years as the publisher of Feedback Magazine in Austin, Texas,
where he also moonlighted as a DJ and promoter. He currently manages
PayPal’s developer program, where he is building a global community for innovation
and support on the PayPal platform. Damon holds a bachelor’s degree in electrical engineering
from the University of Texas at Austin.

About the Technical Reviewer
MICHAEL BLANTON is the Senior Manager of Merchant Integration for PayPal Merchant
Services and has been with the Merchant Services team for three years. During that time,
he’s provided technical consulting to partners such as Dell, Apple iTunes, Napster, and
Chase Paymentech. He has also presented PayPal integration information at conferences
and contributed to numerous open source projects based on Java technology. He has
over eight years of experience in e-commerce consulting and over ten years of experience
with online payments processing.

Acknowledgments
Iwould like to thank all of the people I have worked with during my first two years at
PayPal. I wish I could list all the names, but the list would be too long and I would still
probably leave some people out. Working at PayPal has been a tremendous learning
experience, both personally and professionally.
Thank you to the following people for contributing to this book in the form of code,
advice, images, support, or guidance: Yannick Bercy, Michael Blanton, Patrick Breitenbach,
Dave Burchell, Paulam Chang, Jason Chow, Erin Curran, Matthew Dennison, Chris Hogben,
Rachel Kumar, Tom Kutter, Alex Lange, Aaron Lee, Matt Lerner, George Lin, Michael Metzger,
Margaret Morris, Laurie Redding, Colin Rule, Todd Sieber, Clarice Soloway, Brian Sparr,
Mayumi Stroy, Karen Sweetland, Winston Toy, Vicki Vance, Tim Villanueva, Sam Wu,
Harry Xue, and Gray Watson.
Thanks to the PayPal Merchant Technical Support team for your contributions to
and continued support of the PayPal Developer Community.
Finally, thanks to everyone out there building websites, applications, and services
that work with PayPal. Without you, there would be no need for this book in the first place.

Foreword
This is an exciting time for PayPal. Our business has grown exponentially over the past
few years, and we see a tremendous future ahead. PayPal’s developer community is an
important part of our future and will be instrumental in helping PayPal be the global
leader in online payments.
When you build PayPal into a website, you get much more than a payment processing
service. Our commitment to providing the most secure payments platform in the
world is why we employ a team of experts whose responsibility it is to stay one step
ahead of fraudsters. And when problems do arise with a transaction, our dispute resolution
tools and our customer support representatives help both buyers and sellers resolve
issues in a professional manner.
With thousands of businesses turning to PayPal every week to meet their payment
needs, the demand for developers with PayPal expertise grows greater each day. Resources
such as Pro PayPal E-Commerce will help you make informed decisions when choosing
the right payment solution for your or your client’s business.
It is developers like you who will have the next brilliant idea for new, creative uses of
the PayPal platform. We look forward to partnering with you on innovative, cutting-edge
technologies that provide the best user experience for our customers around the world.
Rajiv Dutta
President, PayPal

Table of Contents
Foreword . . . . . . . . . . . . . . . . . . . . . . . xv
About the Author . . . . . . . . . . . . . . . . . . . xvii
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . xix
Acknowledgments . . . . . . . . . . . . . . . . . . . . . xxi
Introduction . . . . . . . . .  . . . . . . . . . . . . . . xxiii
CHAPTER 1 Introduction to PayPal
The PayPal Advantage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Increased Sales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Credibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
The Checkout Experience. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Digital Money Platform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
PayPal and eBay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Choosing the Right Solution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Website Payments Standard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Instant Payment Notification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Payment Data Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
PayPal API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Payflow Gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Virtual Terminal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Pre-Integrated Solutions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Shopping Carts and Storefronts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Digital Goods Delivery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Accounting and Invoicing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Developer Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Developer Central . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Integration Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
PayPal Developer Community . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Solutions Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
PayPalTech . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
PayPalDev.org . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
CHAPTER 2 The PayPal Account
Account Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Personal Account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Premier Account. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Business Account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Sandbox Account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
PayPal Transaction Fees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Account Status. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Verified. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Confirmed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Limited. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Closed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Countries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Currencies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Account Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Account Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Financial Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Selling Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
CHAPTER 3 Basic Website Payments 
Website Payments Standard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
The Buy Now Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Donations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Subscriptions and Recurring Payments . . . . . . . . . . . . . . . . . . . . . . . . 45
Using the PayPal Shopping Cart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Cart Upload. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Passing the Shopping Cart Total to PayPal . . . . . . . . . . . . . . . . . . . . . 51
Passing Individual Item Details to PayPal . . . . . . . . . . . . . . . . . . . . . . 52
Specifying the Tax for the Shopping Cart . . . . . . . . . . . . . . . . . . . . . . 52
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
CHAPTER 4 Encrypted Website Payments 
Overview of EWP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Public Key Cryptography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Encrypted Code vs. Unencrypted Code . . . . . . . . . . . . . . . . . . . . . . . . 58
How PayPal Reads Encrypted Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Blocking Unencrypted Website Payments . . . . . . . . . . . . . . . . . . . . . . 59
Creating Encrypted Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
EWP with the Button Factory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Creating Certificates and Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Creating a Private Key and Public Certificate . . . . . . . . . . . . . . . . . . . 61
Uploading a Public Certificate to PayPal . . . . . . . . . . . . . . . . . . . . . . . 62
Downloading the PayPal Public Certificate . . . . . . . . . . . . . . . . . . . . . 63
Encrypting Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
The Encrypted “Blob” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Java Developers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Windows Developers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
PHP Developers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Perl Developers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
CHAPTER 5 Postpayment Processing
Auto Return. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Auto Return Account Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
The rm Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Payment Data Transfer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
How PDT Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
PDT Account Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Sample PDT Script. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
PDT Shortcomings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Instant Payment Notification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
How IPN Works. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
IPN Account Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
IPN Sample Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Dynamically Setting the Notification URL . . . . . . . . . . . . . . . . . . . . . 101
Dispute Resolution with IPN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Using IPN and PDT Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
IPN Troubleshooting Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
CHAPTER 6 The PayPal API 
Overview of the PayPal API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
API Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Life Cycle of an API Call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Accessing the PayPal API. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
API Credentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
API Certificates vs. API Signatures . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Using API Certificates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Third-Party API Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Making API Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Using the SOAP Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Using the Name/Value Pair Interface . . . . . . . . . . . . . . . . . . . . . . . . . 116
PayPal API Endpoints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
The PayPal SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
A Simple Example of Making a PayPal API Call . . . . . . . . . . . . . . . . 119
Handling PayPal API Responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Transaction Management with the PayPal API. . . . . . . . . . . . . . . . . . . . . . 128
Issuing Refunds with the RefundTransaction API. . . . . . . . . . . . . . . 129
Searching Account History with the TransactionSearch API . . . . . 131
Authorizing Payments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Sending Money with MassPay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
The Rules of MassPay. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
The MassPay API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
File-Based Mass Pay. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Website Payments Pro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Website Payments Pro in the UK. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Website Payments Pro in the Rest of the World . . . . . . . . . . . . . . . . 142
Applying for Website Payments Pro . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Direct Payment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Express Checkout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Canceling Website Payments Pro . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Seller Protection Policy for Website Payments Pro . . . . . . . . . . . . . 154
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
CHAPTER 7 Payflow Gateway
Payment Gateways . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Acquiring an Internet Merchant Account . . . . . . . . . . . . . . . . . . . . . . 158
Payflow Pro. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Getting Started with Payflow Pro . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Using the Payflow SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Processing a Credit Card Transaction . . . . . . . . . . . . . . . . . . . . . . . . 160
Testing Credit Card Transactions with the Simulator . . . . . . . . . . . 167
Debugging Common Payflow Pro Errors . . . . . . . . . . . . . . . . . . . . . . 169
Transaction Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Tender Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Reference Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Implementing PayPal Express Checkout with the
Payflow Pro API. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
XMLPay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Payflow Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Creating a Buy Now Button with Payflow Link . . . . . . . . . . . . . . . . . 176
Receiving a Transaction Response from Payflow Link . . . . . . . . . . 177
Testing Payflow Link Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Managing a Payflow Link Account . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
PayPal Manager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Logging in to PayPal Manager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Activating a Payflow Account. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Generating Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Using the Virtual Terminal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Managing a Merchant Profile. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Performing Manual Captures and Settlements. . . . . . . . . . . . . . . . . 185
Payflow Fraud Protection Services . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
CHAPTER 8 Reporting
PayPal Reporting Portal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Transaction Reconciliation Report . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Settlement File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Daily Sales Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Financial Statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Dispute Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Searching Payment History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Reporting Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Opening CSV Report Files in Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
PayPal Manager Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Transaction Summary Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Recurring Billing Transactions Report . . . . . . . . . . . . . . . . . . . . . . . . 211
Filter Scorecard Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
CHAPTER 9 Managing Online Disputes
Establishing Clear Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Item Descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Return Policy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Shipping Policy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Creating a Resolution Plan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Managing Your Resolution Plan. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Handling Chargebacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
PayPal Chargeback Specialists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Avoiding Chargebacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Seller Protection Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Resolving Disputes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
PayPal Resolution Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Resolution Center IPNs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Implementing PCI Compliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
PCI Data Security Standard Requirements . . . . . . . . . . . . . . . . . . . . 228
Merchant Levels for PCI Compliance . . . . . . . . . . . . . . . . . . . . . . . . . 228
PCI Compliance Validation Requirements . . . . . . . . . . . . . . . . . . . . . 229
Additional Resources for Disclosure and Compliance . . . . . . . . . . . 230
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
APPENDIX PayPal Reference
Standard Variable Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
The cmd Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Action Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Individual Item Information Variables . . . . . . . . . . . . . . . . . . . . . . . . . 232
Display Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Transaction Information Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Cart Upload Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Cart Upload Variables for Individual Cart Items . . . . . . . . . . . . . . . . 235
Address Override Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Prepopulating Business Account Signup Variables . . . . . . . . . . . . . 237
PayPal Subscription Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
IPN and PDT Variable Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Buyer Information Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Transaction Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Payment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Currency and Currency Exchange Variables . . . . . . . . . . . . . . . . . . . 242
Auction Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Mass Payment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Subscription Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Dispute Notification Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
API Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
General API Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Authorization & Capture API Error Codes. . . . . . . . . . . . . . . . . . . . . . 246
Direct Payment API Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Express Checkout API Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
GetTransactionDetails API Error Codes . . . . . . . . . . . . . . . . . . . . . . . 256
MassPay API Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
RefundTransaction API Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . 258
TransactionSearch API Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . 259
AddressVerify API Error Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
BillUser API Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Payflow Pro RESULT Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
RESULT Values for Declines and Errors . . . . . . . . . . . . . . . . . . . . . . . 262
RESULT Values for Communication Errors . . . . . . . . . . . . . . . . . . . . 265
Payflow Link Variable Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
INDEX . . . . . . . . . . . . . . 269

Bookscreen
e-books shop

Introduction
Who This Book Is For
This book is primarily for software developers. I assume you have a basic understanding
of Internet technologies and programming techniques. Code samples are scattered
throughout the text and are provided in numerous languages, so fluency in languages
such as Java and PHP will help you get the most value from the book. All the code samples
in this book, as well as additional code that isn’t included in the text, are provided
in the Source Code/Download section of the Apress website at www.apress.com.
If you are a business owner or entrepreneur with little to no programming experience,
however, there is still a significant amount of information you can glean from these
pages. While a good portion may be too technical for your interest, this book provides
details on almost all PayPal technologies, and as such can give you a better sense of the
type of work that would need to be done in order to integrate PayPal into your grand
schemes, even if you ultimately won’t be the one hacking out the code.

How This Book Is Structured
This book consists of nine chapters and an appendix. The sections that follow offer a general
overview of the content.
Chapter 1: Introduction to PayPal
Chapter 1 provides background information about PayPal and introduces the notion of
PayPal as a platform. Pre-integrated solutions are presented, as well as guidelines for how
to choose the best PayPal solution to meet your needs. The context for the rest of the
book is set in this introductory chapter.
Chapter 2: The PayPal Account
Chapter 2 takes a look at the PayPal account, a distinction that lies at the core of the
PayPal system. It’s what makes the connection between your email address and your
bank account, and it allows you to configure the payment technologies that PayPal makes
available. It’s also through your PayPal account that you are able to generate reports that
detail the success of your business.
Chapter 3: Basic Website Payments
Chapter 3 begins the inquiry into how PayPal can be used to accept online payments.
PayPal’s success can largely be attributed to its ease of use, and the options covered in
this chapter are the source of that reputation. Later chapters cover more advanced technologies,
almost all of which are not as simple to set up and manage as those covered in this chapter.
Chapter 4: Encrypted Website Payments
Chapter 4 takes the notions presented in Chapter 3 and extends them by adding an
optional layer of security via public key cryptography. By using the techniques presented
in this chapter, you can offer payment options on your website that are impenetrable by
hackers and fraudsters.
Chapter 5: Postpayment Processing
Chapter 5 takes a look at what takes place after the transaction is complete. This chapter
covers the popular Instant Payment Notification (IPN) and Payment Data Transfer (PDT)
technologies, which you can leverage to improve the buyer experience and automate
many aspects of your business.
Chapter 6: The PayPal API
Chapter 6 covers the publicly available functionality that PayPal exposes via its API interface.
Both the traditional SOAP and the new Name-Value Pair (NVP) interface are covered.
The API can be used to accept payments, send payments, and perform administrative
duties such as issuing refunds and searching transaction history.
Chapter 7: Payflow Gateway
Chapter 7 covers the Payflow Pro and Payflow Link payment solutions that PayPal acquired
with its purchase of the VeriSign Payment Services business in 2005. These gateway services
can optionally work with an external processor (other than PayPal), to establish the Internet
Merchant Account (IMA) necessary to process credit card transactions.
Chapter 8: Reporting
Chapter 8 presents the array of reporting functionality that PayPal offers. These primarily
include the reports provided in the business-reporting portal; for Payflow merchants, this
includes the reports provided in PayPal Manager.
Chapter 9:Managing Online Disputes
Chapter 9 discusses best practices for reducing your risk of becoming a victim to fraudulent
transactions. This chapter also covers the PayPal Resolution Center, an area on the
PayPal website where buyers and sellers can communicate and attempt to resolve disputes amicably.
Appendix: PayPal Reference
The appendix contains reference material that can be used during development to
quickly look up the meaning of a particular variable or error code, for instance.
Previous Post Next Post