SubmitChargeOptions class sealed

Options for submitting additional authentication data during charge flow.

This sealed class represents different types of authentication or verification data that may be required to complete a payment charge. Paystack's charge flow often requires additional verification steps depending on the payment method, bank requirements, or risk assessment.

The class uses a discriminated union pattern to ensure type safety when handling different verification types. Each subtype contains the specific data needed for that verification method.

Common charge flow:

  1. Initialize charge with payment details
  2. Receive challenge response requiring additional data
  3. Submit appropriate SubmitChargeOptions based on challenge type
  4. Complete or continue verification process

Example usage:

// Handle different challenge types
switch (challengeType) {
  case 'pin':
    final options = SubmitChargeOptions.pin(
      pin: userEnteredPin,
      reference: transactionReference,
    );
    break;
  case 'otp':
    final options = SubmitChargeOptions.otp(
      otp: userEnteredOtp,
      reference: transactionReference,
    );
    break;
}
Mixed-in types
Implementers
Annotations
  • @MappableClass.new(discriminatorKey: 'type')

Constructors

SubmitChargeOptions.address({required String address, required String reference, required String city, required String state, required String zipcode})
Creates options for submitting billing address during charge flow.
const
factory
SubmitChargeOptions.birthday({required String birthday, required String reference})
Creates options for submitting a birth date during charge verification.
const
factory
SubmitChargeOptions.otp({required String otp, required String reference})
Creates options for submitting an OTP during charge authentication.
const
factory
SubmitChargeOptions.phone({required String phone, required String reference})
Creates options for submitting a phone number during charge flow.
const
factory
SubmitChargeOptions.pin({required String pin, required String reference})
Creates options for submitting a PIN during charge authentication.
const
factory

Properties

copyWith SubmitChargeOptionsCopyWith<SubmitChargeOptions, SubmitChargeOptions, SubmitChargeOptions>
no setterinherited
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
toJson() String
inherited
toMap() Map<String, dynamic>
inherited
toString() String
A string representation of this object.
inherited

Operators

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