Date fields for payment methods are not required
-
When selecting Riverty or iDeal in 3 a date input field pops up. However, they are not marked as required. What is then the point of adding them?
-
Hello @boosterbast
Thank you for reaching out regarding the date input fields that appear when selecting Riverty or in3 at checkout. I understand the confusion about why these fields don’t display the standard “required” marker.
These fields are in fact mandatory for payment processing. Riverty and in3 require the customer’s birthdate (and in some cases phone number) as part of their risk checks and payment authorization.
Instead of using the browser’s default HTML
requiredattribute, the plugin uses its own custom validation system:- Client-side validation: Our checkout scripts check whether the fields are completed and valid before allowing payment to proceed, displaying clear error messages if anything is missing or incorrect.
- Server-side enforcement: On the backend, the plugin will block the payment and return an error if a valid birthdate is not provided. This ensures that no payment request can be sent to Mollie without the required information.
- Why not HTML
required: Using our validation system instead of the browser’s default allows for better error handling, ensures compatibility across classic and block checkout flows, and provides a smoother customer experience.
So while the fields don’t show the “required” marker in the traditional sense, they are enforced as mandatory both at checkout and during payment processing. Customers must enter this information for Riverty and in3 payments to succeed.
Regards,
Femi.Hi Femi,
They are not enforced by the plugin. Leaving the fields empty still allows you to continue to proceed.
Hello,
Thank you for your question regarding the date input fields (birthdate) for Riverty and in3. I understand the confusion around why these fields appear but are not marked as required.
Why the fields appear
- Riverty and in3 require the customer’s birthdate (and sometimes phone) for their payment authorization process.
- At checkout, these fields are displayed to give the buyer the opportunity to enter the information in advance. If provided, it is stored in the order meta and passed along with the payment request.
Why they are not marked as required
- This was a deliberate design decision. If no valid birthdate is entered, the payment provider will request the information again on their hosted payment page before the payment can proceed.
- This ensures there are no hard payment failures. Missing information at checkout will never cause Mollie to reject the payment.
- Making the fields required on the WooCommerce side could introduce problems such as:
- Checkout abandonment if the custom field fails to render in certain themes or browsers.
- Unnecessary validation errors blocking order creation.
What happens in practice
- If a customer enters a valid birthdate → it is stored in the order and sent automatically to the provider.
- If the field is left empty or invalid → the provider will simply ask again on their payment page.
Can I make them required anyway?
Yes. If you prefer to enforce this at WooCommerce checkout, you can do so with a small code snippet using thewoocommerce_after_checkout_validationfilter. Example:add_filter('woocommerce_after_checkout_validation', 'make_riverty_birthdate_mandatory', 10, 2);
function make_riverty_birthdate_mandatory($fields, $errors) {
if (!isset($fields['payment_method']) || $fields['payment_method'] !== 'mollie_wc_gateway_riverty') {
return $fields;
}
$birthdate_field = 'billing_birthdate_riverty';
$birthdate_value = filter_input(INPUT_POST, $birthdate_field, FILTER_SANITIZE_SPECIAL_CHARS) ?? '';
if (empty($birthdate_value)) {
$errors->add(
'validation',
sprintf(
__('%s is a required field.', 'woocommerce'),
'<strong>' . __('Birthdate', 'mollie-payments-for-woocommerce') . '</strong>'
)
);
}
return $fields;
}In summary:
The fields are optional at WooCommerce checkout by design, to reduce friction. If empty, the hosted payment page will enforce them. This ensures a smoother customer experience while still meeting the provider’s requirements.Hi Femi,
Thanks for the clear and extensive explanation.
The topic ‘Date fields for payment methods are not required’ is closed to new replies.