How can I integrate a payment gateway in flutter framework. Is there any libraries I can use readily? Do I need to do it separately in iOS and Android? In that case which is the best library available in India? Check out the new package for making payment https://pub.dev/packages/flutter_paystack
-
My client suggest me this website instamojo.com ,and I have seen a video for android implementation, its called Instamojo,in this youtube.com/watch?v=2x6xlnYnHjc ....A guy just installs and EXE and that adds extra lines in gradle automatically,so i hope if i Choose flutterprojectfolder/android then it will add the same magic for flutter too,but not yet tried, if my perception is wrong then pls anyboy tell,how to get a raw Android folder(As like Native flutter) Folder, from a flutter folder– Rajesh Jr.Jul 20, 2018 at 18:19
-
Razorpay has released a fluttter package for their payment services. github.com/razorpay/razorpay-flutter– Akas AntonyOct 15, 2019 at 8:20
2 Answers
There are no payment plugins for flutter yet.
To integrate payments into a flutter app, just integrate payments natively and invoke it by implementing a platform channel.
An example of platform channel implementation is shown here.
Hope that helped!
-
Hi Ambareesh, in our app we have integrated upi payments but only received success messages in to flutter app if the payments are done through tez/bhim or paytm but not the other types of upi payments like phonepe etc. Well we have done exactly what Hemanth suggested– MahiMar 2, 2018 at 7:45
-
1This answer needs some updating because nowadays there are some pay plugins available in 2021: pub.dev/packages/pay and pub.dev/packages/flutter_stripe .– remonh87Nov 24, 2021 at 8:11
-
We have open source the juspay-flutter sdk We use it in production -github.com/deep-rooted-co/juspay_flutter– SrikanthDec 27, 2021 at 8:54
I was able to integrate stripe using webview & flutter_webview_plugin
String test = "Test Charge";
int amount = 100;
@override
Widget build(BuildContext context) {
return new MaterialApp(
home: new WebviewScaffold(
url: new Uri.dataFromString('''
<html>
<head>
<meta name="viewport" content="width=device-width">
</head>
<center>
<body>
<form action="Your Server" method="POST">
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_key"
data-amount="$amount"
data-name="$test"
data-description="My Order"
data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
data-locale="auto"
data-currency="eur">
</script>
</form>
</body>
</center>
</html>
''', mimeType: 'text/html').toString(),
));
}
you'll need to set up a server for live payments. More info can be found: https://stripe.com/docs/checkout#integration-simple
-
Does this work on iOS for you? As far as I know iOS webview doesn't support keyboard so far. Feb 13, 2020 at 11:18
-
1Hi, could you help me, I am stuck in an issue related to your answer, @JAAYBone– satishMay 17, 2020 at 14:08
-