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): [worldpay] remove threeDS data from Authorize request for NTI flows (#7097)
Kashifd443a4cf1ee7
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs b/crates/hyperswitch_connectors/src/connectors/worldpay/requests.rsindex 52ae2c4f16..6e19c20eda 100644--- a/crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs+++ b/crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs@@ -32,7 +32,7 @@ pub struct Instruction {pub value: PaymentValue,#[serde(skip_serializing_if = "Option::is_none")]pub debt_repayment: Option<bool>,- #[serde(rename = "threeDS")]+ #[serde(rename = "threeDS", skip_serializing_if = "Option::is_none")]pub three_ds: Option<ThreeDSRequest>,/// For setting up mandatespub token_creation: Option<TokenCreation>,diff --git a/crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rsindex 6ae507790d..e4656021a5 100644--- a/crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs+++ b/crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs@@ -390,8 +390,14 @@ fn create_three_ds_request<T: WorldpayPaymentsRequestData>(router_data: &T,is_mandate_payment: bool,) -> Result<Option<ThreeDSRequest>, error_stack::Report<errors::ConnectorError>> {- match router_data.get_auth_type() {- enums::AuthenticationType::ThreeDs => {+ match (+ router_data.get_auth_type(),+ router_data.get_payment_method_data(),+ ) {+ // 3DS for NTI flow+ (_, PaymentMethodData::CardDetailsForNetworkTransactionId(_)) => Ok(None),+ // 3DS for regular payments+ (enums::AuthenticationType::ThreeDs, _) => {let browser_info = router_data.get_browser_info().ok_or(errors::ConnectorError::MissingRequiredField {field_name: "browser_info",@@ -439,6 +445,7 @@ fn create_three_ds_request<T: WorldpayPaymentsRequestData>(},}))}+ // Non 3DS_ => Ok(None),}}