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
test(cypress): Add bank debit test config for Adyen connector (#11854)
HS-QUALIBOT4628b8ca837c
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Adyen.js b/cypress-tests/cypress/e2e/configs/Payment/Adyen.jsindex 01cfb1b931..0a0738583a 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Adyen.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Adyen.js@@ -1636,4 +1636,213 @@ export const connectorDetails = {},},},+ bank_debit_pm: {+ PaymentIntent: (paymentMethodType) => {+ if (paymentMethodType === "Ach") {+ return {+ Configs: {+ TRIGGER_SKIP: true,+ },+ Request: {+ currency: "USD",+ setup_future_usage: "off_session",+ },+ Response: {+ status: 200,+ body: {+ status: "requires_payment_method",+ },+ },+ };+ }+ if (paymentMethodType === "Sepa") {+ return {+ Request: {+ currency: "EUR",+ },+ Response: {+ status: 200,+ body: {+ status: "requires_payment_method",+ },+ },+ };+ }+ const currencyMap = {+ Becs: "AUD",+ Bacs: "GBP",+ };+ return {+ Request: {+ currency: currencyMap[paymentMethodType] || "USD",+ setup_future_usage: "off_session",+ },+ Response: {+ status: 200,+ body: {+ status: "requires_payment_method",+ },+ },+ };+ },+ Sepa: {+ Request: {+ payment_method: "bank_debit",+ payment_method_type: "sepa",+ payment_method_data: {+ bank_debit: {+ sepa_bank_debit: {+ iban: "DE89370400440532013000",+ bank_account_holder_name: "John Doe",+ },+ },+ },+ billing: {+ address: {+ line1: "1467",+ line2: "Harrison Street",+ line3: "Harrison Street",+ city: "Amsterdam",+ state: "North Holland",+ zip: "1012",+ country: "NL",+ first_name: "John",+ last_name: "Doe",+ },+ },+ customer_acceptance: customerAcceptance,+ },+ Response: {+ status: 200,+ body: {+ status: "succeeded",+ },+ },+ },+ Ach: {+ Configs: {+ TRIGGER_SKIP: true,+ },+ Request: {+ payment_method: "bank_debit",+ payment_method_type: "ach",+ payment_method_data: {+ bank_debit: {+ ach_bank_debit: {+ account_number: "000123456789",+ routing_number: "121000358",+ bank_type: "checking",+ bank_account_holder_name: "John Doe",+ },+ },+ },+ billing: {+ address: {+ line1: "1467",+ line2: "Harrison Street",+ line3: "Harrison Street",+ city: "San Francisco",+ state: "California",+ zip: "94122",+ country: "US",+ first_name: "John",+ last_name: "Doe",+ },+ },+ customer_acceptance: customerAcceptance,+ mandate_data: {+ customer_acceptance: customerAcceptance,+ mandate_type: {+ multi_use: {+ amount: 8000,+ currency: "USD",+ },+ },+ },+ payment_type: "new_mandate",+ },+ Response: {+ status: 200,+ body: {+ status: "succeeded",+ },+ },+ },+ Bacs: {+ Request: {+ payment_method: "bank_debit",+ payment_method_type: "bacs",+ payment_method_data: {+ bank_debit: {+ bacs_bank_debit: {+ account_number: "09083055",+ sort_code: "560036",+ bank_account_holder_name: "David Archer",+ },+ },+ },+ billing: {+ address: {+ line1: "1467",+ line2: "Harrison Street",+ line3: "Harrison Street",+ city: "London",+ state: "England",+ zip: "SW1A 1AA",+ country: "GB",+ first_name: "John",+ last_name: "Doe",+ },+ },+ customer_acceptance: customerAcceptance,+ mandate_data: {+ customer_acceptance: customerAcceptance,+ mandate_type: {+ multi_use: {+ amount: 8000,+ currency: "GBP",+ },+ },+ },+ payment_type: "new_mandate",+ },+ Response: {+ status: 200,+ body: {+ status: "processing",+ },+ },+ },+ Becs: {+ Configs: {+ TRIGGER_SKIP: true,+ },+ Request: {+ payment_method: "bank_debit",+ payment_method_type: "becs",+ payment_method_data: {+ bank_debit: {+ becs_bank_debit: {+ account_number: "000123456",+ bsb_number: "000000",+ bank_account_holder_name: "John Doe",+ },+ },+ },+ currency: "AUD",+ customer_acceptance: customerAcceptance,+ setup_future_usage: "off_session",+ },+ Response: {+ status: 400,+ body: {+ error: {+ type: "invalid_request",+ message: "Selected payment method through Adyen is not implemented",+ code: "IR_00",+ },+ },+ },+ },+ },};diff --git a/cypress-tests/cypress/e2e/configs/Payment/Commons.js b/cypress-tests/cypress/e2e/configs/Payment/Commons.jsindex 31ad14768a..e5f52b4371 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Commons.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Commons.js@@ -367,6 +367,39 @@ export const payment_methods_enabled = [},],},+ {+ payment_method: "bank_debit",+ payment_method_types: [+ {+ payment_method_type: "ach",+ minimum_amount: 1,+ maximum_amount: 68607706,+ recurring_enabled: true,+ installment_payment_enabled: true,+ },+ {+ payment_method_type: "sepa",+ minimum_amount: 1,+ maximum_amount: 68607706,+ recurring_enabled: true,+ installment_payment_enabled: true,+ },+ {+ payment_method_type: "bacs",+ minimum_amount: 1,+ maximum_amount: 68607706,+ recurring_enabled: true,+ installment_payment_enabled: true,+ },+ {+ payment_method_type: "becs",+ minimum_amount: 1,+ maximum_amount: 68607706,+ recurring_enabled: true,+ installment_payment_enabled: true,+ },+ ],+ },{payment_method: "card",payment_method_types: [diff --git a/cypress-tests/cypress/e2e/configs/Payment/Novalnet.js b/cypress-tests/cypress/e2e/configs/Payment/Novalnet.jsindex db9728fc33..b9c18f2c28 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Novalnet.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Novalnet.js@@ -775,7 +775,7 @@ export const connectorDetails = {},};},- SepaDebit: {+ Sepa: {Request: {payment_method: "bank_debit",payment_method_type: "sepa",diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.jsindex edaaf9251a..b702c72d04 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js@@ -510,6 +510,7 @@ export const CONNECTOR_LISTS = {"paypal","stripe",],+ BANK_DEBIT: ["adyen", "novalnet"],CARD_INSTALLMENTS: ["adyen"],BILLING_DESCRIPTOR: ["adyen",@@ -543,7 +544,6 @@ export const CONNECTOR_LISTS = {"worldpayvantiv",],EXTERNAL_THREE_DS: ["stripe", "finix"],- BANK_DEBIT: ["novalnet"],PARTNER_MERCHANT_IDENTIFIER: ["adyen", "checkout"],EXTEND_AUTHORIZATION: ["adyen", "paypal"],GIFT_CARD: ["adyen"],diff --git a/cypress-tests/cypress/e2e/spec/Payment/45-BankDebit.cy.js b/cypress-tests/cypress/e2e/spec/Payment/45-BankDebit.cy.jsindex ce75230636..f55a000048 100644--- a/cypress-tests/cypress/e2e/spec/Payment/45-BankDebit.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/45-BankDebit.cy.js@@ -36,11 +36,11 @@ describe("Bank Debit tests", () => {cy.task("setGlobalState", globalState.data);});- context("SEPA Bank Debit - Create and Confirm flow", () => {- it("Create Payment Intent -> Confirm SEPA Bank Debit -> Retrieve Payment", () => {+ context("SEPA Bank Debit Create and Confirm flow test", () => {+ it("Create Payment Intent -> List Merchant Payment Methods -> Confirm SEPA Bank Debit -> Retrieve Payment", () => {let shouldContinue = true;- cy.step("Create Payment Intent", () => {+ cy.step("Create Payment Intent for SEPA", () => {const data = getConnectorDetails(globalState.get("connectorId"))["bank_debit_pm"]["PaymentIntent"]("Sepa");@@ -56,26 +56,234 @@ describe("Bank Debit tests", () => {}});+ cy.step("List Merchant Payment Methods", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: List Merchant Payment Methods");+ return;+ }+ cy.paymentMethodsCallTest(globalState);+ });+cy.step("Confirm SEPA Bank Debit", () => {if (!shouldContinue) {- cy.task("cli_log", "Skipping step: Confirm SEPA Bank Debit");+ cy.task("cli_log", "Skipping step: List Merchant Payment Methods");+ return;+ }+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "bank_debit_pm"+ ]["Sepa"];+ cy.confirmCallTest(+ fixtures.confirmBody,+ confirmData,+ true,+ globalState+ );+ if (!utils.should_continue_further(confirmData)) {+ shouldContinue = false;+ }+ });++ cy.step("Retrieve Payment", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Retrieve Payment");return;}+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "bank_debit_pm"+ ]["Sepa"];+ cy.retrievePaymentCallTest({ globalState, data: confirmData });+ if (!utils.should_continue_further(confirmData)) {+ shouldContinue = false;+ }+ });+ });+ });++ context("ACH Bank Debit Create and Confirm flow test", () => {+ it("Create Payment Intent -> List Merchant Payment Methods -> Confirm ACH Bank Debit -> Retrieve Payment", () => {+ let shouldContinue = true;++ cy.step("Create Payment Intent for ACH", () => {const data = getConnectorDetails(globalState.get("connectorId"))["bank_debit_pm"- ]["SepaDebit"];- cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);+ ]["PaymentIntent"]("Ach");+ cy.createPaymentIntentTest(+ fixtures.createPaymentBody,+ data,+ "no_three_ds",+ "automatic",+ globalState+ );if (!utils.should_continue_further(data)) {shouldContinue = false;}});+ cy.step("List Merchant Payment Methods", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: List Merchant Payment Methods");+ return;+ }+ cy.paymentMethodsCallTest(globalState);+ });++ cy.step("Confirm ACH Bank Debit", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: List Merchant Payment Methods");+ return;+ }+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "bank_debit_pm"+ ]["Ach"];+ cy.confirmCallTest(+ fixtures.confirmBody,+ confirmData,+ true,+ globalState+ );+ if (!utils.should_continue_further(confirmData)) {+ shouldContinue = false;+ }+ });+cy.step("Retrieve Payment", () => {if (!shouldContinue) {cy.task("cli_log", "Skipping step: Retrieve Payment");return;}- cy.retrievePaymentCallTest({ globalState });+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "bank_debit_pm"+ ]["Ach"];+ cy.retrievePaymentCallTest({ globalState, data: confirmData });+ if (!utils.should_continue_further(confirmData)) {+ shouldContinue = false;+ }+ });+ });+ });++ context("BECS Bank Debit Create and Confirm flow test", () => {+ it("Create Payment Intent -> List Merchant Payment Methods -> Confirm BECS Bank Debit -> Retrieve Payment", () => {+ let shouldContinue = true;++ cy.step("Create Payment Intent for BECS", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "bank_debit_pm"+ ]["PaymentIntent"]("Becs");+ cy.createPaymentIntentTest(+ fixtures.createPaymentBody,+ data,+ "no_three_ds",+ "automatic",+ globalState+ );+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("List Merchant Payment Methods", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: List Merchant Payment Methods");+ return;+ }+ cy.paymentMethodsCallTest(globalState);+ });++ cy.step("Confirm BECS Bank Debit", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: List Merchant Payment Methods");+ return;+ }+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "bank_debit_pm"+ ]["Becs"];+ cy.confirmCallTest(+ fixtures.confirmBody,+ confirmData,+ true,+ globalState+ );+ if (!utils.should_continue_further(confirmData)) {+ shouldContinue = false;+ }+ });++ cy.step("Retrieve Payment", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Retrieve Payment");+ return;+ }+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "bank_debit_pm"+ ]["Becs"];+ cy.retrievePaymentCallTest({ globalState, data: confirmData });+ if (!utils.should_continue_further(confirmData)) {+ shouldContinue = false;+ }+ });+ });+ });++ context("BACS Bank Debit Create and Confirm flow test", () => {+ it("Create Payment Intent -> List Merchant Payment Methods -> Confirm BACS Bank Debit -> Retrieve Payment", () => {+ let shouldContinue = true;++ cy.step("Create Payment Intent for BACS", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "bank_debit_pm"+ ]["PaymentIntent"]("Bacs");+ cy.createPaymentIntentTest(+ fixtures.createPaymentBody,+ data,+ "no_three_ds",+ "automatic",+ globalState+ );+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("List Merchant Payment Methods", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: List Merchant Payment Methods");+ return;+ }+ cy.paymentMethodsCallTest(globalState);+ });++ cy.step("Confirm BACS Bank Debit", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: List Merchant Payment Methods");+ return;+ }+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "bank_debit_pm"+ ]["Bacs"];+ cy.confirmCallTest(+ fixtures.confirmBody,+ confirmData,+ true,+ globalState+ );+ if (!utils.should_continue_further(confirmData)) {+ shouldContinue = false;+ }+ });++ cy.step("Retrieve Payment", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Retrieve Payment");+ return;+ }+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "bank_debit_pm"+ ]["Bacs"];+ cy.retrievePaymentCallTest({ globalState, data: confirmData });+ if (!utils.should_continue_further(confirmData)) {+ shouldContinue = false;+ }});});});