0
votes

I have made a paypal buy now button , but is not taking dynamic amount which i am sending by form like amount variable in input type hidden

It only takes price which is set while creating form.

Please give me solution , so that i can pass dynamic price and get payment for it.

2
Than please provide solutiondipanshu
@dipanshu have a look at the link to the duplicate.Ryan McDonough
@Alex , the solutions which are provided are old now and did not work with latest paypaldipanshu
Need to see what code you are trying.Drew Angell
<form action="paypal.com/cgi-bin/webscr" method="post" target="_top"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="amount" value="20.00"> <input type="hidden" name="business" value="[email protected]"> <input type="hidden" name="hosted_button_id" value="WBFY55PUM76RL"> <input type="image" src="paypalobjects.com/en_GB/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online."> <img alt="" border="0" src="paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1"> </form>dipanshu

2 Answers

4
votes

Finally my this code works now

  <form action='https://www.paypal.com/cgi-bin/webscr' method='post' name='form'>
  <input type='hidden' name='business' value='[email protected]'>
  <input type='hidden' name='cmd' value='_xclick'> 
  <input type='hidden' name='item_name' value='itemname'>
  <input type='hidden' name='item_number' value='2'>
  <input type='hidden' name='amount' value='2 0'>
  <input type='hidden' name='no_shipping' value='1'>
  <input type='hidden' name='currency_code' value='USD'>
   <input type='hidden' name='cancel_return' value='http://cancel.com'>
     <input type='hidden' name='return' value='http://return.com/'>
   <input type="image"   src="https://paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" name="submit">
</form>
4
votes

As of June 29, 2017 I see this not working. Paypal has again changed its rules, and I don't think it any longer accepts hidden HTML fields in the form submission: they must be set in the button editor at Paypal.