views:

21

answers:

2

I've looked all over paypal's website and can't find any info on creating a simple text link for a donation.

Anyone have any info?

+1  A: 

Updating the button code from paypal:

<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="[email protected]">
    <input type="hidden" name="item_name" value="Team In Training">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="amount" value="25.00">
    <a href="javascript:document._xclick.submit();">Donate</a>
</form>
Gavin Miller
So there is no way to do this with just a hyperlink? I want to avoid using a form if at all possible.
kylex
@kylex What do you want to avoid using a form?
Gavin Miller
@Gavin Because the user is entering code through a CMS which strips out the form tag.
kylex
A: 

According to this link, you can use HTTP GET, meaning you can build a URL for a simple link. Note that this link is written in C#, so you can't actually use this as code reference.

You'll probably need something like

<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;[email protected]&amp;item_name=..."&gt;

Make sure to use '&' to separate fields and to encode them properly if they include special characters (such as '&').

Asaf