PaymentApiException constructor

PaymentApiException(
  1. String message, {
  2. dynamic cause,
  3. int? statusCode,
  4. String? responseBody,
  5. String? errorCode,
})

Creates a new PaymentApiException with the specified details.

The message should describe the API error. The statusCode is the HTTP status code from the response. The responseBody is the raw response from the server. The errorCode is the specific error code returned by the API.

Implementation

PaymentApiException(
  super.message, {
  super.cause,
  super.statusCode,
  super.responseBody,
  super.errorCode,
}) : super(
        errorType: errorCode == 'ERR_PAYMENT_ORDER_NOT_FOUND'
            ? PaymentErrorType.invalidOrderId
            : PaymentErrorType.api,
      );