moncash_flutter

Last updated:

0 purchases

moncash_flutter Image
moncash_flutter Images
Add to Cart

Description:

moncash flutter

Flutter Moncash Payment Plugin













A flutter plugin for moncash integration for Android and Ios.
If you use this library in your app, please let me know and I'll add it to the list.





Installing #
Add this in pubspec.yaml
moncash_flutter:
copied to clipboard
Using #
import 'package:moncash_flutter/moncash_flutter.dart';
copied to clipboard
WidgetsBinding.instance!.addPostFrameCallback((_) async {
PaymentResponse? data = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MonCashPayment(
isStaging: true,
amount: Amount,
clientId: "Id",
clientSecret: clientSecret,
loadingWidget: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
LoadingScreen(color: Colors.white),
Text("Redirecting to payment gateway..."),
],
),
)),
);
if (data != null && data.status == paymentStatus.success && data.transanctionId != null) {
setState(() {
paymentSuccess = true;
});
placeOrder(transanctionId: data.transanctionId, orderId: data.orderId);
} else {
if (data == null) {
showErrorDialog(context, "ERROR: Payment Failed");
} else {
showErrorDialog(context, "ERROR: ${data.message}");
}
setState(() {
isLoading = false;
paymentSuccess = false;
});
}
});

If payment is successful PaymentResponse will contain the transanctionId from moncash.
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.