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

ci(cypress): fix zero auth mandate for mollie connector (#13467)

likhinbopanna94e27ccdf433
diff --git a/crates/hyperswitch_connectors/src/connectors/mollie.rs b/crates/hyperswitch_connectors/src/connectors/mollie.rs
index 16e9171eff..6950a2b92e 100644
--- a/crates/hyperswitch_connectors/src/connectors/mollie.rs
+++ b/crates/hyperswitch_connectors/src/connectors/mollie.rs
@@ -1086,15 +1086,18 @@ impl ConnectorSpecifications for Mollie {
&self,
payment_attempt: &hyperswitch_domain_models::payments::payment_attempt::PaymentAttempt,
) -> api::ConnectorCustomerAction {
+ // Mollie registers a mandate by sending `sequenceType: first` with a `customerId`,
+ // so a connector customer is required for any off-session card setup (including
+ // zero-auth mandates). We intentionally don't gate on `customer_acceptance`: it may
+ // be supplied nested inside `mandate_data` (not surfaced on the attempt) and its
+ // placement doesn't change whether Mollie needs a customer.
if matches!(
payment_attempt.setup_future_usage_applied,
Some(enums::FutureUsage::OffSession)
- ) && payment_attempt.customer_acceptance.is_some()
- && matches!(
- payment_attempt.payment_method,
- Some(enums::PaymentMethod::Card)
- )
- {
+ ) && matches!(
+ payment_attempt.payment_method,
+ Some(enums::PaymentMethod::Card)
+ ) {
api::ConnectorCustomerAction::CallConnectorCustomer
} else {
api::ConnectorCustomerAction::NoAction
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Mollie.js b/cypress-tests/cypress/e2e/configs/Payment/Mollie.js
index 78c9382be7..2665020bb1 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Mollie.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Mollie.js
@@ -167,6 +167,7 @@ export const connectorDetails = {
"3DSManualCapture": {
Request: {
payment_method: "card",
+ payment_method_type: "credit",
payment_method_data: {
card: successfulThreeDSTestCardDetails,
},
@@ -185,6 +186,7 @@ export const connectorDetails = {
"3DSAutoCapture": {
Request: {
payment_method: "card",
+ payment_method_type: "credit",
payment_method_data: {
card: successfulThreeDSTestCardDetails,
},
@@ -725,6 +727,24 @@ export const connectorDetails = {
},
},
},
+ No3DSFailPayment: {
+ Request: {
+ amount: 6000,
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ billing: billingAddress,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded", // There is no failure test cards for Mollie
+ },
+ },
+ },
},
bank_redirect_pm: {
Ideal: {