O'Reilly Hacks
oreilly.comO'Reilly NetworkSafari BookshelfConferences Sign In/My Account | View Cart   
Book List Learning Lab PDFs O'Reilly Gear Newsletters Press Room Jobs  


 
Buy the book!
PayPal Hacks
By Shannon Sofield, Dave Nielsen, Dave Burchell
September 2004
More Info

How do these hacks stand up? Comment on a hack from the book by choosing the associated "Discuss" link below. You can also view the code from any of the hacks by clicking on the "Listing" or "Code" links. A number of hacks have been selected to be featured online in their entirety; you may view those hacks by clicking on the hack titles that are linked.

You can also download all the scripts and other files for this book here.

Jump to: Account Management  | Making Payments  | Selling with PayPal  | Payment Buttons  | Storefronts and Shopping Carts  | Managing Subscriptions  | IPN and PDT  | The PayPal Web Services API

Account Management

HACK
#1

Create a PayPal Account
Sign up for your own PayPal account, which is necessary if you'll be receiving payments or using just about any other hack in this book
[Discuss (1) | Link to this hack]

HACK
#2

Verify Your PayPal Account
Provide PayPal with your necessary account information without waiting for your monthly bank statements
[Discuss (0) | Link to this hack]

HACK
#3

Confirm Your Mailing Address
Add a credit card and a confirmed shipping address to your PayPal account to have your payments accepted by more sellers
[Discuss (0) | Link to this hack]

HACK
#4

Pay When You've Forgotten Your Password
Use an extra credit card to pay when you can't get into your account and don't have time to recover a forgotten password
[Discuss (0) | Link to this hack]

HACK
#5

Restore Your Account if It Has Been Limited
In the event that PayPal limits your account as a result of suspected fraud or other problem, you can restore it to its original, unrestricted state
[Discuss (0) | Link to this hack]

HACK
#6

Create a Separate Login for Each Employee
Use PayPal's Multi-User Access feature to provide a separate login for each employee in your organization
[Discuss (0) | Link to this hack]

HACK
#7

Access Member Information
Use the information PayPal publishes about members to scope out sellers and buyers, and see what they can learn about you
[Discuss (0) | Link to this hack]

HACK
#8

Manage PayPal Email
Set up multiple email accounts and filtering to manage PayPal email notifications more efficiently
[Discuss (0) | Link to this hack]

HACK
#9

Get Help from PayPal
When things go wrong, don't run screaming for the hills. Use PayPal's various forms and phone numbers to get help fast
[Discuss (0) | Link to this hack]

Making Payments

HACK
#10

Send Money to Anyone
Use PayPal's most basic feature to send money to anyone with an email address, even if the recipient doesn't have a PayPal account
[Discuss (0) | Link to this hack]

HACK
#11

Choose How to Fund Payments
Select your preferred payment funding source each time you make a payment, a necessary step if you want to pay with a credit card or alternate bank account
[Discuss (0) | Link to this hack]

HACK
#12

Use Your PayPal Funds Anywhere
Use the PayPal Virtual Debit Bar to pay for goods or services at web sites that don't normally accept PayPal
[Discuss (0) | Link to this hack]

HACK
#13

Pay from a Cell Phone
Send a payment or request a payment with a WAP-enabled cell phone
[Discuss (0) | Link to this hack]

HACK
#14

Pay Seller Fees when Buying
Send a payment along with the respective seller fees using the Mass Pay feature, so that your recipient gets precisely what you promised
[Discuss (0) | Link to this hack]

HACK
#15

Send Money Without Creating a PayPal Account
Pay someone quickly without going to the trouble of setting up an account
[Discuss (0) | Link to this hack]

HACK
#16

Dispute Merchandise Payments
Know your rights! Use PayPal's Buyer Protection policy to get your money back in the event that a seller has defrauded you
[Discuss (0) | Link to this hack]

Selling with PayPal

HACK
#17

Request Money the PayPal Way
Use PayPal's Request Money feature to ask someone for a payment, whether you need to invoice a customer or collect money from a friend
[Discuss (0) | Link to this hack]

HACK
#18

Ask for Money in Your Own Way
Generate your own PayPal payment links for use in email or your web site, and get a little more flexibility in how to ask people for payments. There are more ways available than using the Request Money feature
[Discuss (0) | Link to this hack]

HACK
#19

Request Money Without an Account
Send a PayPal payment request without having to create a PayPal account, and send payment requests on behalf of other PayPal users
[Discuss (0) | Link to this hack]

HACK
#20

Get Your Money
Retrieve the money in your PayPal account with an electronic bank account transfer or other means
[Discuss (0) | Link to this hack]

HACK
#21

Refund a Payment
Return payments to your customers without doubling up PayPal's fees
[Discuss (0) | Link to this hack]

HACK
#22

Quick-Link to Transaction Details
View the details of past purchases and sales without having to wade through the PayPal history listings
[Discuss (0) | Link to this hack]

HACK
#23

Lower Your Seller Fees
Here are five ways to lower the commissions PayPal charges you when you receive money
[Discuss (0) | Link to this hack]

HACK
#24

Protect Yourself from Buyer Fraud
Use PayPal's Seller Protection Policy to ensure that you don't lose money to fraudulent payments
[Discuss (0) | Link to this hack]

HACK
#25

Protect Yourself from Chargebacks
Reduce or eliminate the risk of having disputed payments reversed from your PayPal account
[Discuss (0) | Link to this hack]

HACK
#26

Avoid Chargebacks on Digital Goods
Make purchases of digital goods eligible for PayPal's Seller Protection by mailing physical goods
[Discuss (0) | Link to this hack]

HACK
#27

Handle Merchandise Disputes Effectively
Here's what to do when a buyer disputes a payment sent to you
[Discuss (0) | Link to this hack]

Payment Buttons

HACK
#28

Create a Buy Now Button
Accept payments on your web site with a simple button that sends the customer, along with all necessary payment information, to PayPal
The Code
[Discuss (0) | Link to this hack]

HACK
#29

Use a Custom Button Image
Customize the appearance of the Buy Now button with a few changes to the Button Factory code
[Discuss (0) | Link to this hack]

HACK
#30

Create a Purchase Button for Services
Streamline your purchase buttons for selling intangible goods and services by removing unnecessary fields. By removing certain shipping requirements, you can accept payments from all buyers, regardless of whether they can provide confirmed addresses
[Discuss (0) | Link to this hack]

HACK
#31

Create an Auction Payment Button
Create payment buttons for auctions, such that the completed transaction updates the payment status on the auction web site automatically
[Discuss (0) | Link to this hack]

HACK
#32

Provide Purchase Options with Drop-Down Listboxes
Change a few lines of the PayPal Button Factory code to restrict purchase options to a distinct list of choices
[Discuss (1) | Link to this hack]

HACK
#33

Include More Than Two Option Fields
Give your customers a large selection of options when purchasing their items, despite the limitations of payment buttons
[Discuss (0) | Link to this hack]

HACK
#34

Override Shipping and Handling Preferences
Modify purchase buttons to override your Profile settings, allowing you to set shipping and handling fees to zero for digital goods
[Discuss (0) | Link to this hack]

HACK
#35

Build Notification Tracking
Track how your PayPal applications are used by including the Build Notification (BN) tag with all your payment buttons and resulting transactions
[Discuss (0) | Link to this hack]

HACK
#36

Hack-Proof Your Payment
Prevent code-tampering and price-spoofing with a hidden form post
The Code
[Discuss (0) | Link to this hack]

HACK
#37

Hack-Proof Your Buttons with Encryption
Add yet another layer of security to a Buy Now Button by encrypting its contents with OpenSSL and C/C++
[Discuss (0) | Link to this hack]

HACK
#38

Include Payment Buttons in Email Messages
Use the PayPal Payment Request Wizard to send Pay Now buttons from Microsoft Outlook
[Discuss (0) | Link to this hack]

HACK
#39

Hide Your Email Address from Spammers
Use your PayPal referral ID to prevent your email address from being harvested by spammers
[Discuss (0) | Link to this hack]

HACK
#40

Accept Donations
Accept PayPal donations to fill your nonprofit's coffers, and tweak the Donate Now button to suit your needs
[Discuss (0) | Link to this hack]

HACK
#41

PayPal-Enable Your Flash
Add PayPal Buy Now or Subscription functionality to your Flash-powered online store using the WebAssist PayPal eCommerce Snap-ins
[Discuss (2) | Link to this hack]

HACK
#42

Get More Out of Dreamweaver and PayPal
Use the WebAssist PayPal eCommerce Toolkit to enable fast, easy, and flexible PayPal transactions with Dreamweaver
[Discuss (0) | Link to this hack]

HACK
#43

Provide Options with ASP.NET Web Controls
Create custom web controls in ASP.NET to allow customers to specify product options with their orders
[Discuss (0) | Link to this hack]

HACK
#44

Try Accepting Payments in a Bogus Currency
Weird out your pals and amuse your customers with PayPal's devilishly clever error message
[Discuss (0) | Link to this hack]

Storefronts and Shopping Carts

HACK
#45

Hack Shopping Cart Buttons
Change code from the PayPal Button Factory to provide flexibility for your Shopping Cart
[Discuss (0) | Link to this hack]

HACK
#46

Create Shopping Cart Links
Convert Shopping Cart button code to single-line URLs that can be emailed or linked to images
The Code
[Discuss (0) | Link to this hack]

HACK
#47

Specify the Size of the Shopping Cart Window
Control the size and other aspects of PayPal Shopping Cart pop-up window
The Code
[Discuss (0) | Link to this hack]

HACK
#48

Deal with Design and Layout Issues
Embed the Button Factory code in a table to maintain the appearance of your web page's layout
[Discuss (0) | Link to this hack]

HACK
#49

Put Both Cart Buttons in One Form
Overcome the limitations of some web development tools by combining the Add to Cart and View Cart buttons into a single HTML form
The Code
[Discuss (0) | Link to this hack]

HACK
#50

Integrate a Third-Party Shopping Cart with PayPal
Pass the contents of a non-PayPal shopping cart to PayPal using the Aggregate Cart and Upload Complete Cart features
[Discuss (0) | Link to this hack]

HACK
#51

Customize Checkout Pages
Give your customers a smooth buying experience by changing the look and feel of PayPal payment pages to match your web site
[Discuss (0) | Link to this hack]

HACK
#52

Display the Merchant Transaction ID on Your Return Page
Because the transaction numbers issued to merchants and buyers are different, you need to provide the merchant ID to customers
[Discuss (0) | Link to this hack]

HACK
#53

Remember Your Customers
Track your site visitors, regardless of whether they made a purchase with PayPal
[Discuss (0) | Link to this hack]

HACK
#54

Create a Dynamic Storefront
Produce a powerful storefront with a simple database and dynamic server scripting
[Discuss (4) | Link to this hack]

HACK
#55

Add Dynamic Storefront Details
Extend a dynamic storefront by creating a product details page for each product you sell
[Discuss (0) | Link to this hack]

HACK
#56

Insert Dynamic Images
Include product images with your dynamic storefront and use it to activate the PayPal payment process
[Discuss (0) | Link to this hack]

HACK
#57

Build an Order-Tracking Page
Keep your customers informed of order status using an automated system
[Discuss (0) | Link to this hack]

HACK
#58

Offer Discount Coupons
Reward good customers and entice new buyers with electronic coupons
[Discuss (0) | Link to this hack]

HACK
#59

Increase Search Engine Exposure
Modify the PayPal button code on your selling pages to make search engines spider them more effectively
[Discuss (0) | Link to this hack]

HACK
#60

Sell Digital Goods with PayLoadz
Deliver your digital goods automatically and securely without having to write your own application that relies on Instant Payment Notifications (IPN)
[Discuss (0) | Link to this hack]

Managing Subscriptions

HACK
#61

Sell Subscriptions to Your Online Content
Combine a database, PayPal subscriptions, and the IPN system to manage subscriber accounts
[Discuss (0) | Link to this hack]

HACK
#62

Offer Tiered Subscriptions
Enhance simple subscription management to accommodate different levels of users
[Discuss (0) | Link to this hack]

HACK
#63

Time Your Subscriptions to End on Specific Dates
Use some simple JavaScript and PayPal's trial period to calculate the lengths of new subscriptions, assuring they all expire at the same time
[Discuss (0) | Link to this hack]

HACK
#64

Manage Subscription Passwords the Easy Way
Use PayPal's Password Management feature and a PayPal-provided Perl script to get a subscription service up and running quickly
[Discuss (0) | Link to this hack]

IPN and PDT

HACK
#65

Receive Instant Payment Notifications
Set up the IPN system to have PayPal automatically send transaction details to your server to process immediately after receiving a payment
The Code
[Discuss (0) | Link to this hack]

HACK
#66

Troubleshoot Instant Payment Notifications
Effectively diagnose processing problems and overcome some of IPN's stumbling blocks
[Discuss (0) | Link to this hack]

HACK
#67

Send a Purchase Confirmation Email with IPN
Automate communication with customers by sending simple order-confirmation emails
The Code
[Discuss (0) | Link to this hack]

HACK
#68

Process Shopping Carts with IPN
Modify your IPN code to handle multiple products purchased through PayPal's Shopping Cart system
The Code
[Discuss (0) | Link to this hack]

HACK
#69

Use IPN with eBay Listings
Include additional variables with auction payments to help fortify the connection between eBay and your PayPal transaction history
The Code
[Discuss (0) | Link to this hack]

HACK
#70

Track Your eBay Products with IPN
Easily process eBay sales easily by automatically storing completed transactions in a database
The Code
[Discuss (0) | Link to this hack]

HACK
#71

Deliver Digital Goods with IPN
Use IPN to have your server automatically send digital goods to customers as soon as they purchase them from your web site
The Code
[Discuss (0) | Link to this hack]

HACK
#72

Deliver Digital Goods with a Return Page
Instead of forcing customers to wait for an email, present an instant download link to customers as soon as they complete the checkout process
[Discuss (0) | Link to this hack]

HACK
#73

Implement Price Checking with IPN
Prevent fraudulent transactions by comparing the value of the goods purchased with the amount received
[Discuss (0) | Link to this hack]

HACK
#74

Provide an Order Summary with IPN
Present order-specific information on the return page after the customer makes payment
The Code
[Discuss (0) | Link to this hack]

HACK
#75

Upsell Your Customers
Use the return variable to provide a list of items in which a customer might also be interested
The Code
[Discuss (0) | Link to this hack]

HACK
#76

Enable Multiple IPN Pages
Use a multiplexer script inspired by PayPal's code samples to duplicate the IPN posting to multiple scripts
[Discuss (0) | Link to this hack]

HACK
#77

Use Mass Pay to Create an Affiliate System
Automate payout incentives to affiliates and resellers with PayPal's Mass Pay feature
[Discuss (0) | Link to this hack]

HACK
#78

Manage Your Inventory with IPN
Indicate whether the products on your web site are in stock using up-to-date inventory data maintained by some add-ons to your IPN processing script
[Discuss (0) | Link to this hack]

HACK
#79

Display Donation Goals on Your Web Site
Use donation buttons and IPN to display actively updated donation goals
[Discuss (0) | Link to this hack]

HACK
#80

Display a Recent Donor List
Extend your donation system by allowing users to be recognized for their contributions
[Discuss (1) | Link to this hack]

HACK
#81

Capture Customer Information with IPN
Use the data passed back from PayPal to keep a record of your customers and their information
[Discuss (0) | Link to this hack]

HACK
#82

Insert Payment Details into a Database with IPN
Record the data from IPN into a database to facilitate simple bookkeeping
[Discuss (0) | Link to this hack]

HACK
#83

Insert Cart Details into a Database
Record the contents of customers' Shopping Carts into a database to build a complete order-tracking subsystem
[Discuss (0) | Link to this hack]

HACK
#84

Track Google Referrals
Use Google's AdWord Conversion Tracking system and PayPal's IPN system to track sales made from Google advertising
[Discuss (0) | Link to this hack]

HACK
#85

Process Payments like a Credit Card with PDT
Use PDT to transact payments synchronously and deliver your product or confirmation screen immediately—and without waiting for the IPN postback
[Discuss (0) | Link to this hack]

HACK
#86

Synchronizing PDT and IPN
Ensure that your product is delivered, even when PDT fails and the return page never shows, by introducing redundancy with IPN
The Code
[Discuss (0) | Link to this hack]

The PayPal Web Services API

HACK
#87

Set up the Sandbox
Create phony accounts and use phony money to test your API code, all without spending a dime
[Discuss (0) | Link to this hack]

HACK
#88

Make Your First API Call
Make your first API call by issuing a refund from the command line
[Discuss (0) | Link to this hack]

HACK
#89

Create a Wrapper Class for Your API Calls
Create a Windows DLL to call the API and eliminate need for the console application
[Discuss (0) | Link to this hack]

HACK
#90

Use the PayPal API Wrapper Class
Create a simple transaction-lookup form and make an API call with the API wrapper class
[Discuss (0) | Link to this hack]

HACK
#91

Refund Payments with the API
Use the API wrapper class to call the RefundTransaction API and refund a payment without logging into the PayPal web site
[Discuss (0) | Link to this hack]

HACK
#92

Handle Transaction Errors within the API Wrapper
Write one function to handle all transaction errors and simplify your API code
[Discuss (0) | Link to this hack]

HACK
#93

Retrieve Transaction Details with the API
Given only a transaction ID, use the GetTransactionDetail API call with the API wrapper DLL to retrieve the details of the transaction
The Code
[Discuss (0) | Link to this hack]

HACK
#94

Search for PayPal Transactions
Use the TransactionSearch API call to find a transaction based on several different criteria
The Code
[Discuss (0) | Link to this hack]

HACK
#95

Hack the API Wrapper
Create a master-detail report with information collected directly from PayPal
The Code
[Discuss (0) | Link to this hack]

HACK
#96

Issue Payments en Masse with the Mass Pay API
Send out a large number of payments all at once with the Mass Pay feature through the API
The Code
[Discuss (0) | Link to this hack]

HACK
#97

Pay Affiliates and Suppliers on a Schedule
Automate Mass Pay API calls to schedule mass payments at regular intervals
The Code
[Discuss (0) | Link to this hack]

HACK
#98

Search eBay for Listings that Accept PayPal
Use the eBay API to search for PayPal-enabled listings
The Code
[Discuss (0) | Link to this hack]

HACK
#99

Test IPN and PDT in the Sandbox
Test Instant Payment Notification (IPN) and Payment Data Transfer (PDT) in the PayPal Sandbox
[Discuss (0) | Link to this hack]

HACK
#100

Go Live
Take the training wheels off your Sandbox application and start working with real money
[Discuss (0) | Link to this hack]


O'Reilly Home | Privacy Policy

© 2007 O'Reilly Media, Inc.
Website: | Customer Service: | Book issues:

All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.