BPayCRN()
Calculate a BPay compatible customer reference number.
Syntax
BPayCRN(cRef) --> cBPayCRNReference
Arguments
<cRef> --> The customer reference number.
Returns
The customer reference number including check digit.
Description
This is a special purpose function that accepts a reference, such as an invoice number, and returns a BPay compatible customer reference number.
Customer Reference Numbers (CRN's) must pass certain validation rules. These include:
The CRN must be numeric up to the first space character.
The remainder of the CRN, after the first space character, must continue to be a space character.
The numeric part of the CRN must not be zero.
The check digit calculation service uses the Standard Luhns Modulus 10 routine, also known as MOD10 Version 1.
For the reasons stated above, leading spaces in front of the CRN will be ignored (stripped away). If necessary, the CRN may be padded with zeros instead of spaces.
Example
This example script retrieves the invoice/transaction number on an invoice form, converts it to a normal transaction number, and then converts this transaction number into a BPAY CRN.
Declare BPayNo Type Character
* Retrieve the transaction number
BPayNo := Dictionary('Invoiceno')
* Translate the transaction number into
* a normal number. E.g., 000010006 --> 10006
BPayNo := TranStr(BPayNo)
* Convert into a BPAY CRN
Return BPayCRN(BPayNo)
You
cannot use the BPayCRN() function with transaction numbers that begin with letters of the alphabet.
____________________________
Related Topics: