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
Field | Notes | Required? |
---|---|---|
Title | The name of the check digit to be saved. Only used to identify the check digit, and can contain any characters or spaces. | ✅ |
Allow alphas | Whether to allow alphabetic characters in reference numbers. | ✅ |
Case sensitive | Whether the reference number is case sensitive, i.e. should 'A' and 'a' be treated differently? | ✅ |
Mask | This is the format of the reference number. A asterisk (*) denotes the check digit character, and a hash (#) denotes any allowed character. | ✅ |
Substitutes | A 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). | |
Weightings | A 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. | |
Modulus | A number by which to divide the addition of all digits. The remainder of the this is then taken forward in the calculation. | ✅ |
Subtract from | A number to subtract the result of the modulus operation from to give the expected check digit | ✅ |
Check digit remap | A 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.
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.