PaymentApiException class

Exception thrown when the API returns an error response.

This exception handles all API-specific errors, including:

  • Authentication failures
  • Invalid order IDs
  • Server errors
  • Business logic errors
Inheritance

Constructors

PaymentApiException.new(String message, {dynamic cause, int? statusCode, String? responseBody, String? errorCode})
Creates a new PaymentApiException with the specified details.

Properties

cause → dynamic
The original error that caused this exception, if any. Useful for debugging and error tracking.
finalinherited
errorCode String?
Error code from the API response, if available. This is the specific error code returned by the server. Example: 'ERR_PAYMENT_ORDER_NOT_FOUND'
finalinherited
errorType PaymentErrorType
The type of payment error that occurred. This helps categorize the error for appropriate handling.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
message String
A human-readable error message describing what went wrong. This should be clear and actionable for developers.
finalinherited
responseBody String?
Raw response body from the API if available. This contains the complete server response for debugging.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int?
HTTP status code if the error is related to an API call. This will be null for non-HTTP related errors.
finalinherited

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