mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 19:42:27 +08:00
refactor(core): use profile id to find connector (#2020)
This commit is contained in:
@ -124,8 +124,11 @@ pub enum StripeErrorCode {
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "token_already_used", message = "duplicate merchant account")]
|
||||
DuplicateMerchantAccount,
|
||||
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "token_already_used", message = "The merchant connector account with the specified connector_label '{connector_label}' already exists in our records")]
|
||||
DuplicateMerchantConnectorAccount { connector_label: String },
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "token_already_used", message = "The merchant connector account with the specified profile_id '{profile_id}' and connector_name '{connector_name}' already exists in our records")]
|
||||
DuplicateMerchantConnectorAccount {
|
||||
profile_id: String,
|
||||
connector_name: String,
|
||||
},
|
||||
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "token_already_used", message = "duplicate payment method")]
|
||||
DuplicatePaymentMethod,
|
||||
@ -391,7 +394,7 @@ impl From<errors::ApiErrorResponse> for StripeErrorCode {
|
||||
errors::ApiErrorResponse::Unauthorized
|
||||
| errors::ApiErrorResponse::InvalidJwtToken
|
||||
| errors::ApiErrorResponse::GenericUnauthorized { .. }
|
||||
| errors::ApiErrorResponse::AccessForbidden
|
||||
| errors::ApiErrorResponse::AccessForbidden { .. }
|
||||
| errors::ApiErrorResponse::InvalidEphemeralKey => Self::Unauthorized,
|
||||
errors::ApiErrorResponse::InvalidRequestUrl
|
||||
| errors::ApiErrorResponse::InvalidHttpMethod
|
||||
@ -495,9 +498,13 @@ impl From<errors::ApiErrorResponse> for StripeErrorCode {
|
||||
}
|
||||
errors::ApiErrorResponse::ReturnUrlUnavailable => Self::ReturnUrlUnavailable,
|
||||
errors::ApiErrorResponse::DuplicateMerchantAccount => Self::DuplicateMerchantAccount,
|
||||
errors::ApiErrorResponse::DuplicateMerchantConnectorAccount { connector_label } => {
|
||||
Self::DuplicateMerchantConnectorAccount { connector_label }
|
||||
}
|
||||
errors::ApiErrorResponse::DuplicateMerchantConnectorAccount {
|
||||
profile_id,
|
||||
connector_name,
|
||||
} => Self::DuplicateMerchantConnectorAccount {
|
||||
profile_id,
|
||||
connector_name,
|
||||
},
|
||||
errors::ApiErrorResponse::DuplicatePaymentMethod => Self::DuplicatePaymentMethod,
|
||||
errors::ApiErrorResponse::ClientSecretInvalid => Self::PaymentIntentInvalidParameter {
|
||||
param: "client_secret".to_owned(),
|
||||
|
||||
Reference in New Issue
Block a user