refactor(router): add id field in MerchantConnectorAccountNotFound (#1098)

This commit is contained in:
EliKalter
2023-05-10 14:56:45 +03:00
committed by GitHub
parent c5db5c37ec
commit 5214e22f20
4 changed files with 26 additions and 16 deletions

View File

@ -88,8 +88,8 @@ pub enum StripeErrorCode {
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "No such resource ID")]
ResourceIdNotFound,
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "No such merchant connector account")]
MerchantConnectorAccountNotFound,
#[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 = "resource_missing", message = "No such mandate")]
MandateNotFound,
@ -429,8 +429,8 @@ impl From<errors::ApiErrorResponse> for StripeErrorCode {
| errors::ApiErrorResponse::ClientSecretExpired => Self::ClientSecretNotFound,
errors::ApiErrorResponse::MerchantAccountNotFound => Self::MerchantAccountNotFound,
errors::ApiErrorResponse::ResourceIdNotFound => Self::ResourceIdNotFound,
errors::ApiErrorResponse::MerchantConnectorAccountNotFound => {
Self::MerchantConnectorAccountNotFound
errors::ApiErrorResponse::MerchantConnectorAccountNotFound { id } => {
Self::MerchantConnectorAccountNotFound { id }
}
errors::ApiErrorResponse::MandateNotFound => Self::MandateNotFound,
errors::ApiErrorResponse::ApiKeyNotFound => Self::ApiKeyNotFound,
@ -518,7 +518,7 @@ impl actix_web::ResponseError for StripeErrorCode {
| Self::PaymentNotFound
| Self::PaymentMethodNotFound
| Self::MerchantAccountNotFound
| Self::MerchantConnectorAccountNotFound
| Self::MerchantConnectorAccountNotFound { .. }
| Self::MandateNotFound
| Self::ApiKeyNotFound
| Self::DuplicateMerchantAccount