PayPal button for NetCommunity

Just a quick posting to help everyone who wants to use a PayPal button on their NetCommunity site. If you use the standard buttons provided on the PayPal site they don’t work. BUT, it is not difficult to sort this out.

[clearboth]

An example form you get from the PayPal button generator is below:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="youremail@company.com">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="item_name" value="Company name">
<input type="hidden" name="item_number" value="DonationIDhere">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

You need to convert this to a link, value by value. Taking each row, we convert it into a link, so where we have:

  • name=”cmd” value=”_donations” => cmd=_donations&
  • name=”currency_code” value=”GBP” => currency_code=GBP&
  • name=”item_name” value=”Company name” => item_name=Company%20name&

You will note in the last case we have replaced a space with %20.  You should do this wherever a space exists.

The result is below and we have used the PayPal button image as the base so when you add this into a ‘Formatted Text and Image’ part of ‘Unformatted Text’ part you will have a PayPal button that links directly to a PayPal page and works within NetCommunity:

<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&no_note=0&lc=GB&currency_code=GBP&bn=PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest&
business=youremail@company.com&item_name=Company%20name&
item_number=DonationIDhere&amount=0"><img src="https://www.paypalobjects.com/en_GB/i/btn/btn_donate_LG.gif" border="0" alt="PayPal &#8212; The safer, easier way to pay online." /></a>