Search Documentation
Search across all documentation pages, APIs and guides.
Flutter Plugin Integration
Getting Started
Add the dependency in your pubspec.yaml:
dependencies:ipg_flutter: ^1.1.3
Usage
var ipg = Ipg.init(appToken: 'your_token',appId: 'your_app_id',firstName: 'John',lastName: 'Doe',email: 'john.doe@sample.com',phoneNumber: '0000000000',);// Start card addition flowipg.addNewCard(context);// Callback when card add flow completesipg.addCardEventCallback = (status, errorMessage) {print("Adding card result: $status - $errorMessage");};// Retrieve customer list (saved cards)ipg.getCustomers();// Callback when customers are retrievedipg.getCustomersEventCallback = (customerList, errorMessage) {print("Customers: $customerList");};// Make customer payment// Valid Currency codes: LKR, USDipg.makeCustomerPayment(amount, currencyCode, customerCardToken);// Listen to payment statusipg.customerPaymentEventCallback = (status, errorMessage ) {print("Payment Status: $status - $errorMessage");};
Android Setup
Since this package communicates with the internet, make sure you have added the following permission in your AndroidManifest.xml file:
<uses-permission android:name="android.permission.INTERNET" />
📦 Onepay Flutter Plugin Code Example
Clone the repo and run the example:
cd exampleflutter createflutter run
All Set! Your Flutter app is now ready to accept payments through Onepay.
On This Page