Integration Guide

Table Of Contents
HTML Form Basics for PayPal Payments Standard
Overriding Addresses Stored With PayPal
13
414 June 2012 PayPal Payments Standard Integration Guide
Sample HTML Code for Filling Out FORMs Automatically for Buyers
The following sample HTML code shows a payment button with variables for automatically
filling out PayPal forms for the buyer. Your website generates the field entries dynamically
from information that your website gathers about the buyer. The variables and their values are
included in the URL to which buyers are sent when they click the payment button.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="seller@designerfotos.com">
<input type="hidden" name="item_name" value="hat">
<input type="hidden" name="item_number" value="123">
<input type="hidden" name="amount" value="15.00">
<input type="hidden" name="first_name" value="John">
<input type="hidden" name="last_name" value="Doe">
<input type="hidden" name="address1" value="9 Elm Street">
<input type="hidden" name="address2" value="Apt 5">
<input type="hidden" name="city" value="Berwyn">
<input type="hidden" name="state" value="PA">
<input type="hidden" name="zip" value="19312">
<input type="hidden" name="night_phone_a" value="610">
<input type="hidden" name="night_phone_b" value="555">
<input type="hidden" name="night_phone_c" value="1234">
<input type="hidden" name="email" value="jdoe@zyzzyu.com">
<input type="image" name="submit" border="0"
src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif"
alt="PayPal - The safer, easier way to pay online">
</form>
Overriding Addresses Stored With PayPal
For people who already have PayPal accounts and whom you already prompted for a shipping
address before they choose to pay with PayPal, you can use the entered address instead of the
address the person has stored with PayPal. Set the address_override variable to 1, as in
the following example:
<INPUT TYPE="hidden" name="address_override" value="1">
You must also include FORM variables that contain the person’s address information, as
detailed in “HTML Variables for Filling Out PayPal Checkout Pages Automatically.”
The payer is shown the passed-in address but cannot edit it. No address is shown if the address
is invalid, such as missing required fields like country, or if the address is not included at all.
For a detailed description of how overriding the address and other settings affect the PayPal
billing and shipping addresses, see Appendix B, “Address Handling (U.S. Merchants Only).”