dashed-slug.net › Forums › Fiat Coin Adapter extension support › IBAN validation on fiat coin adapter › Reply To: IBAN validation on fiat coin adapter
Hello,
Currently it is not possible to disable validation. I have added this option in the upcoming major release.
As a temporary measure, for now, you can do the following:
1. Delete the minified javascript file: wallets-fiat-0.6.3-beta.min.js
. This will cause the plugin to fall back to using the unminified version, wallets-fiat.js
2. Edit the wallets-fiat.js
file as needed to conform to your validation requirements, if any.
If you change line 116 from:
return val && IBAN.isValid( val ); // check not empty, and valid iban format
to
return val.match( /^\d{9,}$/ );
then this will disable IBAN validation, and will check if the value has at least 9 digits
That’s it! (You can optionally minify the file if you want, but it’s not necessary.)
As a sidenote, if you need to modify the error message for this field, use the wallets_fiat_ui_text_iban_invalid
filter, like so:
add_filter( 'wallets_fiat_ui_text_iban_invalid', function( $text ) {
return 'The number must be at least 9 digits long';
} );
And if you need to modify the name of the field (IBAN), you can do so with the wallets_fiat_ui_text_iban
filter:
add_filter( 'wallets_fiat_ui_text_iban', function( $text ) {
return 'Foo';
} );
Finally, if you need to modify the name of the option:
add_filter( 'wallets_ui_text_swiftbiciban', function( $text ) {
return 'Other option';
} );
Please let me know if you have any questions.
with regards