pay abstract method
Future<PaymentResult>
pay({
- required BuildContext context,
- required int amountSmallestUnit,
- required String email,
- String currency = 'NGN',
- String? reference,
Starts a payment flow and returns a PaymentResult.
Parameters:
context
: Used to push any UI needed for checkout (e.g., a WebView route).amountSmallestUnit
: Amount to charge in the smallest unit of the currency (for NGN, kobo; ₦1,500 =150000
).email
: The customer’s email, passed to the provider.currency
: ISO currency code (defaults to"NGN"
).reference
: Optional transaction reference. If not provided, the gateway should generate one.
Returns:
- A PaymentSuccess if the transaction succeeds.
- A PaymentFailure if cancelled, declined, or errors occur.
Implementation
Future<PaymentResult> pay({
required BuildContext context,
required int amountSmallestUnit,
required String email,
String currency = 'NGN',
String? reference,
});