littlefish_payments_pos_fnb 9.0.8
littlefish_payments_pos_fnb: ^9.0.8 copied to clipboard
A Flutter package for the FNB POS integration and gateway implementation.
littlefish_payments_pos_fnb #
This package provides the FNB POS payment gateway integration for the Littlefish payments ecosystem.
Overview #
This package implements the POSPaymentGateway abstract class from the littlefish_payments package and provides a concrete implementation for interacting with the FNB POS terminals via an FNB API which lives within the FNB POS application on the device. Since the FNB API is hosted locally on the device itself, the base URL for making http requests is not static. Instead, the base URL is the local IP address of the device.
Example request URLs to the FNB API #
Please refer to the official FNB API documentation for more information on making http requests
- http://{{DEVICE_IP}}:50105/v1/services/tpiservice/transact
- http://{{DEVICE_IP}}:50105/v2/services/tpiservice/merchant
Note, since the POS device itself is hosting the API, if you are making the http requests on the FNB POS device you wish to execute the request (e.g. transaction, get merchant info, etc.) then the {{DEVICE_IP}} will be localhost, i.e. '127.0.0.1'. If you are using this package or making requests from a different device, e.g. tablet or postman request to the FNB API so that a different FNB POS device executes the request, then you will need to set the {{DEVICE_IP}} to the ip address of the target device.
You can find the IP of the FNB POS device via the FNB POS application. Landing page --> Side drawer (burger icon on the top left) --> Merchant Admin --> Manage Device --> POS Mode Settings (then enter Supervisor password - refer to our Notion documentation).
This gateway implementation provides two constructors for initialising it:
/// Configures gateway and FNB POS service API for requests. /// Target device IP address is set to localhost, indicating that the FNB POS application is on the same machine. /// Use this constructor when requests are made on the same terminal that will be used to execute the requests. /// Requests are coming from the same POS terminal that will be used to execute the request. static Future
/// Configures gateway and FNB POS service API for requests. /// Target device IP address is configurable, indicating that the FNB POS application might not be on the same machine. /// Use this constructor when requests are made from a different terminal that will be used to execute the requests. /// e.g. Using a tablet to send requests to the FNB POS application running on a POS device. static Future
Example initialisations:
FnbPosPaymentGateway posPaymentGateway = await FnbPosPaymentGateway.createFromIp(package, '192.168.23.97');
FnbPosPaymentGateway posPaymentGateway = await FnbPosPaymentGateway.create(package);
Tips: #
- If you are remotely testing the FNB gateway, the device you use to make the request should be on the same wifi/hotspot network as the target FNB device
- When changing the wifi network on the FNB POS device, it can be helpful to redownload parameters so that it properly updates.