G2P Cash Transfer Bridge
Last updated
Last updated
Copyright © 2024 OpenG2P. This work is licensed under Creative Commons Attribution International LicenseCC-BY-4.0 unless otherwise noted.
The G2P Cash Transfer Bridge (GCTB) fits in the payment chain as shown below.
The module is envisaged to exist as an independent module in bridging the gap between a G2P system and a bank to initiate large-scale G2P cash transfers. Being specific to G2P transfers, (and not P2G, P2P, P2M, etc), the module promises to be low cost, simple in design, easy to install, and highly performant as real-time fast transfers are not a requirement in most social benefit transfer scenarios. However, the volume of transfers is expected to be large.
The module will support the following functionalities at a high level
Upstream interface layer compliant with G2P Connect or any other standard
Downstream interface layer to connect to bank with specific/proprietary interfaces
Query ID Account Mapper to fetch individual bank account information (optional)
History of past transactions
Reporting
This functional block receives cash transfer requests from upstream systems like OpenG2P via the G2P Connect Disbursement APIs. The block parses the incoming request and writes in the DB. The Disbursement API is assumed to be Synchronous such that after DB writes, 200 OK is returned to the caller. The disbursement request is expected to be split into batches by the upstream system depending on the system's optimum performance in terms of CPU and Memory.
When a Status API is called by the upstream system, this block reads the data from DB and returns the status of requested transactions. The output may need to be 'paginated' depending on the volume of data returned.
All the requests are persisted in a DB like Postgres along with the status of each transfer request. The DB has the following tables:
The table is expected to contain millions of records and a history of past transactions. Indexing of columns will be critical for performance. Besides, the previous records may be 'archived'. This could be achieved via horizontal partitioning. The management of DB in this regard needs to be worked out during implementation.
TODO - Describe what is a payment backend and what it does.
Currently available payment backends:
Simple Mpesa Payment Backend
Description - TODO
Mojaloop Payment Backend
Description - TODO
Configuration Guide - TODO Link
GCTB Kubernetes Deployment guide
GCTB Local Installation Guide - TODO
GCTB API Usage Guide - TODO: (Call Disburse API. Note down Txn ID. Call Disburse Status API with Txn ID)
Stoplight Link for G2P Cash Transfer Bridge.
Swagger UI using OpenAPI for GCTB.
Swagger UI for G2P-Connect Disbursement (which GCTB implements.)
Mapping of status codes returned by the bank and as expected by upstream G2P systems need to be worked out. At the moment, the following codes are defined by G2P Connect:
GCTB Source Code - https://github.com/OpenG2P/g2p-cash-transfer-bridge.
Column | Description |
---|---|
batch_id
ID of the requested batch
request_id
ID of the request (this may be assigned by the Disbursement Controller in case not available in the Disbursement request)
request_timestamp
from_fa
Financial Address of the sender. If there is only one sender, then this may be not be populated here, but configured in the system
to_fa
This may be an ID or contain account details (TBD)
amount
currency
status
Status of the request. This will be updated by multiple entities. The status enumeration may be NEW, FILED, PAID/FAILED
file
The file name in which the instruction has been written
error_code
Any error code if the status is FAILED. This will be used by the upsteam system to take necessary action like retry or giveup.
error_msg
Text error message