Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
fix(connector): [Checkout] Fix error message in error handling (#1221)
Prasunna Soppa22b2fa30610a
diff --git a/crates/router/src/connector/checkout.rs b/crates/router/src/connector/checkout.rsindex d5a8ec6f2e..cc45ef619c 100644--- a/crates/router/src/connector/checkout.rs+++ b/crates/router/src/connector/checkout.rs@@ -78,14 +78,18 @@ impl ConnectorCommon for Checkout {res: types::Response,) -> CustomResult<types::ErrorResponse, errors::ConnectorError> {let response: checkout::ErrorResponse = if res.response.is_empty() {+ let (error_codes, error_type) = if res.status_code == 401 {+ (+ Some(vec!["Invalid api key".to_string()]),+ Some("invalid_api_key".to_string()),+ )+ } else {+ (None, None)+ };checkout::ErrorResponse {request_id: None,- error_type: if res.status_code == 401 || res.status_code == 422 {- Some("Invalid Api Key".to_owned())- } else {- None- },- error_codes: None,+ error_codes,+ error_type,}} else {res.response