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
refactor: Invoking Granular flow instead of Preprocessing (#10778)
Amitsingh Tanwarc084b7705a8d
diff --git a/crates/hyperswitch_connectors/src/connectors/nexixpay.rs b/crates/hyperswitch_connectors/src/connectors/nexixpay.rsindex d6c79587ca..9b608e00e6 100644--- a/crates/hyperswitch_connectors/src/connectors/nexixpay.rs+++ b/crates/hyperswitch_connectors/src/connectors/nexixpay.rs@@ -1238,6 +1238,23 @@ impl ConnectorSpecifications for Nexixpay {Some(&*NEXIXPAY_CONNECTOR_INFO)}+ fn is_post_authentication_flow_required(&self, current_flow: api::CurrentFlowInfo<'_>) -> bool {+ match current_flow {+ api::CurrentFlowInfo::Authorize { .. } => false,+ api::CurrentFlowInfo::CompleteAuthorize {+ request_data,+ payment_method,+ } => {+ payment_method == Some(enums::PaymentMethod::Card)+ && request_data+ .redirect_response+ .as_ref()+ .and_then(|redirect_response| redirect_response.payload.as_ref())+ .is_some()+ }+ }+ }+fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {Some(&*NEXIXPAY_SUPPORTED_PAYMENT_METHODS)}diff --git a/crates/hyperswitch_connectors/src/connectors/redsys.rs b/crates/hyperswitch_connectors/src/connectors/redsys.rsindex 59e9eb8bc8..0c68fbb845 100644--- a/crates/hyperswitch_connectors/src/connectors/redsys.rs+++ b/crates/hyperswitch_connectors/src/connectors/redsys.rs@@ -980,6 +980,15 @@ static REDSYS_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {static REDSYS_SUPPORTED_WEBHOOK_FLOWS: [common_enums::EventClass; 0] = [];impl ConnectorSpecifications for Redsys {+ fn is_pre_authentication_flow_required(&self, current_flow: api::CurrentFlowInfo<'_>) -> bool {+ match current_flow {+ api::CurrentFlowInfo::Authorize { auth_type, .. } => {+ *auth_type == common_enums::AuthenticationType::ThreeDs+ }+ api::CurrentFlowInfo::CompleteAuthorize { .. } => false,+ }+ }+fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {Some(&REDSYS_CONNECTOR_INFO)}diff --git a/crates/router/src/core/payments/flows/authorize_flow.rs b/crates/router/src/core/payments/flows/authorize_flow.rsindex 8064275724..f0ba616821 100644--- a/crates/router/src/core/payments/flows/authorize_flow.rs+++ b/crates/router/src/core/payments/flows/authorize_flow.rs@@ -5,7 +5,7 @@ use common_enums as enums;use common_types::payments as common_payments_types;#[cfg(feature = "v2")]use common_utils::types::MinorUnit;-use common_utils::{errors, id_type, ucs_types};+use common_utils::{errors, ext_traits::ValueExt, id_type, ucs_types};use error_stack::ResultExt;use external_services::grpc_client;#[cfg(feature = "v2")]@@ -372,9 +372,26 @@ impl Feature<api::Authorize, types::PaymentsAuthorizeData> for types::PaymentsAuauthorize_request_data,pre_authenticate_response,);- // After doing pre_authentication, step, we should not proceed with authorize call.- // control must be returned to SDK.- Ok((authorize_router_data, false))+ let should_continue_after_preauthenticate = match connector.connector_name {+ api_models::enums::Connector::Redsys => match &authorize_router_data.response {+ Ok(types::PaymentsResponseData::TransactionResponse {+ connector_metadata,+ ..+ }) => {+ let three_ds_invoke_data: Option<+ api_models::payments::PaymentsConnectorThreeDsInvokeData,+ > = connector_metadata.clone().and_then(|metadata| {+ metadata+ .parse_value("PaymentsConnectorThreeDsInvokeData")+ .ok()+ });+ three_ds_invoke_data.is_none()+ }+ _ => false,+ },+ _ => false,+ };+ Ok((authorize_router_data, should_continue_after_preauthenticate))} else {Ok((self, true))}diff --git a/crates/router/src/core/payments/flows/complete_authorize_flow.rs b/crates/router/src/core/payments/flows/complete_authorize_flow.rsindex 09aff48b73..50e07c38da 100644--- a/crates/router/src/core/payments/flows/complete_authorize_flow.rs+++ b/crates/router/src/core/payments/flows/complete_authorize_flow.rs@@ -391,14 +391,17 @@ impl Feature<api::CompleteAuthorize, types::CompleteAuthorizeData>);// check if redirection is not present in the response and attempt status is not AuthenticationFailed// if condition does not satisfy, then we don't need to proceed further- let should_continue = (matches!(+ let should_continue = matches!(complete_authorize_router_data.response,Ok(types::PaymentsResponseData::TransactionResponse {ref redirection_data,..}) if redirection_data.is_none()- ) && complete_authorize_router_data.status- != common_enums::AttemptStatus::AuthenticationFailed);+ ) && !matches!(+ complete_authorize_router_data.status,+ common_enums::AttemptStatus::AuthenticationFailed+ | common_enums::AttemptStatus::Failure+ );Ok((complete_authorize_router_data, should_continue))} else {Ok((self, true))