I solved this by adding the following code in a “must use plugin”:
// Hook in
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
// Our hooked in function - $fields is passed via the filter!
function custom_override_checkout_fields( $fields ) {
$fields['billing']['wc-stripe-new-payment-method'] = array(
'type' => 'text',
'label' => '',
'label_class' => array('hidden'),
'required' => true,
'class' => array('hidden'),
'default' => '1',
'clear' => true
);
return $fields;
}
This adds a hidden field to the checkout page which will activate the “Save card for later” functionality.
Then I hid the checkbox intended for this use, with this code:
.form-row.woocommerce-SavedPaymentMethods-saveNew {
display: none !important;
}
—–
Before launching the service, I’ll add a warning to the page explaining that the card is forcefully saved to allow for future charges.
I hope this solves any potential legal matters and regulations. Does it?
If so, then this is a valid solution and this matter can be marked resolved, correct?