esewa 1.0.0
esewa: ^1.0.0 copied to clipboard
A Flutter Package for eSewa Payment Gateway
Unofficial eSewa SDK for Flutter apps to pay with eSewa.
Features #
- Pay with eSewa
Getting started #
This app depends on InAppWebView
and flutter_inappwebview
plugin. So, you need configure following things.
Dart sdk: ">=2.14.0 <3.0.0" Flutter: ">=3.0.0" Android: minSdkVersion 17 and add support for androidx (see AndroidX Migration to migrate an existing app) iOS: --ios-language swift, Xcode version >= 14
Usage #
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PayWithEsewaScreen(
config: EsewaConfigModel.sandbox(
amount: 10,
taxAmount: 0,
successUrl: 'https://example.com/success',
failureUrl: 'https://example.com/failure',
productId: 'product_id',
),
onSuccess: (config, refId) {
if (kDebugMode) {
print('Payment successful');
}
if (kDebugMode) {
print('RefId: $refId');
}
showSnackBar(context, 'Payment successful RefId: $refId');
},
onFailure: (errorMessage) {
Navigator.pop(context);
showSnackBar(context, errorMessage);
if (kDebugMode) {
print('Error: $errorMessage');
}
},
),
),
);