public class Payments
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static int |
calculateMod97(java.lang.String reference)
Calculate the reference's modulo 97 checksum according to ISO11649 and IBAN standard.
|
static java.lang.String |
createISO11649Reference(java.lang.String rawReference)
Creates a ISO11649 creditor reference from a raw string by prefixing the string with "RF"
and the modulo 97 checksum.
|
static java.lang.String |
formatIBAN(java.lang.String iban)
Formats a IBAN or creditor reference by inserting spaces.
|
static java.lang.String |
formatQRReferenceNumber(java.lang.String refNo)
Formats a QR reference number by inserted spaces.
|
static boolean |
isValidIBAN(java.lang.String iban)
Validates if the string is a valid IBAN number
All whitespace must have been removed before the
the validation is performed.
|
static boolean |
isValidISO11649ReferenceNo(java.lang.String referenceNo)
Validates if the string is a valid ISO 11649 reference number.
|
static boolean |
isValidQRReferenceNo(java.lang.String referenceNo)
Validates if the string is a valid QR reference number.
|
public static boolean isValidIBAN(java.lang.String iban)
All whitespace must have been removed before the the validation is performed.
The string is checked for valid characters, valid length and for a valid check digit.
iban - IBAN to validatetrue if the IBAN is valid, false otherwisepublic static java.lang.String formatIBAN(java.lang.String iban)
Spaces are inserted to form groups of 4 letters/digits. If a group of less than 4 letters/digits is needed, it appears at the end.
iban - IBAN or creditor reference without white spacepublic static boolean isValidISO11649ReferenceNo(java.lang.String referenceNo)
All whitespace must have been removed before the the validation is performed.
The string is checked for valid characters, valid length and a valid check digit.
referenceNo - ISO 11649 creditor reference to validatetrue if the creditor reference is valid, false otherwisepublic static java.lang.String createISO11649Reference(java.lang.String rawReference)
Whitespace is removed from the reference
rawReference - The raw stringjava.lang.IllegalArgumentException - if rawReference contains invalid characterspublic static int calculateMod97(java.lang.String reference)
The string may only contains digits and letters (A to Z, no accents)
reference - the referencejava.lang.IllegalArgumentException - thrown if the reference contains an invalid characterpublic static boolean isValidQRReferenceNo(java.lang.String referenceNo)
A valid QR reference is a valid ISR reference number.
All whitespace must have been removed before the the validation is performed.
The string is checked for valid characters, valid length and a valid check digit.
referenceNo - QR reference number to validatetrue if the reference number is valid, false otherwisepublic static java.lang.String formatQRReferenceNumber(java.lang.String refNo)
Spaces are inserted to create groups of 5 digits. If a group of less than 5 digits is needed, it appears at the start of the formatted reference number.
refNo - reference number without white space