CustomerSession class

Inheritance

Properties

apiVersion String
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isDisposed bool
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
attachPaymentMethod(String? paymentMethodId) Future<Map<String, dynamic>>
Attach a PaymentMethod. https://stripe.com/docs/api/payment_methods/attach
attachSource(String sourceId) Future<Map<String, dynamic>>
Attaches a Source object to the Customer. The source must be in a chargeable or pending state. https://stripe.com/docs/api/sources/attach
detachPaymentMethod(String? paymentMethodId) Future<Map<String, dynamic>>
Detach a PaymentMethod. https://stripe.com/docs/api/payment_methods/detach
detachSource(String sourceId) Future<Map<String, dynamic>>
Detaches a Source object from a Customer. The status of a source is changed to consumed when it is detached and it can no longer be used to create a charge. https://stripe.com/docs/api/sources/detach
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
endSession() → void
End the managed singleton customer session. Call this when the current user logs out.
listPaymentMethods({dynamic type = 'card', int? limit, String? endingBefore, String? startingAfter}) Future<Map<String, dynamic>>
List a Customer's PaymentMethods. https://stripe.com/docs/api/payment_methods/list
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
retrieveCurrentCustomer() Future<Map<String, dynamic>>
Retrieves the details for the current customer. https://stripe.com/docs/api/customers/retrieve
toString() String
A string representation of this object.
inherited
updateCustomer(Map<String, dynamic> data) Future<Map<String, dynamic>>
Updates the specified customer by setting the values of the parameters passed. https://stripe.com/docs/api/customers/update

Operators

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

Static Properties

instance CustomerSession
Get the current customer session
no setter

Static Methods

endCustomerSession() → void
End the managed singleton customer session. Call this when the current user logs out.
initCustomerSession(EphemeralKeyProvider provider, {String apiVersion = defaultApiVersion, String? stripeAccount, bool prefetchKey = true}) → void
Initiate the customer session singleton instance. If prefetchKey is true, fetch the ephemeral key immediately.

Constants

keyRefreshBufferInSeconds → const int