feat(payment_link): add multiple custom css support in business level (#5137)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Sahkal Poddar
2024-07-01 16:29:06 +05:30
committed by GitHub
parent 1b8946321b
commit ecc6c00d4a
10 changed files with 165 additions and 96 deletions

View File

@ -266,6 +266,8 @@ pub enum StripeErrorCode {
ExtendedCardInfoNotFound,
#[error(error_type = StripeErrorType::InvalidRequestError, code = "IR_28", message = "Invalid tenant")]
InvalidTenant,
#[error(error_type = StripeErrorType::HyperswitchError, code = "HE_01", message = "Failed to convert amount to {amount_type} type")]
AmountConversionFailed { amount_type: &'static str },
// [#216]: https://github.com/juspay/hyperswitch/issues/216
// Implement the remaining stripe error codes
@ -650,6 +652,9 @@ impl From<errors::ApiErrorResponse> for StripeErrorCode {
errors::ApiErrorResponse::ExtendedCardInfoNotFound => Self::ExtendedCardInfoNotFound,
errors::ApiErrorResponse::InvalidTenant { tenant_id: _ }
| errors::ApiErrorResponse::MissingTenantId => Self::InvalidTenant,
errors::ApiErrorResponse::AmountConversionFailed { amount_type } => {
Self::AmountConversionFailed { amount_type }
}
}
}
}
@ -730,7 +735,8 @@ impl actix_web::ResponseError for StripeErrorCode {
| Self::MandateActive
| Self::CustomerRedacted
| Self::WebhookProcessingError
| Self::InvalidTenant => StatusCode::INTERNAL_SERVER_ERROR,
| Self::InvalidTenant
| Self::AmountConversionFailed { .. } => StatusCode::INTERNAL_SERVER_ERROR,
Self::ReturnUrlUnavailable => StatusCode::SERVICE_UNAVAILABLE,
Self::ExternalConnectorError { status_code, .. } => {
StatusCode::from_u16(*status_code).unwrap_or(StatusCode::INTERNAL_SERVER_ERROR)