fix(errors): use format!() for RefundNotPossibleError (#1518)

This commit is contained in:
Narayan Bhat
2023-06-22 20:32:01 +05:30
committed by GitHub
parent efe1ed9b77
commit 1da411e67a

View File

@ -411,7 +411,7 @@ impl common_utils::errors::ErrorSwitch<api_models::errors::types::ApiErrorRespon
}
Self::ReturnUrlUnavailable => AER::NotFound(ApiError::new("HE", 3, "Return URL is not configured and not passed in payments request", None)),
Self::RefundNotPossible { connector } => {
AER::BadRequest(ApiError::new("HE", 3, "This refund is not possible through Hyperswitch. Please raise the refund through {connector} dashboard", None))
AER::BadRequest(ApiError::new("HE", 3, format!("This refund is not possible through Hyperswitch. Please raise the refund through {connector} dashboard"), None))
}
Self::MandateValidationFailed { reason } => {
AER::BadRequest(ApiError::new("HE", 3, "Mandate Validation Failed", Some(Extra { reason: Some(reason.clone()), ..Default::default() })))