
Paid Memberships Pro is a great WordPress plugin that allows paid subscriptions to your WordPress site. It has tons of features and is incredibly flexible with handling subscriptions.
One of my company’s clients uses it for managing all of their memberships and uses Stripe as the payment gateway. Stripe is also a great company — I use it for my own company and have set it up for several clients.
For reasons unknown to me, PMPro has decided that since Stripe does not require a CVV/CVC to process a payment that they will default their payment page to not require it either. Since a valid CVV/CVC can mean the difference between a charge going through and a charge being declined, it should be required regardless of whether or not Stripe requires it or not. Its just good security policy.
Adding this code to the end of your active theme’s functions.php will make the CVV/CVC a required field:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
// Force CVV on PMPro // Adds the field to the checkout page function my_pmpro_show_cvv($show) { return true; } add_filter("pmpro_show_cvv", "my_pmpro_show_cvv"); // Puts CVV back into the required fields array function my_pmpro_required_billing_fields($fields) { if ( isset( $_REQUEST['CVV'] ) ) { $CVV = sanitize_text_field( $_REQUEST['CVV'] ); } else { $CVV = ""; } $fields['CVV'] = $CVV; return $fields; } remove_filter("pmpro_required_billing_fields", "pmpro_stripe_dont_require_CVV"); add_filter("pmpro_required_billing_fields", "my_pmpro_required_billing_fields", 99); |
After adding that code, the little “*” is there denoting that its a required field and the payment will not be processed unless the enter the CVV:
Hi,
I’m testing this, and for some reason, it doesn’t work for me. I provide a CVV number, but it keeps showing a message saying that I must fill in all fields. I’m using Stripe on test mode.
Is this code still working for you?
Thanks!
Sadly I can’t verify that it is or not. I’m no longer working on that project and can’t test the code any longer. Hopefully someone else may comment on this and help you out.