Make sure to create both a buyer(Personal) and a seller(Business) accounts.
Once the sandbox accounts are set up, you can use the following template to implement the "Buy Now" button.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="POST"> | |
<input type="hidden" name="business" value="bookportal@bookportal.lk"><!--Your business account details--> | |
<input type="hidden" name="cmd" value="_xclick"> | |
<input type="hidden" name="item_name" value="Item name"><!--Buying item name--> | |
<input type="hidden" name="amount" value="item value"><!--Buying item value--> | |
<input type="hidden" name="currency_code" value="USD"> | |
<input type="hidden" name="return" value="http://localhost:8080/BookPortal/site/payment/paypalsuccess.jsp"><!--Where to return to after successful transaction--> | |
<input type="hidden" name="rm" value="2"> | |
<input type="hidden" name="cancel_return" value="http://localhost:8080/BookPortal/site/payment/paypalcancel.jsp"> <!--Where to return to after cancelling a transaction--> | |
<input type="image" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online"> | |
<img alt="" border="0" width="1" height="1" src="https://www.paypal.com/en_US/i/scr/pixel.gif" > | |
</form> |
You can alter the values of item and amount to be directed from the item details and proceed.
0 comments:
Post a Comment