stripe_sdk 1.0.0 stripe_sdk: ^1.0.0 copied to clipboard
A simple and flexible Stripe API client with complete support for SCA and PSD2.
import 'dart:async';
import 'package:stripe_sdk/stripe_sdk.dart';
const publishableKey = "my-key";
stripe() async {
Stripe.init(publishableKey);
// See Stripe API documentation for details
final cardData = {};
await Stripe.instance.createPaymentMethod(cardData);
}
session() {
CustomerSession.initCustomerSession(
(apiVersion) => fetchEphemeralKeyFromMyServer(apiVersion));
CustomerSession.instance.listPaymentMethods();
}
Future<String> fetchEphemeralKeyFromMyServer(String apiVersion) {
// Send the apiVersion to your server, create the key and return the raw http body.
return Future.value("Return raw response data");
}