stripe_plugin 0.0.5 stripe_plugin: ^0.0.5 copied to clipboard
A new flutter plugin project.
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:stripe_plugin/stripe_plugin.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: MaterialButton(
onPressed: () async {
try {
var stripeId = await StripePlugin.openBasicPayment(
StripeReq(
stripeKey: "", //stripe token
backendBaseURL: "", // client secret full url
appleMerchantID: "",
// ephemeralKey: {}, // emphemeral response
orderId: "", // Order id fro client secret
authToken: ""),
);
} catch (error) {
print(error);
}
},
child: Text('payment'),
),
),
),
);
}
}