Simple Html Paypal Integration Form

Now we will see how to create html donation form using paypal. This is very simple for that you need one paypal account then you can create a html form. But you need to pass the paypal required parameter values. Now we can see what all are the parameter requrired by paypal



1. item_name

2. item_number

3. amount

4. Shipping values

5. currency_code

6. CustomerName

7. CustomerEmail

You will give those values in the form, you can pass the some values in the hidden field also. In this example you can see the code some of the values i given in the hidden field. This is not only a donation form you can use it for your product also. Now this form is in sandbox mode if you want live mode change form action from https://sandbox.paypal.com/cgi-bin/webscr url to https://www.paypal.com/cgi-bin/webscr This example have the demo you can check it out in the damo link and you can also download full code by clicking the download button below. I hope this example is very useful to you.

Html Paypal Form:

<html>
<head>
<title></title>
<style>
.sanform
{
   width: 400px;
    background-color: #FFC107;
    padding: 25px;
    margin: 0 auto;
}

input, select{
width: 400px;
    height: 40px;
}

input[type="submit"]
{
background-color: #82640a;
    border-color: #82640a;
    color: #fff;
}
</style>
</head>
<body>

<form action="https://sandbox.paypal.com/cgi-bin/webscr" method="post" class="sanform">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="sanwebcorneronline@gmail.com">
    <strong>Donation / Contribution? </strong><br />
    <select name="item_name">
      <option value="Donation">Donation</option>
      <option value="Contribution">Contribution</option>
    </select><br />   <br />

    <strong>Which tutorial are you donating for?</strong><br /> 
    <select name="item_number">
      <option value="PayPal Form Tutorial">sanwebcorner.com</option>
      <option value="Amazon S3 Tutorial">sanwebtutorial</option>
      <option value="Some Other Tutorial">others</option>
    </select>
    <input type="hidden" name="amount" value="200" >
    <input type="hidden" name="no_shipping" value="0">
    <input type="hidden" name="no_note" value="1">
    <input type="hidden" name="currency_code" value="USD">
<input value="CustomerName" name="on0" type="hidden">
<input value="CustomerEmail" name="on1" type="hidden">
<br /><br />
<div class="first_name_invoice_payment">
    <strong>First/Last name (required)</strong> <br />
    <input value="" name="os0" required>
</div>
<br />
<div class="email_invoice_payment">   
   <strong> Email (requiered)</strong><br />
    <input value="" name="os1" required>
</div>

    <input type="hidden" name="return" value="http://www.sanwebcorner.com/">

    <br /><br />
    <input type="submit" value="Pay with PayPal!">
</form>
</body>
</html>


Post a comment

0 Comments