4th Aug

Simple PayPal integration in your site

Post By admin | Find Under: PHP, Web Development

Online payment is the hype of today’s web world. For getting any service or product we prefer to online payment method and PayPal is the most secure payment gateway. If you have a very basic knowledge of PHP, you can easily implement the simple PayPal gateway in your site.
paypal image

Put the following codes in your PHP page where you do want to place a Pay button.

<?php
$payee = "Tom Harry"; // this is who they will make checks payable to
$usepaypal = "yes"; // put no between the " " to not show paypal button
$paypal = "email@domain.com"; // YOUR PAYPAL EMAIL
$paypal_curr = "USD"; // PayPal Currency Code for your Country
$paypal_lang = "US"; // Sets the locale (language) of the PayPal login page
$amount = 100; // the amount of the service or the price of the product
$invoiceid = 'AP789ZR'; // the invoice id
?>
<form name="form1" method="post" action="https://www.paypal.com/cgi-bin/webscr">
    <tr>
        <td width="40%" align="right" class="label">&nbsp;</td>
        <td width="60%" align="left">
		<input type="hidden" name="cmd" value="_xclick">
        <input type="hidden" name="business" value="<?=$paypal?>">
        <input type="hidden" name="item_name" value="Invoice #<?=$invoiceid?>">
        <input type="hidden" name="amount" value="<?=$amount?>">
        <input type="hidden" name="no_shipping" value="1">
        <input type="hidden" name="no_note" value="1">
        <input type="hidden" name="currency_code" value="<?=$paypal_curr?>">
        <input type="hidden" name="lc" value="<?=$paypal_lang?>">
        <input type="hidden" name="bn" value="PP-BuyNowBF">
		<input type="image" name="pay" src="images/paypal.png" alt="Make payments with any major credit card!"/>
		</td>
    </tr>
	</form>

If you think this article is useful then you can share this post.

Leave a Reply