StripeApi class

Constructors

StripeApi(String publishableKey, {String apiVersion = defaultApiVersion, String? stripeAccount})
Create a new instance, which can be used with e.g. dependency injection. Throws a Exception if an invalid publishableKey has been submitted.

Properties

apiVersion String
final
hashCode int
The hash code for this object.
no setterinherited
publishableKey String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

confirmPaymentIntent(String clientSecret, {Map<String, dynamic>? data}) Future<Map<String, dynamic>>
Confirm a PaymentIntent https://stripe.com/docs/api/payment_intents/confirm
confirmSetupIntent(String clientSecret, {Map<String, dynamic>? data}) Future<Map<String, dynamic>>
Confirm a SetupIntent https://stripe.com/docs/api/setup_intents/confirm
createPaymentMethod(Map<String, dynamic> data) Future<Map<String, dynamic>>
Create a PaymentMethod. https://stripe.com/docs/api/payment_methods/create
createPaymentMethodFromCard(StripeCard card) Future<Map<String, dynamic>>
Create a PaymentMethod from a card. This will only create a PaymentMethod with the minimum required properties. To include additional properties such as billing details, use StripeCard.toPaymentMethod, add additional details and then use createPaymentMethod.
createSource(Map<String, dynamic> data) Future<Map<String, dynamic>>
Create a new Source object. https://stripe.com/docs/api/sources/create
createToken(Map<String, dynamic> data) Future<Map<String, dynamic>>
Create a stripe Token https://stripe.com/docs/api/tokens
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
retrievePaymentIntent(String clientSecret, {String? apiVersion}) Future<Map<String, dynamic>>
Retrieve a PaymentIntent. https://stripe.com/docs/api/payment_intents/retrieve
retrieveSetupIntent(String clientSecret, {String? apiVersion}) Future<Map<String, dynamic>>
Retrieve a SetupIntent. https://stripe.com/docs/api/setup_intents/retrieve
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance StripeApi
Access the singleton instance of StripeApi. Throws an Exception if StripeApi.init hasn't been called previously.
no setter

Static Methods

init(String publishableKey, {String apiVersion = defaultApiVersion, String? stripeAccount}) → void
Initialize the managed singleton instance of StripeApi. Afterwards you can use StripeApi.instance to access the created instance.