Donate: Sample HTML button code

DOCS

Last updated: Sept 19th, 2:29am

The following code samples demonstrate various features of PayPal-hosted Donate buttons.

Basic Donate button

The sample HTML code below illustrates a basic Donate button where donors enter their own contribution amount during checkout. The code uses the currency_code variable to set the currency for the contribution amounts that donors enter.

Paste the following code onto your web page below an image or a text description of the item.

<form action="https://www.paypal.com/donate" method="post" target="_top">
 <!-- Identify your business so that you can collect the payments. -->
 <input type="hidden" name="business" value="donations@kcparkfriends.org">
 <!-- Specify details about the contribution -->
 <input type="hidden" name="no_recurring" value="0">
 <input type="hidden" name="item_name" value="Friends of the Park">
 <input type="hidden" name="item_number" value="Fall Cleanup Campaign">
 <input type="hidden" name="currency_code" value="USD">
 <!-- Display the payment button. -->
 <input type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" alt="Donate">
 <img alt="" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>

The sample code above produces the following result:

Donate,Button

Fixed contribution amount

The sample HTML code below illustrates a Donate button where the contribution amount that donors make is fixed and cannot be changed. The code uses the amount and the currency_code variables to set fixed contribution amount at $25.00 USD.

Paste the following code onto your web page below an image or a text description of the item.

<form action="https://www.paypal.com/donate" method="post">
 <!-- Identify your business so that you can collect the payments. -->
 <input type="hidden" name="business" value="donations@kcparkfriends.org">
 <!-- Specify details about the contribution -->
 <input type="hidden" name="no_recurring" value="0">
 <input type="hidden" name="item_name" value="Friends of the Park">
 <input type="hidden" name="item_number" value="Fall Cleanup Campaign">
 <input type="hidden" name="amount" value="25.00">
 <input type="hidden" name="currency_code" value="USD">
 <!-- Display the payment button. -->
 <input type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" alt="Donate">
 <img alt="" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >

</form>

You can write your own URL code for Donate email payment links. You can use the same variables and values that you include in HTML Donate buttons.

Paste the following code onto your web page below an image or a text description of the item.

https://www.paypal.com/donate?business=donations@kcparkfriends.org&no_recurring=0&item_name=Friends+of+the+Park&item_number=Fall+Cleanup+Campaign&amount=25¤cy_code=USD

For information on pasting code, see Copy and paste button code.

See also

If you accept cookies, we’ll use them to improve and customize your experience and enable our partners to show you personalized PayPal ads when you visit other sites. Manage cookies and learn more