feat(connector): [CashToCode] perform currency based connector credentials mapping (#2025)

This commit is contained in:
BallaNitesh
2023-08-28 09:29:57 +05:30
committed by GitHub
parent 1075f7d95f
commit 7c0c3b6b35
23 changed files with 184 additions and 130 deletions

View File

@ -225,6 +225,8 @@ pub enum StripeErrorCode {
PaymentMethodUnactivated,
#[error(error_type = StripeErrorType::HyperswitchError, code = "", message = "{entity} expired or invalid")]
HyperswitchUnprocessableEntity { entity: String },
#[error(error_type = StripeErrorType::InvalidRequestError, code = "", message = "{message}")]
CurrencyNotSupported { message: String },
// [#216]: https://github.com/juspay/hyperswitch/issues/216
// Implement the remaining stripe error codes
@ -553,6 +555,9 @@ impl From<errors::ApiErrorResponse> for StripeErrorCode {
Self::MerchantConnectorAccountDisabled
}
errors::ApiErrorResponse::NotSupported { .. } => Self::InternalServerError,
errors::ApiErrorResponse::CurrencyNotSupported { message } => {
Self::CurrencyNotSupported { message }
}
errors::ApiErrorResponse::FileProviderNotSupported { .. } => {
Self::FileProviderNotSupported
}
@ -628,6 +633,7 @@ impl actix_web::ResponseError for StripeErrorCode {
| Self::FileNotFound
| Self::FileNotAvailable
| Self::FileProviderNotSupported
| Self::CurrencyNotSupported { .. }
| Self::PaymentMethodUnactivated => StatusCode::BAD_REQUEST,
Self::RefundFailed
| Self::PayoutFailed