0

I want to create a donate button that the user can input the amount he wants to donate in an input textfield and click donate to pay this amount.

Here's what I got while generating the donate button (I don't want the options)

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="my@email.com">

<input type=text" name"price" value"" required>

<!-- Specify a Donate button. -->
<input type="hidden" name="cmd" value="_donations">

<!-- Specify details about the contribution -->
<input type="hidden" name="item_name" value="Donation">
<input type="hidden" name="item_number" value="Donation"> 
<select name="amount"><option value="10.00">€10.00</option><option value="25.00">€25.00</option></select>
<input type="hidden" name="currency_code" value="EUR">

<!-- Display the payment button. -->
<input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" alt="PayPal - The safer, easier way to pay online">
</form>

How to pass the variable from the textfield to the donate button and remove the options ? and is it support by the API ?

Joseph Raphael
  • 338
  • 2
  • 3
  • 13

2 Answers2

0

If you want to create a donate button that the user can input the amount, you can remove these two lines:

<input type=text" name"price" value"" required>
<select name="amount"><option value="10.00">€10.00</option><option value="25.00">€25.00</option></select>

then donator can input amount on PayPal checkout page.You can have a try.

Zhao Samanta
  • 1,075
  • 1
  • 8
  • 6
0

If you want a text field where your customers can input the price (and the price entered will then be charged on the Paypal page), you can also add in your code : (but also remove the 2 lines mentioned above) resulting in a text field on your website (besides the Paypal button)

Regards, Florian

PP_Florian
  • 96
  • 3