Thursday, March 7, 2013
How to Pass Information to PayPal in a Form
1. Open your webpage you want to edit. You can create HTML forms using a plain text editor, such as Notepad, or more advanced editors, such as Visual Studio or Notepad++.
2. Start the PayPal form with the standard action element that points to the PayPal website. The "action" part of the form tag is where the variables are processed. The following code starts the form:<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
3. Add a hidden input tag with the "cmd" value. This is also required by the PayPal processing page. The following code needs to be placed underneath the opening form tag:<input type="hidden" name="cmd" value="_xclick">
4. Add the business email address. This is the final required component so PayPal is able to recognize your business account. The following code adds the business email address in a hidden field:<input type="hidden" name="business" value="business@my_business_domain.com">
5. Add each item, detail and price to the form. PayPal has several standard HTML variables (see Resources) you can use to customize the checkout for your users. The code below adds an item and a price to the form:<input type="hidden" name="item_name" value="My Item">
<input type="hidden" name="item_number" value="MyItemNumber1">
<input type="hidden" name="amount" value="55">
<input type="hidden" name="quantity" value="1">
6. Close the form with the ending tag. The code below is the last statement in your page:</form>
7. Save the page and open it with your web browser to test the code. The item and values you placed in the form are automatically shown on the PayPal processing page for the user.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment