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 Vault Tokenization Disable coverage for stripe (#13407)
HS-QUALIBOT9d5f615e9d78
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Stripe.js b/cypress-tests/cypress/e2e/configs/Payment/Stripe.jsindex c7e1814827..968d4f8f6b 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Stripe.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Stripe.js@@ -2060,6 +2060,43 @@ export const connectorDetails = {},}),},+ vault_tokenization: {+ // The should_disable_vault_tokenization flag is toggled via+ // cy.setConfigs() in the spec's before hook — it is NOT part of the+ // payment request body. Both disabled (flag=true) and enabled+ // (flag=false) states produce the same API-observable outcome+ // (status=succeeded, authentication_type=three_ds), so both test+ // cases share a single exchange definition.+ VaultTokenization: getCustomExchange({+ Request: {+ payment_method: "card",+ payment_method_data: { card: externalThreeDSCardDetails },+ currency: "USD",+ amount: 6500,+ authentication_type: "three_ds",+ request_external_three_ds_authentication: true,+ three_ds_data: {+ authentication_cryptogram: {+ cavv: {+ authentication_cryptogram: "3q2+78r+ur7erb7vyv66vv////8=",+ },+ },+ ds_trans_id: "c4e59ceb-a382-4d6a-bc87-385d591fa09d",+ version: "2.1.0",+ eci: "05",+ transaction_status: "Y",+ exemption_indicator: "low_value",+ },+ },+ Response: {+ status: 200,+ body: {+ status: "succeeded",+ authentication_type: "three_ds",+ },+ },+ }),+ },pm_list: {PmListResponse: {PmListNull: {diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.jsindex 3ef8465bb9..1c08bcd245 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js@@ -715,6 +715,7 @@ export const CONNECTOR_LISTS = {PAYJUSTNOW: ["payjustnow"],PAYJUSTNOWINSTORE: ["payjustnowinstore"],AUTH_SERVICE_ELIGIBILITY: ["stripe", "cybersource"],+ VAULT_TOKENIZATION: ["stripe"],STEP_UP_AUTH: ["cybersource"],PARTIAL_AUTH: ["nuvei", "checkout", "worldpayvantiv"],PAYMENT_RESPONSE_HASH: ["stripe"],diff --git a/cypress-tests/cypress/e2e/spec/Payment/56-VaultTokenizationDisable.cy.js b/cypress-tests/cypress/e2e/spec/Payment/56-VaultTokenizationDisable.cy.jsnew file mode 100644index 0000000000..9d642ca5a6--- /dev/null+++ b/cypress-tests/cypress/e2e/spec/Payment/56-VaultTokenizationDisable.cy.js@@ -0,0 +1,118 @@+import * as fixtures from "../../../fixtures/imports";+import State from "../../../utils/State";+import getConnectorDetails, {+ CONNECTOR_LISTS,+ shouldIncludeConnector,+} from "../../configs/Payment/Utils";+import { payment_methods_enabled } from "../../configs/Payment/Commons";++let globalState;++describe("Vault Tokenization Disable", () => {+ 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.VAULT_TOKENIZATION+ )+ ) {+ skip = true;+ }+ })+ .then(() => {+ if (skip) {+ this.skip();+ }+ })+ .then(() => {+ cy.createBusinessProfileTest(+ fixtures.businessProfile.bpCreate,+ globalState+ );+ cy.createConnectorCallTest(+ "payment_processor",+ fixtures.createConnectorBody,+ payment_methods_enabled,+ globalState+ );+ });+ });++ after("flush global state", () => {+ cy.task("setGlobalState", globalState.data);+ });++ context("Vault tokenization disabled - flag set to true", () => {+ before("set should_disable_vault_tokenization to true", () => {+ const merchantId = globalState.get("merchantId");+ const key = `should_disable_vault_tokenization_${merchantId}`;+ cy.setConfigs(globalState, key, "true", "CREATE");+ });++ it("should confirm external 3DS payment with vault tokenization disabled", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))+ .vault_tokenization.VaultTokenization;+ cy.createConfirmPaymentTest(+ fixtures.createConfirmPaymentBody,+ data,+ "three_ds",+ "automatic",+ globalState+ );+ });++ it("retrieve-payment-call-test", () => {+ cy.retrievePaymentCallTest({ globalState });+ });++ after("cleanup vault tokenization config", () => {+ const merchantId = globalState.get("merchantId");+ cy.setConfigs(+ globalState,+ `should_disable_vault_tokenization_${merchantId}`,+ "true",+ "DELETE"+ );+ });+ });++ context("Vault tokenization enabled - flag set to false", () => {+ before("set should_disable_vault_tokenization to false", () => {+ const merchantId = globalState.get("merchantId");+ const key = `should_disable_vault_tokenization_${merchantId}`;+ cy.setConfigs(globalState, key, "false", "CREATE");+ });++ it("should confirm external 3DS payment with vault tokenization enabled", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))+ .vault_tokenization.VaultTokenization;+ cy.createConfirmPaymentTest(+ fixtures.createConfirmPaymentBody,+ data,+ "three_ds",+ "automatic",+ globalState+ );+ });++ it("retrieve-payment-call-test", () => {+ cy.retrievePaymentCallTest({ globalState });+ });++ after("cleanup vault tokenization config", () => {+ const merchantId = globalState.get("merchantId");+ cy.setConfigs(+ globalState,+ `should_disable_vault_tokenization_${merchantId}`,+ "false",+ "DELETE"+ );+ });+ });+});