Ready to get started?Download WordPress


Contact Form 7
Contact Form 7 + PayPal Integration (22 posts)

  1. vit4e
    Posted 1 year ago #

    Hey everyone,
    Since i use CF7 a lot, almost in all my websites, I am wondering is there any kind of PayPal Integration. I wanna make classic donate form: name, last name, state, field to enter how much money you donate, and when i click on "Submit" i wanna form redirect me to papal system but i wanna my variables be redirected also. I don't wanna classic donate button i wanna like this if it is possible.
    Some tutorial,or some step by step example would be great!
    Thank in advance!


  2. pikkabbu
    Posted 1 year ago #

    I would be interessed too.


  3. adamhart66
    Posted 1 year ago #


    I have written a post on this.


    Basically you create the paypal button then get the Email url code for the button. Then send the user to this url after the submit button is pressed.

    PS - my server is playing up so call back if the page does not appear first time.

  4. adamhart66
    Posted 1 year ago #

    Server is being weird but if you drop me a message on my site I will send the blog post to you if you can't view it.

  5. JohnStu
    Posted 1 year ago #

    I try this one. when i submit form, paypal button appear, but when i click on button my values does not redirect so i must fill out fields again....

  6. pikkabbu
    Posted 1 year ago #

    John, I solved the problems that way:

    Page 1: form and Submit button.

    Page redirects to page 2 thnaks to this code in the "additional settings" at the very bottom of form construction page:

    on_sent_ok: "location.replace('http://your paypal button's page');"

    Page 2:

    You're new about to submit your payement for (item) thru Paypa.
    Paypal is bla bla secure bla bla can pay with credit cards or set an account blabla..


  7. cogmios
    Posted 1 year ago #

    Ok. But how to do this with varying costs? E.g.:

    ( ) product A : $ 5
    ( ) additional red label : + $ 2
    ( ) additional option whatever : + $ 7


  8. cogmios
    Posted 1 year ago #

    Or do you make a dropdown list with all combinations in the Paypal form itself?

  9. randiferous
    Posted 1 year ago #

    I put the paypal button url in to the additional settings with the on_set_ok: code in there and it does nothing at all. Is there a setting I'm missing?

  10. cruxwireweb
    Posted 8 months ago #

    It's not working for me, either, like randiferous. I tried deactivating all my plugins - no luck. Also, my theme does have wp_head() and wp_footer(). Hm.

  11. hehafner
    Posted 8 months ago #

    I found this website tutorial with video that shows how to integrate PayPal into CF7.


    With that said, I cannot get it to work. I'm not sure if it has to do with my version of CF7 (which is v3.5) or the type of button used in PayPal.

    I hope this can help others.

  12. hehafner
    Posted 8 months ago #

    Hey! I got it to work!! I found this on CF7's website. I tried it with my paypal button. There are NO Parentheses at all.


    My string looks like this:

    on_sent_ok: "location = 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=[PUT YOUR BUTTON ID HERE]';"

    Place your button id in place of the [PUT YOUR BUTTON ID HERE]. Make sure box brackets are not there.

    Also, it is slow to process. I'm not sure if it is my server that is slow or the redirect. However, it DOES work!

  13. cruxwireweb
    Posted 8 months ago #

    Yes! No parentheses works. Thanks, hehafner!

  14. reshm
    Posted 7 months ago #

    Hi! i need some help with this....
    I have my code i'm just not sure exactly how to use contact form 7 to do this.
    What tag to i have to generate in the contact form to use the string?

  15. danielnichols
    Posted 7 months ago #


    This sounds great. How / where do I create my 'button'?

    I would like to add a 'payment' button to my holiday lodge rental site.

    Is there a way to pass through an amount to be paid? How is this done?



  16. kaplan
    Posted 7 months ago #

    Hi @danielnichols,

    I'm trying to do the same thing right now. I've been setting the amount using name="amount" in the input, but I haven't figured out how to pass it yet. I'll post back if I figure it out.


  17. kaplan
    Posted 7 months ago #

    @dan I figured out how to pass a fixed amount through the "additional messages" with on_sent_ok, but I'm not sure how to make that amount come from user input.

    Maybe this could work for you if you have a fixed amount you want to pass over to check out at PayPal. Here's what I did:

    1. Make a button on PayPal. In my case I didn't save it, just generated the code for the button and pasted that into a text file. I find that it's easier to customize when I don't save the button on PayPal. So that means there isn't a hosted_button_id

    2. Then in the Contact 7 Additional Settings I pasted my url with the variables. I'm also using the sandbox version of PayPal. If you haven't tried the Sandbox, you should definitely check it out. It allows you to do all kinds of testing as if you're using the Live PayPal site.

    on_sent_ok: "location = 'https://www.sandbox.paypal.com/cgi-bin/webscr?business=contributions-facilitator@teamjulianfoundation.com&cmd=_xclick&amount=50';"

    You can see the last variable I'm passing is the amount=50. You can probably pass any of the allowed HTML Variables for a button type in there too.

    I used the LIVE HTTP Headers Extension in Firefox to examine a regular PayPal transaction that I already have working on my staging site. Super helpful.

    And if anyone knows how I can pass an amount into my params I'd really appreciate it!


  18. kaplan
    Posted 7 months ago #

    @dan, ok I'm not saying this is pretty but it works. I'm using jQuery to grab the amount store it in a variable, then use that in the location string.

    on_sent_ok: " my_amt = jQuery('#sponsor_donation').val();"
    on_sent_ok: "location = 'https://www.sandbox.paypal.com/cgi-bin/webscr?business=contributions-facilitator@teamjulianfoundation.com&cmd=_xclick&amount=' +my_amt;"
  19. reshm
    Posted 7 months ago #

    @kaplan where exactly do you put this code in wordpress within the contact 7 plugin?

    I have my code already, and i believe its right i just don't know how to test it out

  20. kaplan
    Posted 7 months ago #

    @reshm hi. the on_sent_ok: code goes in the last input box, Additional Settings, on the form page. I made a quick grab you can view here.

  21. llocally
    Posted 6 months ago #

    Rather than examining the live headers for the parameters you can use the simpler method, read the documentation, less fun I know.

    The html query strings parameters can be found here


    Thanks for the useful thread, it makes something I was doing very easy.

  22. Dane Morgan
    Posted 5 months ago #

    Would you not be able to use a radio group and then use the [donation-amount] CF7 variable from the form for populating the amount in the on_sent_ok value?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic