Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Payment] - IBAN allow only specific country codes #76

Open
sandervankasteel opened this issue Jan 11, 2022 · 0 comments
Open

[Payment] - IBAN allow only specific country codes #76

sandervankasteel opened this issue Jan 11, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@sandervankasteel
Copy link
Owner

sandervankasteel commented Jan 11, 2022

A possible improvement for the IBAN validation rule is a constructor parameter in which the consumer can set the one or multiple allowed countries of which the IBAN numbers are allowed.

Potential solution

class IBAN implements Rule
{
	/**
	 * @param $allowedCountries string[] 
	 *
	 */
	public function __construct($allowedCountries = [])
	{
	
	}
}

$allowedCountries would allow setting one or multiple country codes for example:

$allowedCountries = [ 'NL', 'BE' ]; 

and thus an IBAN from DE would not be considered valid;

The default behavior would not change.

Potential QoL improvement, do something with the error message? Potentially return a message in the thought of "Only IBAN numbers from 'NL' and 'BE' are allowed to be used"?

@sandervankasteel sandervankasteel added the enhancement New feature or request label Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant