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(core): Donot attempt step-up for GooglePay PAN_ONLY when authentication type is No3ds (#14470)

Sayak Bhattacharyac4b32de9b883
diff --git a/crates/router/src/core/payments/flows/authorize_flow.rs b/crates/router/src/core/payments/flows/authorize_flow.rs
index 102ff63d71..a10e1da129 100644
--- a/crates/router/src/core/payments/flows/authorize_flow.rs
+++ b/crates/router/src/core/payments/flows/authorize_flow.rs
@@ -1219,9 +1219,12 @@ impl RouterDataAuthorize for types::PaymentsAuthorizeRouterData {
) = &self.request.payment_method_data
{
if let Some(assurance_details) = google_pay_data.info.assurance_details.as_ref() {
- // Step up the transaction to 3DS when either assurance_details.card_holder_authenticated or assurance_details.account_verified is false
- if !assurance_details.card_holder_authenticated
- || !assurance_details.account_verified
+ // Step up the transaction to 3DS when either assurance_details.card_holder_authenticated is false.
+ // The step up must not override the merchant's requested authentication type:
+ // `no_three_ds` (explicit or defaulted) is respected irrespective of the
+ // assurance_details.card_holder_authenticated.
+ if (!assurance_details.card_holder_authenticated)
+ && (self.auth_type != diesel_models::enums::AuthenticationType::NoThreeDs)
{
logger::info!("Googlepay transaction stepped up to 3DS");
self.auth_type = diesel_models::enums::AuthenticationType::ThreeDs;
diff --git a/crates/router/src/core/payments/flows/setup_mandate_flow.rs b/crates/router/src/core/payments/flows/setup_mandate_flow.rs
index 2b38ed8415..48c2e9f4fb 100644
--- a/crates/router/src/core/payments/flows/setup_mandate_flow.rs
+++ b/crates/router/src/core/payments/flows/setup_mandate_flow.rs
@@ -134,15 +134,16 @@ impl Feature<api::SetupMandate, types::SetupMandateRequestData> for types::Setup
types::SetupMandateRequestData,
types::PaymentsResponseData,
> = connector.connector.get_connector_integration();
- // Change the authentication_type to ThreeDs, for google_pay wallet if card_holder_authenticated or account_verified in assurance_details is false
+ // Change the authentication_type to ThreeDs, for google_pay wallet if card_holder_authenticated or account_verified in assurance_details is false,
+ // unless the merchant requested `no_three_ds` — the merchant's requested authentication type is always respected
if let hyperswitch_domain_models::payment_method_data::PaymentMethodData::Wallet(
hyperswitch_domain_models::payment_method_data::WalletData::GooglePay(google_pay_data),
) = &self.request.payment_method_data
{
if let Some(assurance_details) = google_pay_data.info.assurance_details.as_ref() {
// Step up the transaction to 3DS when either assurance_details.card_holder_authenticated or assurance_details.account_verified is false
- if !assurance_details.card_holder_authenticated
- || !assurance_details.account_verified
+ if (!assurance_details.card_holder_authenticated)
+ && self.auth_type != diesel_models::enums::AuthenticationType::NoThreeDs
{
logger::info!("Googlepay transaction stepped up to 3DS");
self.auth_type = diesel_models::enums::AuthenticationType::ThreeDs;