Integration Guide

Table Of Contents
HTML Form Basics for Website Payments Standard
Using HTML Variables With Saved Payment Buttons
11
340 September 2008 Website Payments Standard Integration Guide
Desired Currency on Individual Transactions
Use the currency_code variable on individual transactions to specify the currency of the
payment:
<INPUT TYPE="hidden" NAME="currency_code" value="CurrencyCode">
The value of currency_code must be a code from Table 7.6, “Currencies Allowed for
Transactions and Balances,” on page 316.
N OTE: If the currency_code variable is not included, the currency USD is used.
Using HTML Variables With Saved Payment Buttons
When you create payment buttons on the PayPal website and save them in your PayPal
account, PayPal generates HTML code for the saved button. You must add this generated code
to your website. Otherwise, buyers have nothing to click on.
Most features of the button, such as item name and amount, are saved with the button in the
PayPal account. Therefore, PayPal generates much simpler code for saved buttons than for
other buttons, as the following example shows.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- Saved buttons use the "secure click" command -->
<input type="hidden" name="cmd" value="_s-xclick">
<!-- Saved buttons are identified by their button IDs -->
<input type="hidden" name="hosted_button_id" value="221">
<!-- Saved buttons display an appropriate button image. -->
<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">
<img alt="" border="0" width="1" height="1"
src="https://www.paypal.com/en_US/i/scr/pixel.gif" >
</form>
IMPORTANT: Do not write HTML button code for saved payment buttons yourself. The
value for the hosted_button_id variable is generated solely by PayPal.
Results are unpredictable if you use your own value.
You should not write HTML button code for saved buttons. Always use the code that PayPal
generates. However, you can enhance the generated code for saved buttons by adding hidden
HTML variables that do not affect the transaction amount. For example, you can enhance
saved buttons with prepopulation variables, as described in “Prepopulating FORMs” on
page 341.