QR code is used to simplify intrabank transfers (aka transfers between SaFi accounts).
The related functionality consists of 2 parts:
Generating the beneficiary QR code, to be presented to the sender.
Scanning the beneficiary QR code to fill in the required data for sender.
Generating the QR code
The QR code is generated according to the following algorithm.
We fetch the
account number
anduser name
bycustomer id
from local Hive database or hitting the endpoint/v2/main-account/by-customer/$customerId
Use the fetched values to generate the custom URL of type
safi://v2/<payload>
, wherepayload
is generated as follows:generate
salt
as a random letters-only string, consisting of 6 letters;we make a string of
/<account_number>/<beneficiary_name>/<salt>
use AES algorithm to encrypt the string from step b and pass it as a payload.
create a QR code from the final URL
safi://v2/<payload>
For more details on encryption/decryption, please check the QrCodeEncrypter class.
The entry point for the QR code generation is account details.
Scanning the QR code
The user can scan the QR code, provided by the beneficiary, to autofill the name and account number while conducting the intrabank transfer.
Here’s what’s happening under the hood:
The app scans the QR code, gets the URL in the format
safi://v2/<payload>
.QrCodeEncrypter decrypts the payload and extracts the
account number
anduser name
from it.Extracted values auto populate corresponding text inputs, tab is switched to
Account number
.User can proceed with the rest of the intrabank flow.