Updated 30 June 2023
Hello all!! In this blog we will Integrate Fastpay Payment Gateway using SDK in Flutter.
As we know that payment gateway integration is very important in any e-commerce application for making payments.
In any flutter application, we can integrate payment gateway using two ways i.e. using SDK and using Webview.
Here we will integrate using flutter SDK.We have a flutter package which we will use for the implementation.
Transform your app idea into reality with our Flutter app development services.
So,Without wasting time let’s begin the code implementation.
Add the following dependancy in your pubspec.yaml file.
1 |
fastpay_iraq: ^1.0.2 |
After adding the dependancy, run the flutter pub get command.After getting 0 code from flutter pub get command we can proceed for
Now ,add the following code for payment before placing any order.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
_fastPayment() async { FastpayResult _fastpayResult = await FastPayRequest( storeID: "********", storePassword: "********", amount: "1000", orderID: "HBBS7657", isProduction: false, ); if (_fastpayResult?.isSuccess ?? false) { //Handle transaction success case here print('transaction success'); } else { //Handle transaction failure case here print('transaction fail'); } } |
In the above code snippet,we have the fastpayResult object in which we will get the output from payment SDK .
We need to handle both the case i.e.success as well as failure.After getting from SDK we can go on homepage or order successful screen.
In the case of failure we can move to the cart screen back and show message to user that:Payment has been failed”.
You can check in the output images that we are navigating on Fastpay SDK.And then filling the required details we are proceeding for payment.
After making payment we need to manage our success case.
Now we are done with Integrate Fastpay Payment Gateway using SDK in Flutter.It will be very beneficial when we will integrate Fastpay payment gateway in our flutter application.
Congratulations!!!! We have integrate Fastpay Payment Gateway using SDK in Flutter
For more interesting blogs check out here – https://mobikul.com/blog/
Thanks for reading.😇
If I missed something 🙈, then please let me know in the comments. I would like to improve.
If you have more details or questions, you can reply to the received confirmation email.
Back to Home
Be the first to comment.