Friday, January 30, 2009

How to Integrate paypal with HTML

How to Integrate paypal with HTML

Paypal is very common payment gate way and mostly used in HTML ,PHP,.NET web sites for sub mit payment to vendor.


Now I am explain steps of integrating in Paypal in our application.

Suppose we have a page where we set the item and price and other inforamation in html hidden fields.
General structure of page is as follows.


[form id="Form1" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"]
[input type="hidden" name="cmd" value="_xclick"] [input type="hidden" name="business" value="mca.mk_1233244379_biz@gmail.com"]
[input type="hidden" name="item_name" value="Item1"]
[input type="hidden" name="amount" value="100.00"]
[input type="hidden" name="currency_code" value="USD"]
[input type="hidden" name="return" value="http://localhost/eStoreFrontCS/Default2.aspx"]
[input type="hidden" name="cancel_return" value="http://localhost/eStoreFrontCS/Default.aspx"]
[asp:Label id="Label2" style="Z-INDEX: 101; LEFT: 784px; POSITION: absolute; TOP: 8px" runat="server"
ForeColor="White" BackColor="#C04000" Font-Bold="True" Width="20045px"]Loading payment process.....[/asp:Label]
[asp:Label id="Label3" style="Z-INDEX: 102; LEFT: 16px; POSITION: absolute; TOP: 8px" runat="server"
Font-Bold="True"]Wait ...[/asp:Label]
[/form]

In action tag we give the url of sandbox. This is starting step with paypal. Open the paypal.com

1)https://developer.paypal.com/ -] Signup now
2)after it you will recive a message “ Sandbox Signup Complete”
3)Check Email account which u specify in signup process. And click link for confermation.
4)Open paypal site with given link.
5)Choose option “Create a preconfigured buyer or seller account.” under TEST ACCOUNT tab.
6)Create a Buyer Account (Use to represent your customer's experience) must open “ Show Advanced Options “ link and give starting balance amout as 5000 USD or as your requirement. In Add note section copypaste the password so u can check it any time in test account secton.
7)Create a Seller Account (Use to represent yourself as the merchant) and also provide sum banalce under “ Show Advanced Options “ In Add note section copypaste the password so u can check it any time in test account secton.
8)Now the work with paypal site is over. Now come on your HTML page. And copy paste all code under form tag.
9)And after it put this script which submit page when it will load
10)[script language="JavaScript"]Form1.submit()[/script]
11) and now this will redirect u on this link https://www.sandbox.paypal.com/us/cgi-bin/webscr? With querystring.
12)Now in “ LOG IN TO PAYPAL “ frame put details of Buyer Account which u created for above code the details ar e as follows mca.mk_1233244323_per@gmail.com / pwd is testpwdtestpwd
13)enter pwd testpwdtestpwd
14) now confermation screen will come
15) Click on pay now button. And u wil get thanks msg window.
16)Now we have to check the effects on murchent and buyer account. So opent sandbox account.
17) Buyer account is debit form 100 USD
18)And murchant account is Credit by 96.8 USD.
Hope with above steps u can get basic idea of paypal account.

Thanks
HelpOnDesk Team

No comments: