Pay class
High level layer to easily manage cross-platform integrations.
This class simplifies using the plugin and abstracts platform-specific directives. To use it, instantiate it with a list of configurations for the payment providers supported:
final payConfiguration = PaymentConfiguration.fromJsonString(<string>);
final payClient = Pay({<PayProvider>: payConfiguration});
await payClient.showPaymentSelector(<PayProvider>, paymentItems);
Constructors
-
Pay(Map<
PayProvider, PaymentConfiguration> _configurations) -
Creates an instance with a dictionary of
_configurations
and instantiates the_payPlatform
to communicate with the native platforms.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
showPaymentSelector(
PayProvider provider, List< PaymentItem> paymentItems) → Future<Map< String, dynamic> > - Shows the payment selector to initiate a payment process.
-
throwIfProviderIsNotDefined(
PayProvider provider) → Future< void> - Verifies that the selected provider has been previously configured or throws otherwise.
-
toString(
) → String -
A string representation of this object.
inherited
-
userCanPay(
PayProvider provider) → Future< bool> -
Determines whether a user can pay with the selected
provider
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited