Paypal Integration in PHP Step by Step. This is simple html code to use paypal payment button on website. It is recommended that use paypal sandbox account for test the payment.
Paypal Payment Gateway Integration in PHP
Test Paypal Endpoint url is: https://www.sandbox.paypal.com/cgi-bin/webscr
On your website payment page use this html code. Replace the input value text as per you need.
After that when click on submit button you will be redirected to paypal payment page. Where user will pay amount via his paypal account.
Use below code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<html> <body> <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="lc" value="US"> <input type="hidden" name="item_name" value="test_item"> <input type="hidden" name="amount" value="10"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="button_subtype" value="products"> <input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted"> <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> </body> </html> |
After testing the payment change the sandbox action url to this live url “https://www.paypal.com/cgi-bin/webscr”.
Quite simple steps for paypal payment integration.