init static method

void init(
  1. String publishableKey, {
  2. String apiVersion = defaultApiVersion,
  3. String? stripeAccount,
})

Initialize the managed singleton instance of StripeApi. Afterwards you can use StripeApi.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.

Implementation

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