mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 04:04:43 +08:00
feat(connector): [CashToCode] perform currency based connector credentials mapping (#2025)
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user