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): Added volt cypress (#10718)
Vasanthcb90dd5f96d0
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Commons.js b/cypress-tests/cypress/e2e/configs/Payment/Commons.jsindex 1d9f2b767b..2f3e3adf9c 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Commons.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Commons.js@@ -221,6 +221,17 @@ export const payment_methods_enabled = [recurring_enabled: true,installment_payment_enabled: true,},+ {+ payment_method_type: "open_banking_uk",+ payment_experience: null,+ card_networks: null,+ accepted_currencies: null,+ accepted_countries: null,+ minimum_amount: 1,+ maximum_amount: 68607706,+ recurring_enabled: true,+ installment_payment_enabled: true,+ },{payment_method_type: "online_banking_fpx",payment_experience: null,@@ -606,6 +617,21 @@ export const connectorDetails = {},},}),+ OpenBankingUk: getCustomExchange({+ Request: {+ payment_method: "bank_redirect",+ payment_method_type: "open_banking_uk",+ payment_method_data: {+ bank_redirect: {+ open_banking_uk: {+ issuer: "citi",+ country: "GB",+ },+ },+ },+ billing: standardBillingAddress,+ },+ }),OnlineBankingFpx: getCustomExchange({Request: {payment_method: "bank_redirect",diff --git a/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js b/cypress-tests/cypress/e2e/configs/Payment/Modifiers.jsindex fb6eee785f..79fbb674af 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js@@ -125,6 +125,7 @@ const CURRENCY_MAP = {Klarna: "EUR",Przelewy24: "EUR",Sofort: "EUR",+ OpenBankingUk: "GBP", // Great British Pound payment methodOnlineBankingFpx: "MYR", // Malaysian payment methods};diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.jsindex b6cd2626e3..d27ac50a57 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js@@ -64,6 +64,7 @@ import { connectorDetails as tesouroConnectorDetails } from "./Tesouro.js";import { connectorDetails as trustpayConnectorDetails } from "./Trustpay.js";import { connectorDetails as trustpaymentsConnectorDetails } from "./TrustPayments.js";import { connectorDetails as tsysConnectorDetails } from "./Tsys.js";+import { connectorDetails as voltConnectorDetails } from "./Volt.js";import { connectorDetails as wellsfargoConnectorDetails } from "./WellsFargo.js";import { connectorDetails as worldpayConnectorDetails } from "./WorldPay.js";import { connectorDetails as worldpayvantivConnectorDetails } from "./Worldpayvantiv.js";@@ -133,6 +134,7 @@ const connectorDetails = {tesouro: tesouroConnectorDetails,trustpayments: trustpaymentsConnectorDetails,tsys: tsysConnectorDetails,+ volt: voltConnectorDetails,wellsfargo: wellsfargoConnectorDetails,worldpay: worldpayConnectorDetails,worldpayvantiv: worldpayvantivConnectorDetails,diff --git a/cypress-tests/cypress/e2e/configs/Payment/Volt.js b/cypress-tests/cypress/e2e/configs/Payment/Volt.jsnew file mode 100644index 0000000000..8aaa1172b8--- /dev/null+++ b/cypress-tests/cypress/e2e/configs/Payment/Volt.js@@ -0,0 +1,95 @@+import { standardBillingAddress } from "./Commons";++const zeroAuthResponse = {+ status: 501,+ body: {+ error: {+ message: "Setup Mandate flow for Volt is not implemented",+ code: "IR_00",+ type: "invalid_request",+ },+ },+};++const zeroAuthConfigs = {+ TRIGGER_SKIP: true,+};++const zeroAuthConfirmPayment = {+ Request: {+ payment_type: "setup_mandate",+ payment_method: "card",+ payment_method_data: {+ card: {+ card_number: "4242424242424242",+ card_exp_month: "01",+ card_exp_year: "50",+ card_holder_name: "joseph Doe",+ card_cvc: "123",+ },+ },+ },+ Response: zeroAuthResponse,+ Configs: zeroAuthConfigs,+};++const zeroAuthMandate = {+ Configs: zeroAuthConfigs,+ Response: zeroAuthResponse,+};++const listRevokeMandate = {+ Configs: zeroAuthConfigs,+ Response: zeroAuthResponse,+};++export const connectorDetails = {+ card_pm: {+ ZeroAuthPaymentIntent: {+ Request: {+ amount: 0,+ setup_future_usage: "off_session",+ currency: "USD",+ payment_type: "setup_mandate",+ },+ Response: {+ status: 200,+ body: {+ status: "requires_payment_method",+ setup_future_usage: "off_session",+ },+ },+ },+ ZeroAuthConfirmPayment: zeroAuthConfirmPayment,+ ZeroAuthMandate: zeroAuthMandate,+ ListRevokeMandate: listRevokeMandate,+ },+ bank_redirect_pm: {+ OpenBankingUk: {+ Request: {+ payment_method: "bank_redirect",+ amount: 6000,+ currency: "GBP",+ payment_method_type: "open_banking_uk",+ payment_method_data: {+ bank_redirect: {+ open_banking_uk: {+ issuer: "citi",+ country: "GB",+ },+ },+ },+ billing: standardBillingAddress,+ },+ Response: {+ status: 200,+ body: {+ status: "requires_customer_action",+ payment_method_type: "open_banking_uk",+ payment_method_type_display_name: "Open Banking",+ connector: "volt",+ },+ },+ },+ },+};diff --git a/cypress-tests/cypress/e2e/spec/Payment/00018-BankRedirect.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00018-BankRedirect.cy.jsindex 328a357dd6..5c4851c32e 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00018-BankRedirect.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00018-BankRedirect.cy.js@@ -301,6 +301,71 @@ describe("Bank Redirect tests", () => {});});+ context("OpenBankingUk Create and Confirm flow test", () => {+ let shouldContinue = true; // variable that will be used to skip tests if a previous test fails++ before("seed global state", () => {+ cy.task("getGlobalState").then((state) => {+ globalState = new State(state);+ });+ });++ beforeEach(function () {+ if (!shouldContinue) {+ this.skip();+ }+ });++ it("create-payment-call-test", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "bank_redirect_pm"+ ]["PaymentIntent"]("OpenBankingUk");+ cy.createPaymentIntentTest(+ fixtures.createPaymentBody,+ data,+ "three_ds",+ "automatic",+ globalState+ );+ if (shouldContinue) shouldContinue = utils.should_continue_further(data);+ });++ it("payment_methods-call-test", () => {+ cy.paymentMethodsCallTest(globalState);+ });++ it("Confirm bank redirect", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "bank_redirect_pm"+ ]["OpenBankingUk"];+ cy.confirmBankRedirectCallTest(+ fixtures.confirmBody,+ data,+ true,+ globalState+ );+ if (shouldContinue) shouldContinue = utils.should_continue_further(data);+ });++ it("Handle bank redirect redirection", () => {+ const expected_redirection = fixtures.confirmBody["return_url"];+ const payment_method_type = globalState.get("paymentMethodType");+ cy.handleBankRedirectRedirection(+ globalState,+ payment_method_type,+ expected_redirection+ );+ });++ it("Sync payment status", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "bank_redirect_pm"+ ]["OpenBankingUk"];++ cy.retrievePaymentCallTest(globalState, data);+ });+ });+context("OnlineBankingFpx Create and Confirm flow test", () => {let shouldContinue = true; // variable that will be used to skip tests if a previous test failsdiff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.jsindex 8888b81a6f..e62ae945ea 100644--- a/cypress-tests/cypress/support/commands.js+++ b/cypress-tests/cypress/support/commands.js@@ -23,7 +23,6 @@//// -- This will overwrite an existing command --// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })-// commands.js or your custom support fileimport {defaultErrorHandler,diff --git a/cypress-tests/cypress/support/redirectionHandler.js b/cypress-tests/cypress/support/redirectionHandler.jsindex e16ea17977..2730a3fe3e 100644--- a/cypress-tests/cypress/support/redirectionHandler.js+++ b/cypress-tests/cypress/support/redirectionHandler.js@@ -687,6 +687,40 @@ function bankRedirectRedirection(}break;+ case "volt":+ if (paymentMethodType === "open_banking_uk") {+ cy.log("Handling Volt OpenBankingUk redirect flow");+ const clickableSelector =+ "button, [role='button'], div[role='option'], li, span, label";+ const selectBank = () =>+ cy+ .contains(clickableSelector, /Barclays Sandbox/i, {+ timeout: constants.TIMEOUT,+ })+ .scrollIntoView()+ .should("be.visible")+ .then(($el) => {+ const candidate = $el.closest(clickableSelector);+ if (candidate.length) {+ cy.wrap(candidate).click();+ } else {+ cy.wrap($el).click();+ }+ });+ selectBank();+ cy.contains("button, a", /Continue on Desktop/i, {+ timeout: constants.TIMEOUT,+ })+ .should("be.visible")+ .click();+ verifyUrl = true;+ } else {+ throw new Error(+ `Unsupported Volt payment method type: ${paymentMethodType}`+ );+ }+ break;+case "fiuu":if (paymentMethodType === "online_banking_fpx") {cy.log("Handling FIUU OnlineBankingFpx redirect flow");