How to pass dynamic amount in paypal buy now butto

2019-09-13 10:47发布

问题:

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.

回答1:

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='myname@gmail.com'>
  <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>


回答2:

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.



标签: paypal