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
feat(connector): [Shift4] Enhance error mapping to support issuer error codes (#10748)
Anurag644762d0ee7e
diff --git a/crates/hyperswitch_connectors/src/connectors/shift4.rs b/crates/hyperswitch_connectors/src/connectors/shift4.rsindex 01b23f61e5..f595880df4 100644--- a/crates/hyperswitch_connectors/src/connectors/shift4.rs+++ b/crates/hyperswitch_connectors/src/connectors/shift4.rs@@ -144,10 +144,10 @@ impl ConnectorCommon for Shift4 {message: response.error.message,reason: None,attempt_status: None,- connector_transaction_id: None,- network_advice_code: None,- network_decline_code: None,- network_error_message: None,+ connector_transaction_id: response.error.charge_id,+ network_advice_code: response.error.network_advice_code,+ network_decline_code: response.error.issuer_decline_code,+ network_error_message: response.error.advice_code,connector_metadata: None,})}diff --git a/crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs b/crates/hyperswitch_connectors/src/connectors/shift4/transformers.rsindex ea0c4a8406..10224bba25 100644--- a/crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs+++ b/crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs@@ -1103,9 +1103,14 @@ pub struct ErrorResponse {}#[derive(Default, Debug, Clone, Deserialize, Eq, PartialEq, Serialize)]+#[serde(rename = "camelCase")]pub struct ApiErrorResponse {pub code: Option<String>,pub message: String,+ pub issuer_decline_code: Option<String>,+ pub advice_code: Option<String>,+ pub network_advice_code: Option<String>,+ pub charge_id: Option<String>,}pub fn is_transaction_event(event: &Shift4WebhookEvent) -> bool {