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:
- Initialize charge with payment details
- Receive challenge response requiring additional data
- Submit appropriate SubmitChargeOptions based on challenge type
- 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.
constfactory
- SubmitChargeOptions.birthday({required String birthday, required String reference})
-
Creates options for submitting a birth date during charge verification.
constfactory
- SubmitChargeOptions.otp({required String otp, required String reference})
-
Creates options for submitting an OTP during charge authentication.
constfactory
- SubmitChargeOptions.phone({required String phone, required String reference})
-
Creates options for submitting a phone number during charge flow.
constfactory
- SubmitChargeOptions.pin({required String pin, required String reference})
-
Creates options for submitting a PIN during charge authentication.
constfactory
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