Skip to content

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

fix(connector): [Zift] Handle void transactions in Zift payment sync (#14637)

Vani Gupta52d3949e203e
diff --git a/crates/hyperswitch_connectors/src/connectors/zift/transformers.rs b/crates/hyperswitch_connectors/src/connectors/zift/transformers.rs
index ad87f8503c..0ce04a6fc9 100644
--- a/crates/hyperswitch_connectors/src/connectors/zift/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/zift/transformers.rs
@@ -90,6 +90,7 @@ pub enum PaymentRequestType {
#[serde(rename = "sale-auth")]
Auth,
Capture,
+ Void,
}
#[derive(Debug, Clone, Copy, Serialize, PartialEq, Eq)]
@@ -746,6 +747,14 @@ impl TryFrom<ResponseRouterData<PSync, ZiftSyncResponse, PaymentsSyncData, Payme
}
TransactionStatus::Cancelled => common_enums::AttemptStatus::CaptureFailed,
},
+
+ PaymentRequestType::Void => match item.response.transaction_status {
+ TransactionStatus::Processed => common_enums::AttemptStatus::Voided,
+ TransactionStatus::Pending | TransactionStatus::InRebill => {
+ common_enums::AttemptStatus::VoidInitiated
+ }
+ TransactionStatus::Cancelled => common_enums::AttemptStatus::VoidFailed,
+ },
};
// Populate the previous connector transaction id. If it is empty,
// populate the new one returned by the `find` response.