Integrate PayPal with Contact Form 7
-
I wanted to have someone fill in their contact details, then be redirected to PayPal once they hit submit.
This old thread had an answer, but it no longer works and the thread is now closed: https://wordpress.org/support/topic/contact-form-7-paypal-integration-1
The advice in there might have worked a year ago, but it now makes the browser redirect to a “Page Not Found” message at the PayPal end.
I just found this thread on stackoverflow that works: https://stackoverflow.com/questions/20478657/im-trying-to-ingegrate-paypal-payment-with-contact-form-7-in-wordpress-and-my/27853820#27853820
Here’s the answer:
Put this code in at the bottom of the form code itself (where the other form code is normally placed)
<script> function my_redirect() { var url = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=[PUT YOUR BUTTON ID HERE]"; window.location = url; }</script>
Then put this in the “additional settings” part.
on_sent_ok: "my_redirect();"
- The topic ‘Integrate PayPal with Contact Form 7’ is closed to new replies.