Paypal Buy Now button example

This is an example of paypal Buy Now button. You can change fields value according to your need.

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="nitinmaurya12@gmail.com" />
<input type="hidden" name="lc" value="IN" />
<input type="hidden" name="item_name" value="Demo" />
<input type="hidden" name="item_number" value="Demo001" />
<input type="hidden" name="amount" value="1.00" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="button_subtype" value="services" />
<input type="hidden" name="no_note" value="0" />
<input type="hidden" name="return" value="http://nitinmaurya.com" />
<input type="hidden" name="cancel_return" value="http://nitinmaurya.com" />
<input type="hidden" name="notify_url" value="http://nitinmaurya.com" />
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:<span class=" />NonHostedGuest" />
<input type="image" alt="PayPal – The safer, easier way to pay online." name="submit" src="https://www.paypalobjects.com/en_GB/i/btn/btn_buynowCC_LG.gif" />
<img alt="" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1" border="0" />

For Sandbox form action will be:
https://www.sandbox.paypal.com/cgi-bin/webscr

In case if you are using Live Paypal then use below URL in your ipn file to get values

$ch = curl_init(‘https://www.paypal.com/cgi-bin/webscr’);

otherwise please use below url for sandbox
$ch = curl_init(‘https://www.sandbox.paypal.com/cgi-bin/webscr’);

One Reply to “Paypal Buy Now button example”

Comments are closed.