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

test(cypress): add bank debit sepa for novalnet (#11909)

HS-QUALIBOT42f0a2d34e33
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Commons.js b/cypress-tests/cypress/e2e/configs/Payment/Commons.js
index 4a55e24dcd..4232d7b833 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Commons.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Commons.js
@@ -323,6 +323,18 @@ export const payment_methods_enabled = [
},
],
},
+ {
+ payment_method: "bank_debit",
+ payment_method_types: [
+ {
+ payment_method_type: "sepa",
+ minimum_amount: 1,
+ maximum_amount: 68607706,
+ recurring_enabled: true,
+ installment_payment_enabled: true,
+ },
+ ],
+ },
{
payment_method: "bank_transfer",
payment_method_types: [
@@ -867,6 +879,105 @@ export const connectorDetails = {
},
}),
},
+ bank_debit_pm: {
+ PaymentIntent: (paymentMethodType) => {
+ const currencyMap = { Sepa: "EUR", Ach: "USD", Becs: "AUD", Bacs: "GBP" };
+ return getCustomExchange({
+ Request: {
+ currency: currencyMap[paymentMethodType] || "USD",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ });
+ },
+ SepaDebit: getCustomExchange({
+ Request: {
+ payment_method: "bank_debit",
+ payment_method_type: "sepa",
+ payment_method_data: {
+ bank_debit: {
+ sepa_bank_debit: {
+ iban: "DE89370400440532013000",
+ bank_account_holder_name: "Test Account",
+ },
+ },
+ },
+ billing: {
+ address: {
+ country: "DE",
+ },
+ email: "[email protected]",
+ },
+ },
+ }),
+ Ach: getCustomExchange({
+ Request: {
+ payment_method: "bank_debit",
+ payment_method_type: "ach",
+ payment_method_data: {
+ bank_debit: {
+ ach_bank_debit: {
+ account_number: "000123456789",
+ routing_number: "110000000",
+ bank_account_holder_name: "Test Account",
+ },
+ },
+ },
+ billing: {
+ address: {
+ country: "US",
+ },
+ email: "[email protected]",
+ },
+ },
+ }),
+ Becs: getCustomExchange({
+ 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: "Test Account",
+ },
+ },
+ },
+ billing: {
+ address: {
+ country: "AU",
+ },
+ email: "[email protected]",
+ },
+ },
+ }),
+ Bacs: getCustomExchange({
+ Request: {
+ payment_method: "bank_debit",
+ payment_method_type: "bacs",
+ payment_method_data: {
+ bank_debit: {
+ bacs_bank_debit: {
+ account_number: "00012345",
+ sort_code: "108800",
+ bank_account_holder_name: "Test Account",
+ },
+ },
+ },
+ billing: {
+ address: {
+ country: "GB",
+ },
+ email: "[email protected]",
+ },
+ },
+ }),
+ },
wallet_pm: {
PaymentIntent: (paymentMethodType) =>
getCustomExchange({
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Novalnet.js b/cypress-tests/cypress/e2e/configs/Payment/Novalnet.js
index a820f380bf..885f41a86b 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Novalnet.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Novalnet.js
@@ -758,6 +758,48 @@ export const connectorDetails = {
},
},
},
+ bank_debit_pm: {
+ PaymentIntent: (paymentMethodType) => {
+ const currencyMap = { Sepa: "EUR", Ach: "USD", Becs: "AUD", Bacs: "GBP" };
+ return {
+ Request: {
+ currency: currencyMap[paymentMethodType] || "USD",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ };
+ },
+ SepaDebit: {
+ Request: {
+ payment_method: "bank_debit",
+ payment_method_type: "sepa",
+ payment_method_data: {
+ bank_debit: {
+ sepa_bank_debit: {
+ iban: "DE24300209002411761956",
+ bank_account_holder_name: "Joseph Doe",
+ },
+ },
+ },
+ billing: {
+ email: "[email protected]",
+ address: {
+ country: "DE",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ },
webhook: {
TransactionIdConfig: {
// Defines how to locate and parse the payment reference ID from connector-specific webhook payloads
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
index 1a298dbae6..c0bd29ec6f 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
@@ -532,6 +532,7 @@ export const CONNECTOR_LISTS = {
"worldpayvantiv",
],
EXTERNAL_THREE_DS: ["stripe"],
+ BANK_DEBIT: ["novalnet"],
// Add more inclusion lists
},
};
diff --git a/cypress-tests/cypress/e2e/spec/Payment/44-BankDebit.cy.js b/cypress-tests/cypress/e2e/spec/Payment/44-BankDebit.cy.js
new file mode 100644
index 0000000000..ce75230636
--- /dev/null
+++ b/cypress-tests/cypress/e2e/spec/Payment/44-BankDebit.cy.js
@@ -0,0 +1,82 @@
+import * as fixtures from "../../../fixtures/imports";
+import State from "../../../utils/State";
+import getConnectorDetails, {
+ CONNECTOR_LISTS,
+ shouldIncludeConnector,
+} from "../../configs/Payment/Utils";
+import * as utils from "../../configs/Payment/Utils";
+
+let globalState;
+
+describe("Bank Debit tests", () => {
+ before("seed global state", function () {
+ let skip = false;
+
+ cy.task("getGlobalState")
+ .then((state) => {
+ globalState = new State(state);
+
+ if (
+ shouldIncludeConnector(
+ globalState.get("connectorId"),
+ CONNECTOR_LISTS.INCLUDE.BANK_DEBIT
+ )
+ ) {
+ skip = true;
+ }
+ })
+ .then(() => {
+ if (skip) {
+ this.skip();
+ }
+ });
+ });
+
+ afterEach("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ context("SEPA Bank Debit - Create and Confirm flow", () => {
+ it("Create Payment Intent -> Confirm SEPA Bank Debit -> Retrieve Payment", () => {
+ let shouldContinue = true;
+
+ cy.step("Create Payment Intent", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "bank_debit_pm"
+ ]["PaymentIntent"]("Sepa");
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm SEPA Bank Debit", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm SEPA Bank Debit");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "bank_debit_pm"
+ ]["SepaDebit"];
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Retrieve Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment");
+ return;
+ }
+ cy.retrievePaymentCallTest({ globalState });
+ });
+ });
+ });
+});