Submit & PayPal Button Intergration

Avyi 17 May, 2012
Please forgive me if this has already been covered, but I have spent the past 4 hours scouring through the forums and tutorials, and I am still lost.
I am wanting to have my submit button be the paynow paypal button that loads all info to the database THEN takes them to the paypal site.
Is this doable?

Thanking you for your time!
~Avyi
GreyHead 18 May, 2012
Hi Avyi,

Yes, set the form up as normal then use the PayPal ReDirect or the ReDirect URL + ReDirect User actions to send the user and the data to PayPal.

Bob
Avyi 25 May, 2012
Thanx!
I'll Give that a try!🙂
Avyi 05 Jun, 2012
Is there a tutorial that shows this process?
The company I am creating this form for does not have an SSL Certificate, and do not want to ask for the payment information on the site.
GreyHead 06 Jun, 2012
Hi Ayvi,

Here's a quick tutorial.

[list=a]
  • Got to the PayPal account and create a payment button. In step 2 uncheck the 'Save Button at PayPal option. At the select Code step click the 'Unprotect code' link and copy the code. It will look something like this
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="XXXXXXXXX">
    <input type="hidden" name="lc" value="GB">
    <input type="hidden" name="item_name" value="Testing">
    <input type="hidden" name="item_number" value="999">
    <input type="hidden" name="amount" value="15.00">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="button_subtype" value="services">
    <input type="hidden" name="no_note" value="0">
    <input type="hidden" name="cn" value="Add special instructions to the seller">
    <input type="hidden" name="no_shipping" value="2">
    <input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
    <input type="image" src="https://www.paypalobjects.com/en_US/GB/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.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
    </form>


  • Extract the Target URL https://www.paypal.com/cgi-bin/webscr

  • Strip back the rest of the code to get name=value pairs to get a lit like this:
    cmd=_xclick
    business=XXXXXXXXX
    lc=GB
    item_name=Testing
    item_number=999
    amount=15.00
    currency_code=USD
    button_subtype=services
    no_note=0
    cn=Add special instructions to the seller
    no_shipping=2


  • Delete any name=value pairs that you don't need e.g. cn=Add special instructions to the seller

  • Decide which of the remaining pairs are static i.e. always the same e.g.cmd=_xclick and which are dynamic i.e. depend on the form results.

  • For the dynamic results replace the value with the name of the corresponding form input in curly brackets e.g. amount={amount}

  • Save and test.
  • [/list:o]

    Bob
    This topic is locked and no more replies can be posted.