init static method

void init(
  1. String publishableKey, {
  2. String? stripeAccount,
})

Initializes the singleton instance of Stripe. Afterwards you can use Stripe.instance to access the created instance.

publishableKey is your publishable key, beginning with "pk_". Your can copy your key from https://dashboard.stripe.com/account/apikeys

stripeAccount is the id of a stripe customer and stats with "cus_". This is a optional parameter.

returnUrlForSca should be used to specify a unique return url for Strong Customer Authentication (SCA) such as 3DS, 3DS2, BankID and others. It is required to use your own app specific url scheme and host. This parameter must match your "android/app/src/main/AndroidManifest.xml" and "ios/Runner/Info.plist" configuration.

Implementation

static void init(String publishableKey, {String? stripeAccount}) {
  _instance = Stripe(publishableKey, stripeAccount: stripeAccount);
  StripeApi.init(publishableKey, stripeAccount: stripeAccount);
}