PaymentMethodStore class
A managed repository for payment methods. This is the preferred way to work with payment methods when using Flutter. The store will only refresh itself if there are active listeners.
- Inheritance
-
- Object
- ChangeNotifier
- PaymentMethodStore
Constructors
- PaymentMethodStore({CustomerSession? customerSession})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isInitialized ↔ bool
-
getter/setter pair
- isLoading ↔ bool
-
getter/setter pair
-
paymentMethods
→ List<
PaymentMethod> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Refreshes data from the API when the first listener is added.
override
-
attachPaymentMethod(
String paymentMethodId) → Future< Map< String, dynamic> > - Attach a payment method and refresh the store if there are any active listeners.
-
detachPaymentMethod(
String paymentMethodId) → Future< Map> - Detach a payment method and refresh the store if there are any active listeners.
-
dispose(
) → void -
Clear the store, notify all active listeners and dispose the ChangeNotifier.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
refresh(
) → Future< void> - Refresh the store if there are any active listeners.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → PaymentMethodStore
-
Access the singleton instance of PaymentMethodStore.
no setter