Skip to main content

Check digits

When creating a card service, you can optionally choose to link it to a check digit routine. This enforces that the reference number for the payment matches the format you specify, and that it has a correct check digit.

Check digits fields

Check digit form

FieldNotesRequired?
TitleThe name of the check digit to be saved. Only used to identify the check digit, and can contain any characters or spaces.
Allow alphasWhether to allow alphabetic characters in reference numbers.
Case sensitiveWhether the reference number is case sensitive, i.e. should 'A' and 'a' be treated differently?
MaskThis is the format of the reference number. A asterisk (*) denotes the check digit character, and a hash (#) denotes any allowed character.
SubstitutesA comma-separated list of values to substitute, e.g. A:1,B:2 (where any 'A' characters are substituted for 1, and any 'B's for 2).
WeightingsA comma-separated list of values the same length as the reference number, where each character in the reference number is multiplied by the corresponding value in this list.
ModulusA number by which to divide the addition of all digits. The remainder of the this is then taken forward in the calculation.
Subtract fromA number to subtract the result of the modulus operation from to give the expected check digit
Check digit remapA comma-separated list of values to substitute, e.g. 95:5,96:6 (where a result of 95 becomes a check digit of 5, and a result of 96 becomes a check digit of 5).

Testing a check digit

To test a check digit calculation, click the Test Check Digit button at the bottom of the page. This will open a popover which asks for a test reference number.

Test modal

Provide a reference number and click Test. The popover will show whether the reference passes the check digit test or not, with step-by-step analysis of the calculations carried out.