Hi @ilan76
Hope you are doing fine!
If you are using the forminator_custom_form_submit_errors , filter then you can return the errors if a validation fails before the payment is processed.
Please find below an example of validating if some fields are empty or you can also add your own validation criteria (look at the comments in the code)
add_filter( 'forminator_custom_form_submit_errors', 'wpmudev_limit_email_submission', 9999, 3 );
function wpmudev_limit_email_submission( $submit_errors, $form_id, $field_data_array ) {
if ( $form_id != 6 ) { //Please change this number to the ID of your form
return $submit_errors;
}
$submitted_data = wp_list_pluck( $field_data_array, 'value', 'name' );
// You can add your validation logic here
// And then evaluate below based on the needed criteria
if ( ! empty( $submitted_data['text-1']) ) {
if ( $submitted_data['text-1'] != $expected_value_from_api ) {
$submit_errors[]['text-1'] = __( 'Value entered is not valid.', 'forminator' );
}
}
return $submit_errors;
}
Hope this example helps. In case further assistance may be required, please help us sharing the form export and any custom code you have added to perform the validation, so that we could review the existing settings.
Please take a look at the following doc on how to export a form:
https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export
If you are concerned about any sensitive information in the form, then you can duplicate your form, remove any sensitive information, and then export it. You can share the export file via Google Drive, Dropbox or any cloud services in the next reply.
Kind regards
Luis