Class Payments
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateISO11649Reference(String rawReference) Creates a ISO11649 creditor reference from a raw string by prefixing the string with "RF" and the modulo 97 checksum.static StringcreateQRReference(String rawReference) Creates a QR reference from a raw string by appending the checksum digit and prepending zeros to make it the correct length.static StringformatIBAN(String iban) Formats an IBAN or creditor reference by inserting spaces.static StringformatQRReferenceNumber(String refNo) Formats a QR reference number by inserting spaces.static booleanIndicates if the string is a valid QR-IBAN.static booleanisValidIBAN(String iban) Validates if the string is a valid IBAN numberstatic booleanisValidISO11649Reference(String reference) Validates if the string is a valid ISO 11649 reference number.static booleanisValidQRReference(String reference) Validates if the string is a valid QR reference.
-
Method Details
-
isValidIBAN
Validates if the string is a valid IBAN numberThe string is checked for valid characters, valid length and for a valid check digit. White space is ignored.
- Parameters:
iban- IBAN to validate- Returns:
trueif the IBAN is valid,falseotherwise
-
isQRIBAN
Indicates if the string is a valid QR-IBAN.QR-IBANs are IBANs with an institution ID in the range 30000 to 31999 and a country code for Switzerland or Liechtenstein. Thus, they must have the format "CH..30...", "CH..31...", "LI..30..." or "LI..31...".
- Parameters:
iban- account number to check- Returns:
truefor valid QR-IBANs,falseotherwise
-
formatIBAN
Formats an IBAN or creditor reference by inserting spaces.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.
- Parameters:
iban- IBAN or creditor reference without spaces- Returns:
- formatted IBAN or creditor reference
-
isValidISO11649Reference
Validates if the string is a valid ISO 11649 reference number.The string is checked for valid characters, valid length and a valid check digit. White space is ignored.
- Parameters:
reference- ISO 11649 creditor reference to validate- Returns:
trueif the creditor reference is valid,falseotherwise
-
createISO11649Reference
Creates a ISO11649 creditor reference from a raw string by prefixing the string with "RF" and the modulo 97 checksum.Whitespace is removed from the reference
- Parameters:
rawReference- The raw string- Returns:
- ISO11649 creditor reference
- Throws:
IllegalArgumentException- ifrawReferencecontains invalid characters
-
isValidQRReference
Validates if the string is a valid QR reference.A valid QR reference is a valid ISR reference.
The string is checked for valid characters, valid length and a valid check digit. White space is ignored.
- Parameters:
reference- QR reference number to validate- Returns:
trueif the reference number is valid,falseotherwise
-
createQRReference
Creates a QR reference from a raw string by appending the checksum digit and prepending zeros to make it the correct length.Whitespace is removed from the reference
- Parameters:
rawReference- The raw string (digits and whitespace only)- Returns:
- QR reference
- Throws:
IllegalArgumentException- ifrawReferencecontains invalid characters
-
formatQRReferenceNumber
Formats a QR reference number by inserting spaces.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.
- Parameters:
refNo- reference number without white space- Returns:
- formatted reference number
-