PaymentFailure class
A failed or cancelled payment outcome.
Contains a message describing the error and an optional cause with the underlying exception or raw payload.
Example:
if (result is PaymentFailure) {
print('Payment failed: ${result.message}');
}
- Inheritance
-
- Object
- PaymentResult
- PaymentFailure
Constructors
- PaymentFailure.new(String gatewayName, String message, {Object? cause})
-
Creates a failure result from
gatewayName
with amessage
and optional underlyingcause
.const
Properties
- cause → Object?
-
The underlying error or raw cause of the failure, if available.
final
- gatewayName → String
-
The human-readable name of the payment gateway that produced this result
(e.g.,
"Paystack"
,"Mollie"
).finalinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- isSuccess → bool
-
Whether this result represents a successful payment.
no setteroverride
- message → String
-
A human-readable message describing the failure.
final
- 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
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited