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?
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!
During the Flutter live, they have announced Payment integration for the flutter App.You can find the sdk from the below given link. All documentation are available on that website.
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
go to https://pub.dartlang.org/flutter and search wih the word 'payment' you'll see results like Paystack
and Stripe
it's just a matter of time and every Payment Gateway should provide its own official plugin for Flutter
来源:https://stackoverflow.com/questions/49022222/payment-gateway-for-flutter