Click here to Skip to main content
15,881,248 members
Articles / Web Development / HTML
Tip/Trick

How to add a donation button for a Paypal gateway

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
12 Dec 2011CPOL 10.5K   8  
Code to add a donation button for Paypal.

Write the below given code into an HTML file where you want to add a donation button.

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick"/>
    <input type="hidden" name="business" value="donations@example.com"/>
    <input type="hidden" name="item_name" value="School Fund"/>
    <input type="hidden" name="item_number" value="2011"/>
    <input type="hidden" name="amount" value="50.00"/>
    <input type="hidden" name="no_shipping" value="2"/>
    <input type="hidden" name="no_note" value="1"/>
    <input type="hidden" name="currency_code" value="USD"/>
    <input type="hidden" name="tax" value="0"/>
    <input type="hidden" name="bn" value="PP-DonationsBF"/>
    <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" 
        border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"/>
    <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
</form>

where input type are fields to have values for your expectations, the name business shows the value for the type of business, item_name shows the type of item, amount for the value of item, and so on ...

And you are done with a button for your Paypal payment gateway.

And for the rest making a change in value for the line <input type="hidden" name="bn" value="PP-DonationsBF"/>,
you can switch between several types of alternatives:

  1. <input type="hidden" name="bn" value="PP-SubscriptionsBF"/>
  2. <input type="hidden" name="bn" value="PP-DonationsBF"/>
  3. <input type="submit" value="PayPal"/>
  4. <input type="hidden" name="bn" value="PP-BuyNowBF"/>
  5. <input type="hidden" name="bn" value="PP-ShopCartBF"/>

Hence your Paypal gateway is ready to face the world of payments.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead Erls Corporation
India India
I am Dinesh kumar Choudhary by Name, a software Designer and Developer by Work, a Indian Hindu by Religion, Co-Founder of DSFoundation located at http://dsfoundation.wordpress.com by profession, a Loving husband and a Caring Father by Relation.

I have a blog Website at http://dennosecqtinstien.wordpress.com. DSFoundation is the Autonomous body to serve for the management of Local shops located at New Delhi, India. Now a days DSFoundation and its subsidiaries are managed by Erls Corporation, an Another initiative by me and my colleagues, in which i am the another CO-Founder of the Organization. Erls Corporation can be located at http:erlsindia.co.in

Comments and Discussions

 
-- There are no messages in this forum --