Class: BicValidator

sogv.BicValidator

This constraint is used to ensure that a value has the proper format of a Business Identifier Code (BIC).

BIC is an internationally agreed means to uniquely identify both financial and non-financial institutions.

You may also check that the BIC is associated with a given IBAN.

new sogv.BicValidator (data, options, optionRules, lang, internal)

Create a new Validator.

Name Type Description
data * The data which needs to be validated.
options Object The setting options
optionRules Object The validation rules for setting options.
lang String The language used by the application. Default: "en".
internal Boolean If this parameter is true, it means, that validation called from core.
Properties:
Name Type Description
alias Array

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['bic'].

options Object The description of the required options.
Example
var validator = new sogv.BicValidator(data);
if (false === validator.isValid()) {
     validator.errors().first();
}

Extends

Members

data * inherited

Data that needs to be validated.

iban String

An IBAN value to validate that the BIC is associated with it.

Default: null.

ibanMessage String

The default message supplied when the value does not pass the combined BIC/IBAN check.

Default: "This Business Identifier Code (BIC) is not associated with IBAN %%iban%%."

You can use the following parameters in this message:

Parameter Description
%%iban%% The current IBAN value

lang String inherited

Language of error messages.

message String

The default message supplied when the value does not pass the BIC check.

Default: "This is not a valid Business Identifier Code (BIC)."

You can use the following parameters in this message:

Parameter Description
%%value%% The current (invalid) BIC value

Methods

errors ()sogv.Error inherited

Return error errors

Returns:
Type Description
sogv.Error Error messages

isValid ()Boolean inherited overrides

Check if data valid.

Returns:
Type Description
Boolean Validation status