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
ci(cypress): Add Bank Redirect for mollie (#10875)
Gnanasundari24f9f61123f2c4
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Mollie.js b/cypress-tests/cypress/e2e/configs/Payment/Mollie.jsindex 27cd5c5fba..6ff3bd144d 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Mollie.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Mollie.js@@ -37,7 +37,8 @@ const multiUseMandateData = {},};-const billingAddress = {+// Base billing address structure+const baseBillingAddress = {address: {line1: "1467",line2: "Harrison Street",@@ -45,8 +46,8 @@ const billingAddress = {state: "California",zip: "94122",country: "US",- first_name: "Test",- last_name: "User",+ first_name: "John",+ last_name: "Doe",},phone: {number: "9123456789",@@ -54,6 +55,64 @@ const billingAddress = {},};+const billingAddress = {+ ...baseBillingAddress,+ address: {+ ...baseBillingAddress.address,+ first_name: "Test",+ last_name: "User",+ },+};++const billingAddressNL = {+ ...baseBillingAddress,+ address: {+ ...baseBillingAddress.address,+ country: "NL",+ },+ phone: {+ ...baseBillingAddress.phone,+ country_code: "+31",+ },+};++const billingAddressAT = {+ ...baseBillingAddress,+ address: {+ ...baseBillingAddress.address,+ country: "AT",+ },+ phone: {+ ...baseBillingAddress.phone,+ country_code: "+43",+ },+};++const billingAddressDE = {+ ...baseBillingAddress,+ address: {+ ...baseBillingAddress.address,+ country: "DE",+ },+ phone: {+ ...baseBillingAddress.phone,+ country_code: "+49",+ },+};++const billingAddressPL = {+ ...baseBillingAddress,+ address: {+ ...baseBillingAddress.address,+ country: "PL",+ },+ phone: {+ ...baseBillingAddress.phone,+ country_code: "+48",+ },+ email: "[email protected]",+};+export const connectorDetails = {card_pm: {PaymentIntent: {@@ -667,4 +726,107 @@ export const connectorDetails = {},},},+ bank_redirect_pm: {+ Ideal: {+ Request: {+ payment_method: "bank_redirect",+ payment_method_type: "ideal",+ payment_method_data: {+ bank_redirect: {+ ideal: {+ bank_name: "ing",+ },+ },+ },+ billing: billingAddressNL,+ },+ Response: {+ status: 200,+ body: {+ status: "requires_customer_action",+ },+ },+ },+ Eps: {+ Request: {+ payment_method: "bank_redirect",+ payment_method_type: "eps",+ payment_method_data: {+ bank_redirect: {+ eps: {+ bank_name: "ing",+ },+ },+ },+ billing: billingAddressAT,+ },+ Response: {+ status: 200,+ body: {+ status: "requires_customer_action",+ },+ },+ },+ Giropay: {+ Request: {+ payment_method: "bank_redirect",+ payment_method_type: "giropay",+ payment_method_data: {+ bank_redirect: {+ giropay: {},+ },+ },+ billing: billingAddressDE,+ },+ Response: {+ status: 200,+ body: {+ status: "requires_customer_action",+ },+ },+ },+ Sofort: {+ Request: {+ payment_method: "bank_redirect",+ payment_method_type: "sofort",+ payment_method_data: {+ bank_redirect: {+ sofort: {+ country: "DE",+ preferred_language: "en",+ },+ },+ },+ billing: billingAddressDE,+ },+ Response: {+ status: 200,+ body: {+ status: "failed",+ error_code: "Unprocessable Entity",+ error_message: "method",+ },+ },+ },+ Przelewy24: {+ Request: {+ payment_method: "bank_redirect",+ payment_method_type: "przelewy24",+ payment_method_data: {+ bank_redirect: {+ przelewy24: {+ bank_name: "ing",+ },+ },+ },+ billing: billingAddressPL,+ },+ Response: {+ status: 200,+ body: {+ status: "requires_customer_action",+ },+ },+ },+ },};diff --git a/cypress-tests/cypress/support/redirectionHandler.js b/cypress-tests/cypress/support/redirectionHandler.jsindex 2730a3fe3e..9ce471fe78 100644--- a/cypress-tests/cypress/support/redirectionHandler.js+++ b/cypress-tests/cypress/support/redirectionHandler.js@@ -779,6 +779,59 @@ function bankRedirectRedirection(}break;+ case "mollie":+ if (+ [+ "eps",+ "ideal",+ "giropay",+ "sofort",+ "przelewy24",+ "bancontact_card",+ ].includes(paymentMethodType)+ ) {+ cy.log(`Handling Mollie ${paymentMethodType} redirect flow`);++ // Mollie test mode shows radio buttons to select payment status+ cy.get("body").then(($body) => {+ const paidSelector = 'input[type="radio"][value="paid"]';+ const authorizedSelector =+ 'input[type="radio"][value="authorized"]';++ if ($body.find(paidSelector).length) {+ cy.get(paidSelector, { timeout: constants.WAIT_TIME })+ .click()+ .log("Selected: Paid");+ } else if ($body.find(authorizedSelector).length) {+ cy.get(authorizedSelector, { timeout: constants.WAIT_TIME })+ .click()+ .log("Selected: Authorized");+ } else {+ cy.log(+ "No payment status selector found, page may auto-redirect"+ );+ }+ });++ // Click the Continue button if present+ cy.get("body").then(($body) => {+ if ($body.find('button:contains("Continue")').length > 0) {+ cy.contains("button", "Continue", {+ timeout: constants.WAIT_TIME,+ })+ .should("be.visible")+ .click();+ }+ });++ verifyUrl = true;+ } else {+ throw new Error(+ `Unsupported Mollie payment method type: ${paymentMethodType}`+ );+ }+ break;+default:throw new Error(`Unsupported connector in handleFlow: ${connectorId}`