stripe_plugin 0.0.3 stripe_plugin: ^0.0.3 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: "pk_test_0uVMBC6Im7TKjCuA47DP4dhn00ulPQWzXv",
backendBaseURL:
"http://192.168.0.126:8000/api/v1/payment/get-stripe-secret",
appleMerchantID: "",
ephemeralKey: {
"id": "ephkey_1FuWcPJe0stji195NcFKHCVX",
"object": "ephemeral_key",
"associated_objects": [
{"id": "cus_GRPR6GZOQY74fb", "type": "customer"}
],
"created": 1577506177,
"expires": 1577509777,
"livemode": false,
"secret":
"ek_test_YWNjdF8xRmNxYzlKZTBzdGppMTk1LFphRDFvVDJqMHhWZzVIVnVzejQ4Z0d5TXFlcERNMW0_00L8tdprHc"
},
orderId: "5e05a0579a185e491c2a3477",
authToken: ""),
);
} catch (error) {
print(error);
}
},
child: Text('payment'),
),
),
),
);
}
}