easy_stripe_payment 3.0.3
easy_stripe_payment: ^3.0.3 copied to clipboard
A Flutter package that provides simple and ready stripe payment method.
example/main.dart
import 'package:flutter/material.dart';
import 'package:easy_stripe_payment/easy_stripe_payment.dart';
String publishKey = your_publishable_key;
String secretKey = your_secret_key;
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await EasyStripePayment.instance
.init(secretKey: secretKey, publishKey: publishKey);
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text("Easy Stripe Payment Example")),
body: Center(
child: ElevatedButton(
onPressed: () async {
//call the EasyStripePayment and create instance
// sent your data and simply will get the result true or issue
await EasyStripePayment.instance
.makePayment(amount: 50, currency: "eur")
.then((value) {
value.fold((fail) {
//TODO: DO SOMETHING
}, (success) {
//TODO: DO SOMETHING
});
});
},
child: Text("Pay Now"),
),
),
),
);
}
}