Assigning Mask to Payment System and Configuring Validation

Mask is a simple method of validating credit card numbers and bank account numbers. It is mandatory to assign a mask to payment systems that process credit card payments. If a mask is not assigned to a payment system, a customer is not allowed to register a credit card as a payment method. For example, MasterCard numbers are 16-digits long, first digit of those is always "5". The mask for MasterCard would be "5IIIIIIIIIIIIIII" indicating that the first digit is "5", and the following 15 characters can be any digit. Accordingly, the Visa mask would be "4IIIIIIIIIIIIIII" and the Amex mask is "3IIIIIIIIIIIIII". It is possible but hardly needed to set more than one mask per payment system. A credit card number will be considered valid, if it matches at least one mask of its system. Additionally, a credit card number can be validated with the Mod10 algorithm. It is designed to catch transposed digits or other typing errors.

How Validation Works

  • If no masks specified, all payment systems are considered as valid.
  • If at least one mask specified, only the payment system numbers that match the mask are considered as valid. Other ones are rejected.

    Note: Dots in a mask are ignored. If a payment method number contains dots, it does not matter whether a dotted number format is followed in a mask or not. Anyway, the number of I in a mask must be the same as number of digits in a payment method number.

  • A payment system to be validated using one of the algorithms, should first match the mask.

Payment systems that process bank payments do not require masks, but this operation is allowed. If no masks are specified for such payment system, any account number is considered as valid. If a mask is specified, an account number should match the mask.

Additionally, account numbers with 9 digits length can be validated with 11-Test algorithm. It is designed to verify whether submitted bank account is correct.

The 11-Test algorithm processes account numbers in the following way. Each digit of account number is multiplied by digit from 9 to 1 sequence. The result is summed up and divided by 11. If the result is a whole number an account number is considered as valid.

For example, bank account number is 11.32.54.105:

1 * 9

= 9

1 * 8

= 8

3 * 7

= 21

2 * 6

= 12

5 * 5

= 25

4 * 4

= 16

1 * 3

= 3

0 * 2

= 0

5 * 1

= 5

Sum

99

99 / 11

9

The result is 9, it is the whole number. The checked account number is valid.

For example, if you want to accept account numbers with 5 to 9 digits length only and check 9-digit account numbers with 11test algorithm, you should add several masks, see example below.

Example: How to validate 9-digit bank account number by 11test and treat 5-8 digit bank accounts as valid

Add the following 5 masks:

Mask: IIIII Validate by algorithm: None

Mask: IIIIII Validate by algorithm: None

Mask: IIIIIII Validate by algorithm: None

Mask: IIIIIIII Validate by algorithm: None

Mask: IIIIIIIII Validate by algorithm: 11-test

To assign a mask to a payment system:

  1. Open System > Settings > Payments Processing > Payment Systems. The list of available payment systems appears on the screen.
  2. Select the payment system you want to assign a mask to by clicking on the respective link in the Payment System or in the Logo column. Payment system settings appear on the screen.
  3. Switch to the Masks tab. The list of masks (if any) appears.
  4. Click Add New Mask. Fill the form that appears:
    • Enter the mask into the Mask field in exact format, as recommended at the beginning of this topic.
    • Select validation algorithm from the Validate by algorithm list: None if no further validation needed, only mask filters payment systems; Mod10 to check card numbers; 11-test to check bank accounts' numbers.
  5. Click Save to finish adding new mask.
CloudBlue, an Ingram Micro business, uses cookies to improve the usability of our site. By continuing to use this site and/or logging in you are accepting the use of these cookies. For more information, visit our Privacy Policy.