Create payment buttons for auctions, such that the completed transaction updates the payment status on the auction web site automatically.
Merchants that sell using auction sites such as eBay often have to collect payment for their goods after the auction has ended. Sometimes, it can be confusing to the winning bidder how to complete payment, and you'll want to make it as easy as possible for your customers to send you money. Using some simple HTML, you can construct a payment button much like the payment buttons generated by PayPal for Shopping Cart and Web Accept purchases. You then present this button to the winning bidder in an email or on your web site to supplement the payment buttons already on the auction site.
Since PayPal is an eBay company, it shouldn't be surprising that PayPal is well integrated with the eBay web site. For instance, if you indicate that you accept PayPal payments when constructing an eBay listing, a PayPal button will automatically appear for the winning bidder when the listing ends. Here's how to build the link between your eBay account and your PayPal account:
Go to the eBay web site and log into your eBay account.
Go to My eBay and click the eBay Preferences link under the My Account heading.
Click the Change link next to the Payment Preferences heading, and turn on all the PayPal-related settings here.
When you sell your next item, check the PayPal option in the "Seller-accepted payment methods" section and enter the email address of the PayPal account to which you'd like auction payments to be sent.
That's it! When your auction ends, a PayPal payment button will automatically appear at the top of the auction page, but for the winning bidder only.
Furthermore, you can configure PayPal to automatically insert a Pay Now button into each of your running auctions:
Log into your PayPal account.
Click the Profile tab and then click Auctions.
If your eBay account isn't listed here, click Add, and then enter your eBay user ID and password.
Otherwise, simply turn on the features you'd like to employ. The changes will take effect immediately.
The PayPal Auction options include the following:
PayPal automatically inserts a PayPal logo into the description of each of your running auctions (using eBay's Add to Description feature). This not only advertises the fact that you accept PayPal, it also gives your winning bidder a shortcut to the payment process.
This instructs PayPal to automatically send an email to all your winning bidders, complete with payment instructions and a Pay Now button. This email is sent independently of eBay's "Congratulations! You are the buyer for..." email.
This inserts the PayPal logo into the "Payment methods accepted" section of your auction page, as shown in Figure 4-3. The PayPal logo appears in addition to the logo that might already be there and suggests to your customers that you not only accept PayPal, but you whole-heartedly prefer it as a means of payment.
Although eBay provides payment buttons for high bidders, you might want to supplement these buttons with your own. Plus, you might want to add eBay-like functionality to other auction sites, such as Yahoo!, uBid, Amazon.com, MSN, and Bidville auctions.
This code displays a simple Pay Now button that sends your customers to the PayPal web site and guides them through the payment process. The system automatically tracks the payment for this particular auction, so your customer will not have to enter any additional auction-related information. Plus, the auction site, provided that it's linked up with PayPal, will be notified automatically so that it can update the payment status of the auction for you and your bidder.
The goal of providing an extra payment button like this one is to reduce the chances that your customer (bidder) will use PayPal's Send Money function to pay for an auction; in that case, you would receive a payment not linked to its corresponding auction.
Here is the HTML code for an auction payment button, linked to a particular auction:
<form method="get" action="https://www.paypal.com/cgi-bin/webscr"> <input type="hidden" name="cmd" value=_cart> <input type="hidden" name="business" value="email@example.com"> <input type="hidden" name="item_name_1" value="Widget"> <input type="hidden" name="amount_1" value="1.00"> <input type="hidden" name="quantity_1" value="1"> <input type="hidden" name="site_1" value="eBay"> <input type="hidden" name="ai_1" value="2540252652"> <input type="hidden" name="ab_1" value="your_ebay_id"> <input type="submit" name="upload" value="Pay Now"> </form>
This code is similar to the code used in [Hack #50], with the exception of a few new variables: site_n, ai_n, and ab_n, where n is a number representing the item in multiple item payments, starting with 1 (for example, include ab_1, ab_2, and ab_3 if you're requesting payment for three different auctions).
The site_n variable defines the site on which the auction was listed, and it should be set to eBay for eBay auctions or Yahoo for Yahoo! Auctions. This value is case sensitive, so for other auction sites, you'd type uBid, Amazon, MSN, or Bidville. The second variable, ai_n, should be set to the auction (or listing) number at the auction site. Finally, ab_n, is your user ID at the auction site (your_ebay_id in this example). Naturally, you'll need to replace all italicized text in the code with the details of your transaction.
The other variables, such as item_name_n and amount_n, can be modified as described in [Hack #28] .
This hack demonstrates how you can create buttons that facilitate auction-specific payments. Naturally, creating a button for each auction manually would be a time-consuming process, but you can use the eBay API to automate this process. Start by sending a query to obtain the information for each of your completed auctions using a GetTransactionDetails call, and then assemble your buttons and email them to the high bidders. The technical procedures involved with implementing this type of system go beyond the scope of this book, but extensive information can be found in David A. Karp's eBay Hacks (O'Reilly).
If you use an off-site listing tool or a third-party listing service to build your auctions, you might be able to tie your application into the application's local database. However, you will also need a means of obtaining completed-item details (such as the final price and high-bidder contact information). For an example that shows how to build payment buttons dynamically, see [Hack #54] .