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(connectors): [Nexixpay] avoid complete authorize call when preprocessing failed (#10254)

Mrudul Vajpayee39f3a00ff3bb
diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs
index a45720e28b..c91051c3a7 100644
--- a/crates/router/src/core/payments.rs
+++ b/crates/router/src/core/payments.rs
@@ -6805,25 +6805,23 @@ where
!= common_enums::AttemptStatus::AuthenticationFailed;
(router_data, should_continue)
} else if router_data.auth_type == common_enums::AuthenticationType::ThreeDs
- && ((connector.connector_name == router_types::Connector::Nexixpay
- && is_operation_complete_authorize(&operation))
- || (((connector.connector_name == router_types::Connector::Nuvei && {
- #[cfg(feature = "v1")]
- {
- payment_data
- .get_payment_intent()
- .request_external_three_ds_authentication
- != Some(true)
- }
- #[cfg(feature = "v2")]
- {
- payment_data
- .get_payment_intent()
- .request_external_three_ds_authentication
- != Some(true).into()
- }
- }) || connector.connector_name == router_types::Connector::Shift4)
- && !is_operation_complete_authorize(&operation)))
+ && (((connector.connector_name == router_types::Connector::Nuvei && {
+ #[cfg(feature = "v1")]
+ {
+ payment_data
+ .get_payment_intent()
+ .request_external_three_ds_authentication
+ != Some(true)
+ }
+ #[cfg(feature = "v2")]
+ {
+ payment_data
+ .get_payment_intent()
+ .request_external_three_ds_authentication
+ != Some(true).into()
+ }
+ }) || connector.connector_name == router_types::Connector::Shift4)
+ && !is_operation_complete_authorize(&operation))
{
router_data = router_data.preprocessing_steps(state, connector).await?;
(router_data, should_continue_payment)
@@ -6862,6 +6860,13 @@ where
_ => false,
};
(router_data, should_continue)
+ } else if router_data.auth_type == common_enums::AuthenticationType::ThreeDs
+ && connector.connector_name == router_types::Connector::Nexixpay
+ && is_operation_complete_authorize(&operation)
+ {
+ router_data = router_data.preprocessing_steps(state, connector).await?;
+ let is_error_in_response = router_data.response.is_err();
+ (router_data, !is_error_in_response)
} else {
(router_data, should_continue_payment)
}