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 payClient = Pay.withAssets(paymentConfigurationAssets)
await payClient.showPaymentSelector(paymentItems: 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.
Pay.withAssets(List<String> configAssets)
Alternative constructor to create a Pay object with a list of configurations in String format.

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
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