foree_checkout 0.0.5 foree_checkout: ^0.0.5 copied to clipboard
A new flutter plugin project.
Foree Checkout #
Package to use Foree Payment Gateway #
Usage #
To use this package in your code: #
First, add a dependency in your pubspec.yaml file. #
dependencies:
foree_checkout: <latest-version of package>
Requirements #
Dart sdk: ">=2.12.0-0 <3.0.0"
Flutter: ">=1.22.2"
Android: minSdkVersion 19 and add support for androidx (see AndroidX Migration to migrate an existing app)
iOS: --ios-language swift, Xcode version >= 12
add import in your dart code: #
import 'package:foree_checkout/foree_checkout.dart';
Sample Data: #
var data = {
'key': "<APIKEY>",
'amount': <AMOUNT>,
'create_bill': <true/false>,
'reference_number': "<ORDER_ID>",
'callback': myCallbackfunction,
'customer_email_address': "<EMAIL_ADDRESS>",
'customer_phone_number': "<PHONE_NUMBER>"
'token': "TOKEN",
'payment_method': "<PAYMENT_METHOD>",
'consumer_name': "<CONSUMER_NAME>",
'bill_detail_id': "<UUID>",
};
create_bill
takes true
or false
as the possible values. Pass true
in case you want to generate bill/invoice to be made with the given data. false
in case to pay generated bill/invoice with the given data.
Use Foree() function of our package(foree_checkout) and pass data. #
Foree.initiateCheckOut(
isTesting: true/false,
Data: data,
context: context,
callback: (args) {
print(args); //args contains the callback data
});
isTesting
takes true
or false
as the possible values. Pass true
for testing with your sandbox account. false
for your live business.
In case of payment success or failure, response is received in callback with the data in the following format #
Success data
{
bill_status: "paid"
initiator: "Foree Bill"
instrument_institution: "ABC Bank"
instrument_number: "01201234111222"
instrument_type: "bank_account"
message: "Your payment has been processed successfully"
paid_amount: 125.00
payment_channel: "Internet Banking"
reference_number: "50"
status: 1
transaction_date_time: "2021-01-20 18:32:52"
transaction_ref_id: "1611149880942"
}
Failure data
{
message: "Your payment could not be processed",
reference_number: "50",
status: "2"
}