.isValidRF()

Method checks if the given text is a valid RF creditor reference code.

Description of the method

Description:

.isValidRF() method checks if the given text is a valid RF creditor reference code. Method checks that the value is in alphanumeric format and contains a maximum of 25 characters. RF Creditor Reference is based on ISO 11649. The method also checks the following:

  • The first two characters contains the identifier 'RF'
  • The next two characters contains the check digit
  • The rest of the characters contain alphanumeric characters forming the actual reference. 

In the reference section of RF, letters are converted into numbers and mod-97 operation is done to the reference in a numeric format. Result of this calculation will have to match the check digits indicated in position 3-4.

Available for: string
Parameters: -
Return type: boolean

 

Example

Context: TransactionType1
OCL: self.Amount.REF.isValidRF()
Description: The example rule checks if the given reference is valid.

 

The XML snippet below would pass this check.

<Amount>
    <REF>RF0243256126</REF>
</Amount>

The other snippet below however would not pass this check.

<Amount>
    <REF>AA123123</REF>
</Amount>