PDN - Buy Now Buttons Overview


Introduction


This document will give you with the basic information needed to create and add PayPal single item purchase buttons to your website. PayPal single item purchase buttons let you sell individual products on your website.

Before you begin, you should have a basic understanding of HTML and be able to edit and post pages on your website. The process of creating and adding a button is outlined below. If you need more detailed instructions, or information for a more advanced implementation, please see the Website Payments Standard Integration Guide.

Prerequisites


When you create and add a PayPal Single Item Purchase button, you will need the following:

REQUIRED
  • A PayPal Premier or Business account
  • The email address at which you will receive payment
  • Item Name
  • Item Price

OPTIONAL

  • The URL for the web page users see after a successful transaction
  • The URL for the web page users see after cancelling a transaction
  • An image for the Single Item Purchase button (several buttons are available)
  • The URL of your 50 x 150 pixel logo
  • Optional item details (including item id, shipping and sales tax rates)

Implementation Overview


Single Item Purchases Flowchart

Button Generation


You may follow the steps below to create each of your buttons, or, if you are comfortable editing HTML by hand, you may create additional buttons by changing the values in the first button you create.

If you would like more detailed information on any of the following steps, please see the Website Payments Standard Integration Guide.
  1. Login to your PayPal account
    Login to your PayPal account. Click on the Merchant Services tab and choose Buy Now Buttons under the 'Website Payments' heading to go to the Button Generator. If you do not have a Premier or Business account, you will need to upgrade before continuing.
  2. Select an image for the 'Buy Now' button
  3. Enter an email address to receive payment
  4. Enter the item details
    This includes Item Name, Price, Shipping, and Sales Tax rates
  5. Add your logo to the PayPal payment pages (optional)
  6. Add your Successful payment and Cancelled payment pages (optional)
  7. Copy and paste the PayPal code onto your website
  8. Test your button
    Click the button to verify that it is working properly. Please remember that you will not be able to complete the payment flow since you may not send payments to yourself.

Tips and Tricks


If you would like to edit your code by hand, the variables you need to change are highlighted below.

A Minimal Implementation

The example code below shows the minimum information you need to create a single item purchase button. This sample creates a button to buy an oil change at Dave's Garage for $29.99 USD:

<!-- Begin PayPal Logo -->
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="dave@davesgarage.com">
<input type="hidden" name="item_name" value="dave's oil change service">
<input type="hidden" name="item_number" value="1111">
<input type="hidden" name="amount" value="29.99">
<input type="image" src="http://images.paypal.com/images/x-click-but01.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
<!-- End PayPal Logo -->


To make this a payment button for a different item, you would only need to edit three variables: item_name, item_number, and amount.

A Full Implementation

The sample code below creates a button with URLs for successful payment and payment cancellation pages, does not prompt the buyer to include a note or their shipping address, and allows the buyer to purchase more than one item.

<!-- Begin PayPal Logo -->
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="dave@davesgarage.com">
<input type="hidden" name="item_name" value="dave's oil change service">
<input type="hidden" name="item_number" value="1111">
<input type="hidden" name="amount" value="29.99">
<input type="hidden" name="image_url" value="http://www.davesgarage.com/logo.gif">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="undefined_quantity" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="return" value="http://www.davesgarage.com/success.html">
<input type="hidden" name="cancel_return" value="http://www.davesgarage.com/cancel.html">
<input type="image" src="http://images.paypal.com/images/x-click-but01.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
<!-- End PayPal Logo -->


The additional variables included above are: image_url, undefined_quantity, no_note, return, cancel_return
If you have the ability to dynamically generate portions of your site, you could save time by populating your PayPal Single Item Purchase buttons automatically, updating the variables with information from your database.

Conclusion


A PayPal Single Item Purchase button lets you add an easy, fast, and flexible payment method to your website. More detailed information about the buttons, including a walk-through of the payment process, complete descriptions of all the code variables, and information on integrating PayPal payments with your website's back-end operations can be found in the Website Payments Standard Integration Guide.