Payments2Us ManualsPayments2Us User Manual BPAYHow to Setup BPAY Customer Reference Numbers

How to Setup BPAY Customer Reference Numbers

1. Customer Reference Number overview

A BPAY Customer Reference Number (CRN) is a number assigned by your organisation to identify your customer or service.

A Customer Reference Number can be setup the following areas:

  • Contact record.  Used by that individual payer to make payments.
  • Payment Txn record.  Assigned on checkout when a payer nominates to pay via BPAY.  Or, this can be used when invoicing/charging for a service that can vary for each Contact.
  • On any custom object.  The CRN number can be assigned here and later placed onto the Payment Txn record by using workflow or process builder.  

A CRN can be generated in Salesforce when a record is saved, by using Process Builder to generate and assign or by using an external tool to generate an load.

2. Generating CRNs Options

2.1. Externally generate CRNs

Biller Codes or Customer Reference Numbers (CRN) can be generated by programs downloaded from your bank. For more information go to the BPAY help page.

After generating, use data loader or similar to update the Customer Reference Number field on the Contact or Payment Txn record.

2.2. Generating a CRN when saving a record

For this option, you will need a License key to enter against the merchant facility.  Contact support @ for a BPAY CRN license key.

On the Contact or Payment Txn record enter or use Workflow fieldupdates/Process Builder to assign:

  1. A membership number.  This is a number that does not have the CRN check digit on it.
  2. Select "Generate MOD10V01".  This will be updated to "MOD10V01" on save.  It is the algorithm used to generate the CRN from the membership no.

On Save, the Customer Reference Number (3) is generated and assigned to the record.

Note: this might take a second or so to assign and a refresh of your page layout may be required to see the generated CRN.

2.3. Using Process Builder to Generate and Assign CRNs

For this option, you will need a License key to enter against the merchant facility.  Contact support @ for a BPAY CRN license key.

For assistance on this option over and above what is shown in this user guide will require Payments2Us Premium Support.

The BPAY CRN License key is available to organisations that are going to generate less than 1,000 CRNs per month.  If you need to generate more, you'll need to arrange your own API details with BPAY.  See BPAY API fees.

The Process Builder option provides the most flexibility for generating a CRN from any field and assigning the generated CRN number to any field on any object.

The example below generates and assigns a CRN to a Payment Txn record if it is missing a Customer Reference Number.

Create a New Process Builder (setup - Search "Process Builder", Click "New" button"

  • Enter Name, for example "BPAY CRN Generation"
  • Process Starts When "A record changes".
  • Press "SAVE"

Add Object

  • Select Object "Payment Txn"
  • Select "when a record is created or edited"
  • Press "SAVE"

Add Criteria

  • Name "When missing CRN"
  • Criteria "Customer Reference No."  Is null Equals True

2.3.1. Select Action Apex Class

Select Action Apex Class.

  • Enter in a name.  For example "Generate BPAY CRN".
  • For the Apex Class name, start typing "Payments2Us" and then select "Payments2Us Generate BPay CRNs" (1).
  • For the next step of assigning Apex Variables, click the "+ Add Row" (2).  (see more instructions following the screenshot)

2.3.2. Assign Apex Variables

Click the "+ Add Row"  to enter apex variables.

  1. SObject API Name - [STRING] the Object's API name, e.g. "AAkPay__Payment_Txn__c"
  2. SObject Record Id - [FIELD REFERENCE] the reference to the record id of the Object being updated, e.g. []
  3. BPAY CRN Rule Field API Name - [STRING]  the field's API Name on the SObject that contains the check digit rule value.  Values currently are "MOD10V01Generate" or "MOD10V01".  An example field name is "AAkPay__BPAY_CRN_Rule__c"
  4. Customer No Field API Name - [STRING] the field's API Name on the SObject that contains the customer number without the BPAY CRN check digit, e.g. AAkPay__Membership_Id__c
  5. Customer Reference Field API Name - [STRING] the field's API Name on the SObject that will be assigned the newly generated CRN No. E.g.  AAKPay__Biller_Code__c.

2.4. BPAY CRN Frequently asked questions

2.4.1. What is the length of the CRN

The CRN is generally one character longer than the number you start from. The customer number that you start from is configurable as per the above options.

Generally speaking though, many organisations will use a number based off the Payment Txn or Membership number assigned.  This is 10 digits, plus the 1 check digit - I.e. 11 characters long.

2.4.2. For Process Builder option, do we need to populate the fields “BPAY API Key” and “BPAY API Secret”

If you are generating less than 1000 CRN's a month then you can leave these fields blank.  If generating more than this, then you'll need to setup your own BPAY key at:

2.4.3. For Process Builder option, do I set a default value for the field “BPAY CRN Rule” or should I leave it blank

If you leave this blank, the default of MOD10V01 will be used.