Reputation: 858
Paypal do a buy now button with their Merchant services but you can only take a fixed amount which you have to specify when signing up with it.
What I want to do in my code is avoid signing up to a full on Merchant like Commidea and calling their webservices, but instead have the same kind of button but where I can pass the value that I want to charge to them. For example if I want to take a payment of £20.47 exactly after someone has chosen products on my website, is it possible to pass this to Paypal with a simple button, it redirect to a page which takes the customers details and then redirect back with a payment reference?
I know Paypal fees are a lot higher than getting a dedicated Merchant but its just for a short period of time.
Upvotes: 0
Views: 133
Reputation: 10223
you can use non secure buttons and use the input amount tag, like this example:
<form 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="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Enter shipping address">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="item_name" value='Payment to my company'>
<input type="hidden" name="charset" value="utf-8">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
<div style="width:500px; margin:0 auto" dir="rtl">Enter amount to pay:
<input name="amount" value="" style="width:40px">
<br /><br />
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" style="vertical-align:middle" alt="PayPal">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</div>
</form>
Upvotes: 0