Unofficial eSewa SDK for Flutter apps to pay with eSewa.
- Pay with eSewa
This app depends on flutter_inappwebview
plugin. So, you need configure following things.
- Dart sdk: ">=2.15.0 <4.0.0"
- Flutter: ">=3.0.0"
- Android:
minSdkVersion 19
and add support forandroidx
(see AndroidX Migration to migrate an existing app) - iOS 9.0+:
--ios-language swift
, Xcode version>= 14.3
- MacOS 10.11+: Xcode version
>= 14.3
Add esewa
as a dependency in your pubspec.yaml file.
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');
}
},
),
),
);