Flutter Stripe SDK


A native dart package for Stripe. There are various other flutter plugins that wrap existing Stripe libraries, but this package uses a different approach. It does not wrap existing Stripe libraries, but instead accesses the Stripe API directly.

See examples for additional short examples.

See github.com/ezet/glappen-client for a complete example using this library. See github.com/ezet/glappen-firebase-api for a complete example of a supporting backend, using Firebase Functions.


  • Supports all types of SCA, including 3DS, 3DS2, BankID and others.
  • Handle payments with complete SCA support.
  • Add, remove and update payment methods, sources and cards, optionally with SCA.
  • Manage customer information.
  • Create all types of Stripe tokens.
  • Forms, widgets and utilities to use directly, or create your own UI!

Supported APIs

  • PaymentIntent, with SCA
  • SetupIntent, with SCA
  • PaymentMethod
  • Customer
  • Cards
  • Sources
  • Tokens

Planned features

  • Add additional UI widgets
  • Support for additional APIs
  • Offer complete UI flow for adding payment method
  • Offer complete UI flow for checkout


  • The return type for each function is Future<Map<String, dynamic>>, where the value depends on the stripe API version.

The library has three classes to access the Stripe API:

  • Stripe for generic, non-customer specific APIs, using publishable keys.
  • CustomerSession for customer-specific APIs, using stripe ephemeral keys.
  • StripeApi enables raw REST calls against the Stripe API.


Aims to provide high-level functionality similar to the official mobile Stripe SDKs.


Requires a Stripe ephemeral key.

Provides functionality similar to CustomerSession in the Stripe Android SDK.


Provides basic low-level methods to access the Stripe REST API.

  • Limited to the APIs that can be used with a public key or ephemeral key.
  • Library methods map to a Stripe API call with the same name.
  • Additional parameters can be provided as an optional argument.

Stripe and CustomerSession use this internally.


All classes offer a singleton instance that can be initated by calling the init(...) methods and then accessed through .instance. Regular instances can also be created using the constructor, which allows them to be managed by e.g. dependency injection instead.


// or, to manage your own instances
final stripe = Stripe("pk_xxx);


CustomerSession.init((apiVersion) => server.getEphemeralKeyFromServer(apiVersion));
// or, to manage your own instances
final session = CustomerSession((apiVersion) => server.getEphemeralKeyFromServer(apiVersion))


// or, to manage your own instances
final stripeApi = StripeApi("pk_xxx);


Use CardForm to add or edit credit card details, or build your own form using the pre-built FormFields.

final formKey = GlobalKey<FormState>();
final card = StripeCard();

final form = CardForm(card:card, formKey: formKey);
onPressed: () async {
                if (formKey.currentState.validate()) {


The library offers complete support for SCA on iOS and Android. It handles all types of SCA, including 3DS, 3DS2, BankID and others. It handles SCA by launching the authentication flow in a web browser, and returns the result to the app. The returnUrlForSca parameter must match the configuration of your AndroidManifest.xml and Info.plist as shown in the next steps.

Stripe.init("pk_xxx", returnUrlForSca: "stripesdk://3ds.stripesdk.io");
final clientSecret = await server.createPaymentIntent(Stripe.instance.getReturnUrlForSca());
final paymentIntent = await Stripe.instance.confirmPayment(clientSecret, "pm_card_visa");


You need to declare the following intent filter in android/app/src/main/AndroidManifest.xml. This example is for the url stripesdk://3ds.stripesdk.io:

<manifest ...>
  <!-- ... other tags -->
  <application ...>
    <activity ...>
      <!-- When the launchMode key is set to "singleTask" Android will use the existing instance if possible or open a new one when needed.
      This fixes the problem that the app will not restart if Firefox was used for the authorization process. -->
      <!-- ... other tags -->

      <!-- Deep Links -->
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
          android:host="3ds.stripesdk.io" />


For iOS you need to declare the scheme in ios/Runner/Info.plist (or through Xcode's Target Info editor, under URL Types). This example is for the url stripesdk://3ds.stripesdk.io:

<!-- ... other tags -->
    <!-- ... other tags -->
    <!-- ... other tags -->