Class Payments
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
createISO11649Reference
(String rawReference) Creates a ISO11649 creditor reference from a raw string by prefixing the string with "RF" and the modulo 97 checksum.static String
createQRReference
(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 String
formatIBAN
(String iban) Formats an IBAN or creditor reference by inserting spaces.static String
formatQRReferenceNumber
(String refNo) Formats a QR reference number by inserting spaces.static boolean
Indicates if the string is a valid QR-IBAN.static boolean
isValidIBAN
(String iban) Validates if the string is a valid IBAN numberstatic boolean
isValidISO11649Reference
(String reference) Validates if the string is a valid ISO 11649 reference number.static boolean
isValidQRReference
(String reference) Validates if the string is a valid QR reference.static boolean
isValidText
(String text, SPSCharacterSet characterSet) Indicates if the text consists only of characters allowed in the specified character set.
-
Method Details
-
isValidText
Indicates if the text consists only of characters allowed in the specified character set.This method does not attempt to deal with accents and umlauts built from two code points. It will return
false
if the text contains such characters.- Parameters:
text
- text to check, possiblynull
characterSet
- character set specifying valid characters- Returns:
true
if the text is valid,false
otherwise
-
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:
true
if the IBAN is valid,false
otherwise
-
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:
true
for valid QR-IBANs,false
otherwise
-
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:
true
if the creditor reference is valid,false
otherwise
-
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
- ifrawReference
contains 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:
true
if the reference number is valid,false
otherwise
-
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
- ifrawReference
contains 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
-