Contact Form 7 includes the Stripe integration module, which lets you add a simple credit card payment widget to your contact forms. While this is a useful feature, if you don’t use it carefully, you may face serious risks. Here are recommended practices for Stripe integration users.
Don’t deliver goods without verifying the payment record.
When someone pays you using a payment widget, you’ll receive a payment notice from Stripe. You’re strongly advised to verify the payment record before you deliver goods. Only the payment record on Stripe is reliable evidence that the buyer paid the correct amount in the correct currency.
Use the inert-on-payment-required class effectively.
Contact Form 7 makes elements with the inert-on-payment-required class inert when the form is in the payment-required status. Using this functionality, you can block user interaction with fields other than the payment widget once the payment intent is established.
The following shows an example form template:
<fieldset class="inert-on-payment-required">
<legend>Payment form</legend>
<label> Your name
[text* your-name autocomplete:name] </label>
<label> Your email
[email* your-email autocomplete:email] </label>
<label> Subject
[text* your-subject] </label>
<label> Your message (optional)
[textarea your-message] </label>
</fieldset>
[stripe currency:usd amount:700 "Proceed to checkout" "Pay 7 USD"]
If the user can change the field values after the payment intent is established, it can lead to unexpected outcomes, such as duplicate payments or submission failures after a successful payment. Use the inert-on-payment-required class effectively to avoid those troubles.
Use Turnstile instead of a quiz or simple CAPTCHA.
We are now in the artificial intelligence era. Old-school spam protection methods, such as simple quizzes or CAPTCHAs, are now completely helpless in the face of heartless AI agents. Stop using such methods, and protect your payment forms with Cloudflare Turnstile instead.
Use WooCommerce instead when you need a full spec e-commerce platform.
Contact Form 7’s Stripe integration module is designed to add a simple payment widget to a usual single-step form. It is definitely a bad idea to use this to make an e-commerce system with a complicated shopping cart.
If you need a full-spec e-commerce platform, that’s beyond the expected use case for Contact Form 7. In such cases, we recommend WooCommerce.