mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 05:17:02 +08:00
fix(merchant_connector_account): add validation for the disabled flag (#1141)
This commit is contained in:
@ -91,6 +91,9 @@ pub enum StripeErrorCode {
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "Merchant connector account with id '{id}' does not exist in our records")]
|
||||
MerchantConnectorAccountNotFound { id: String },
|
||||
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "invalid_request", message = "The merchant connector account is disabled")]
|
||||
MerchantConnectorAccountDisabled,
|
||||
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "No such mandate")]
|
||||
MandateNotFound,
|
||||
|
||||
@ -491,6 +494,9 @@ impl From<errors::ApiErrorResponse> for StripeErrorCode {
|
||||
errors::ApiErrorResponse::MissingDisputeId => Self::MissingDisputeId,
|
||||
errors::ApiErrorResponse::FileNotFound => Self::FileNotFound,
|
||||
errors::ApiErrorResponse::FileNotAvailable => Self::FileNotAvailable,
|
||||
errors::ApiErrorResponse::MerchantConnectorAccountDisabled => {
|
||||
Self::MerchantConnectorAccountDisabled
|
||||
}
|
||||
errors::ApiErrorResponse::NotSupported { .. } => Self::InternalServerError,
|
||||
}
|
||||
}
|
||||
@ -519,6 +525,7 @@ impl actix_web::ResponseError for StripeErrorCode {
|
||||
| Self::PaymentMethodNotFound
|
||||
| Self::MerchantAccountNotFound
|
||||
| Self::MerchantConnectorAccountNotFound { .. }
|
||||
| Self::MerchantConnectorAccountDisabled
|
||||
| Self::MandateNotFound
|
||||
| Self::ApiKeyNotFound
|
||||
| Self::DuplicateMerchantAccount
|
||||
|
||||
Reference in New Issue
Block a user