payable_ipg 1.0.1 payable_ipg: ^1.0.1 copied to clipboard
PAYable IPG
PAYable IPG SDK - Flutter Integration #
Flutter SDK - ipg.flutter.payable.lk | Create Issue
Initialization #
- Change the
minSdkVersion
as below from your app levelbuild.gradle
file.
android {
defaultConfig {
minSdkVersion 20
}
}
- Add the below package into your
pubspec.yaml
file.
payable_ipg: ^1.0.1
Implementation #
1. Import PAYable IPG SDK package.
import 'package:payable_ipg/payable_ipg.dart';
2. Create PAYable IPG client with
PAYableIPGClient ipgClient = PAYableIPGClient(
merchantKey: "A75BCD8EF30E529A",
merchantToken: "B8727C74D29E210F9A297B65690C0140",
refererUrl: "https://www.sandboxmerdev.payable.lk",
logoUrl: "https://bizenglish.adaderana.lk/wp-content/uploads/NOLIMIT-logo.jpg",
environment: IPGEnvironment.sandbox,
);
3. Call PAYableIPG
into your application body.
PAYableIPG(
ipgClient: ipgClient,
amount: 100.45,
currencyCode: "LKR",
orderDescription: "Netflix",
customerFirstName: "Aslam",
customerLastName: "Anver",
customerEmail: "aslam@payable.lk",
customerMobilePhone: "0762724081",
billingAddressStreet: "String",
billingAddressCity: "Hill Street",
billingAddressCountry: "LK",
billingAddressPostcodeZip: "10350",
billingAddressStateProvince: "Western",
shippingContactFirstName: "Aslam",
shippingContactLastName: "Anver",
shippingContactEmail: "aslam@payable.lk",
shippingContactMobilePhone: "0762724081",
shippingAddressStreet: "Hill Street",
shippingAddressCity: "Dehiwala",
shippingAddressCountry: "LK",
shippingAddressPostcodeZip: "10350",
shippingAddressStateProvince: "Western",
notificationUrl: "https://us-central1-payable-mobile.cloudfunctions.net/ipg/request-test",
onPaymentCompleted: (data) {
print("onPaymentCompleted: $data");
},
onPaymentCancelled: () {
print("onPaymentCancelled");
},
onPaymentError: (data) {
print("onPaymentError: $data");
},
)
- Optional parameters
payableSale.setReceiptEmail("test@payable.lk");
payableSale.setReceiptSMS("0110000000");
payableSale.setOrderTracking("invoice56");
payableSale.setTerminalId("1254");
Advanced Usage #
PAYable events
Method | Callback |
---|---|
boolean requestProfileList() |
onProfileList(List<PayableProfile> payableProfiles) |
boolean requestVoid(String txId) |
onVoid(PayableResponse payableResponse) |
PayableProfile
String tid;
String name;
String currency;
Integer installment;
PAYableResponse
int status;
String txId;
String error;
Example Usage
import 'package:flutter/material.dart';
import 'package:payable_ipg/payable_ipg.dart';
void main() {
PAYableIPGClient ipgClient = PAYableIPGClient(
merchantKey: "A75BCD8EF30E529A",
merchantToken: "B8727C74D29E210F9A297B65690C0140",
refererUrl: "https://www.sandboxmerdev.payable.lk",
logoUrl: "https://bizenglish.adaderana.lk/wp-content/uploads/NOLIMIT-logo.jpg",
environment: IPGEnvironment.sandbox,
);
runApp(
MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text("PAYable IPG Demo"),
),
body: PAYableIPG(
ipgClient: ipgClient,
amount: 100.45,
currencyCode: "LKR",
orderDescription: "Netflix",
customerFirstName: "Aslam",
customerLastName: "Anver",
customerEmail: "aslam@payable.lk",
customerMobilePhone: "0762724081",
billingAddressStreet: "String",
billingAddressCity: "Hill Street",
billingAddressCountry: "LK",
billingAddressPostcodeZip: "10350",
billingAddressStateProvince: "Western",
shippingContactFirstName: "Aslam",
shippingContactLastName: "Anver",
shippingContactEmail: "aslam@payable.lk",
shippingContactMobilePhone: "0762724081",
shippingAddressStreet: "Hill Street",
shippingAddressCity: "Dehiwala",
shippingAddressCountry: "LK",
shippingAddressPostcodeZip: "10350",
shippingAddressStateProvince: "Western",
notificationUrl: "https://us-central1-payable-mobile.cloudfunctions.net/ipg/request-test",
onPaymentCompleted: (data) {
print("onPaymentCompleted: $data");
},
onPaymentCancelled: () {
print("onPaymentCancelled");
},
onPaymentError: (data) {
print("onPaymentError: $data");
},
),
),
),
);
}
PAYable IPG SDK - Flutter Integration