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 requires_cvv coverage for bankofamerica (#12407)

HS-QUALIBOT1e6fe94c610e
diff --git a/cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js b/cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js
index c953b19b00..f40ab7abcb 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js
@@ -195,6 +195,27 @@ export const connectorDetails = {
},
},
},
+ ExtendedCardBin: {
+ Request: {
+ payment_method: "card",
+ payment_method_type: "credit",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ Configs: {
+ skipBillingAssertion: true,
+ },
+ },
Capture: {
Request: {
amount_to_capture: 6000,
@@ -844,6 +865,186 @@ export const connectorDetails = {
},
},
},
+ RequiresCVVOnSession: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ customer_acceptance: customerAcceptance,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ Configs: {
+ // BofA sandbox returns billing=null in retrieve response for on-session flows — skip billing assertion
+ skipBillingAssertion: true,
+ },
+ },
+ RequiresCVVOffSessionMandate: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ setup_future_usage: "off_session",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ RequiresCVVSavedCardWithCVV: {
+ Request: {
+ card_cvc: "123",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ RequiresCVVSavedCardWithoutCVV: {
+ Request: {
+ setup_future_usage: "off_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ RequiresCVVInvalidCVVShort: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: {
+ card_number: "4242424242424242",
+ card_exp_month: "12",
+ card_exp_year: "2030",
+ card_holder_name: "Test User",
+ card_cvc: "12",
+ },
+ },
+ currency: "USD",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ code: "IR_16",
+ message: "Invalid card_cvc length",
+ },
+ },
+ },
+ },
+ RequiresCVVInvalidCVVLong: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: {
+ card_number: "4242424242424242",
+ card_exp_month: "12",
+ card_exp_year: "2030",
+ card_holder_name: "Test User",
+ card_cvc: "12345",
+ },
+ },
+ currency: "USD",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ code: "IR_16",
+ message: "Invalid card_cvc length",
+ },
+ },
+ },
+ },
+ RequiresCVVInvalidCVVNonNumeric: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: {
+ card_number: "4242424242424242",
+ card_exp_month: "12",
+ card_exp_year: "2030",
+ card_holder_name: "Test User",
+ card_cvc: "abc",
+ },
+ },
+ currency: "USD",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ code: "IR_07",
+ message: "Invalid value provided: card_cvc",
+ },
+ },
+ },
+ },
+ RequiresCVVListPMOnSession: {
+ Response: { status: 200, body: { requires_cvv: true } },
+ },
+ RequiresCVVListPMOffSession: {
+ Response: { status: 200, body: { requires_cvv: false } },
+ },
+ RequiresCVVFalsePaymentIntent: {
+ Request: {
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "off_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ },
+ RequiresCVVFalseSavedCardWithoutCVV: {
+ Request: {
+ setup_future_usage: "off_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ RequiresCVVPaymentIntent: {
+ Request: {
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ },
CardTestingGuard: {
FailConfirm: {
Request: {
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
index 7686e070c5..61872a35e3 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
@@ -749,6 +749,7 @@ export const CONNECTOR_LISTS = {
PAYOUT_PRIORITY: ["adyenplatform"],
DELAYED_SESSION_TOKEN: ["trustpay", "payme"],
CLIENT_SESSION_VALIDATION: ["stripe"],
+ REQUIRES_CVV: ["bankofamerica"],
// Add more inclusion lists
},
};
diff --git a/cypress-tests/cypress/e2e/spec/Payment/42-RequiresCVV.cy.js b/cypress-tests/cypress/e2e/spec/Payment/42-RequiresCVV.cy.js
new file mode 100644
index 0000000000..35f01a3ab2
--- /dev/null
+++ b/cypress-tests/cypress/e2e/spec/Payment/42-RequiresCVV.cy.js
@@ -0,0 +1,382 @@
+import * as fixtures from "../../../fixtures/imports";
+import State from "../../../utils/State";
+import getConnectorDetails, * as utils from "../../configs/Payment/Utils";
+
+let globalState;
+
+describe("Superposition Config Tests (Requires CVV)", () => {
+ let specShouldSkip = false;
+
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ const connectorId = globalState.get("connectorId");
+ specShouldSkip = utils.shouldIncludeConnector(
+ connectorId,
+ utils.CONNECTOR_LISTS.INCLUDE.REQUIRES_CVV
+ );
+ });
+ });
+
+ beforeEach(function () {
+ if (specShouldSkip) {
+ this.skip();
+ }
+ });
+
+ after("cleanup configs + flush global state", () => {
+ cy.deleteSuperpositionConfig(globalState, {
+ provider_merchant_id: globalState.get("merchantId"),
+ processor_merchant_id: globalState.get("merchantId"),
+ });
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ context(
+ "Set requires_cvv=true via superposition — verify on-session saved card requires CVV",
+ () => {
+ let shouldContinue = true;
+
+ beforeEach(function () {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ });
+
+ it("Create Customer", () => {
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
+ });
+
+ it("Set requires_cvv=true via superposition", () => {
+ cy.setSuperpositionConfig(globalState, "requires_cvv", true, {
+ provider_merchant_id: globalState.get("merchantId"),
+ processor_merchant_id: globalState.get("merchantId"),
+ });
+ });
+
+ it("Create Payment Intent", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVPaymentIntent"];
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ it("Payment Methods Call", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("Confirm — save card on_session with CVV", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVOnSession"];
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ it("Retrieve Payment", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVOnSession"];
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
+
+ it("List Customer PM by client secret — verify requires_cvv=true", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVListPMOnSession"];
+ cy.listCustomerPMByClientSecret(globalState, data);
+ });
+
+ it("Create Payment Intent for saved card use", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ it("Payment Methods Call", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("Save Card Confirm with CVV — expect success", () => {
+ const saveCardBody = Cypress._.cloneDeep(fixtures.saveCardConfirmBody);
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVSavedCardWithCVV"];
+ cy.saveCardConfirmCallTest(saveCardBody, data, globalState);
+ });
+ }
+ );
+
+ context(
+ "Set requires_cvv=false via superposition — verify off-session saved card succeeds without CVV",
+ () => {
+ let shouldContinue = true;
+
+ beforeEach(function () {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ });
+
+ it("Create Customer", () => {
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
+ });
+
+ it("Set requires_cvv=false via superposition", () => {
+ cy.setSuperpositionConfig(globalState, "requires_cvv", false, {
+ provider_merchant_id: globalState.get("merchantId"),
+ processor_merchant_id: globalState.get("merchantId"),
+ });
+ });
+
+ it("Create Payment Intent (off_session)", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVFalsePaymentIntent"];
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ it("Payment Methods Call", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("Confirm — save card off_session (no CVV required)", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVOffSessionMandate"];
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ it("List Customer PM by client secret — verify requires_cvv=false", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVListPMOffSession"];
+ cy.listCustomerPMByClientSecret(globalState, data);
+ });
+
+ it("Create Payment Intent for saved card use (off_session)", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVFalsePaymentIntent"];
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ it("Payment Methods Call", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("List Customer PM — get fresh payment token for saved card use", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVListPMOffSession"];
+ cy.listCustomerPMByClientSecret(globalState, data);
+ });
+
+ it("Save Card Confirm without CVV — expect success", () => {
+ const saveCardBody = Cypress._.cloneDeep(fixtures.saveCardConfirmBody);
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVFalseSavedCardWithoutCVV"];
+ cy.saveCardConfirmCallTest(saveCardBody, data, globalState);
+ });
+ }
+ );
+
+ context(
+ "Delete requires_cvv config, verify default behavior reverts to true",
+ () => {
+ let shouldContinue = true;
+
+ beforeEach(function () {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ });
+
+ it("Delete requires_cvv config via superposition", () => {
+ cy.deleteSuperpositionConfig(globalState, {
+ provider_merchant_id: globalState.get("merchantId"),
+ processor_merchant_id: globalState.get("merchantId"),
+ });
+ });
+
+ it("Create Customer", () => {
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
+ });
+
+ it("Create Payment Intent", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVPaymentIntent"];
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ it("Payment Methods Call", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("Confirm — save card on_session with CVV", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVOnSession"];
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ it("List Customer PM — verify requires_cvv reverts to default (true)", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVListPMOnSession"];
+ cy.listCustomerPMByClientSecret(globalState, data);
+ });
+ }
+ );
+
+ context("Invalid CVV format validation", () => {
+ it("Confirm with short CVV (IR_16)", () => {
+ let shouldContinue = true;
+
+ cy.step("Create Payment Intent for short CVV test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVPaymentIntent"];
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm Payment with short CVV (expect 400 IR_16)", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm with short CVV");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVInvalidCVVShort"];
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+ });
+ });
+
+ it("Confirm with long CVV (IR_16)", () => {
+ let shouldContinue = true;
+
+ cy.step("Create Payment Intent for long CVV test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVPaymentIntent"];
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm Payment with long CVV (expect 400 IR_16)", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm with long CVV");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVInvalidCVVLong"];
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+ });
+ });
+
+ it("Confirm with non-numeric CVV (IR_07)", () => {
+ let shouldContinue = true;
+
+ cy.step("Create Payment Intent for non-numeric CVV test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVPaymentIntent"];
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Confirm Payment with non-numeric CVV (expect 400 IR_07)", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm with non-numeric CVV");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["RequiresCVVInvalidCVVNonNumeric"];
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+ });
+ });
+ });
+});
diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.js
index 8a560fe13b..5fe867b66d 100644
--- a/cypress-tests/cypress/support/commands.js
+++ b/cypress-tests/cypress/support/commands.js
@@ -6042,7 +6042,7 @@ Cypress.Commands.add("listCustomerPMCallTest", (globalState, order = 0) => {
});
});
-Cypress.Commands.add("listCustomerPMByClientSecret", (globalState) => {
+Cypress.Commands.add("listCustomerPMByClientSecret", (globalState, data) => {
const clientSecret = globalState.get("clientSecret");
const setupFutureUsage = globalState.get("setupFutureUsage");
@@ -6070,7 +6070,13 @@ Cypress.Commands.add("listCustomerPMByClientSecret", (globalState) => {
"payment_method_id"
).to.not.be.null;
- if (setupFutureUsage === "off_session") {
+ // Use config data if provided, otherwise fall back to setupFutureUsage logic
+ if (data?.Response?.body?.requires_cvv !== undefined) {
+ expect(
+ response.body.customer_payment_methods[0].requires_cvv,
+ "requires_cvv"
+ ).to.equal(data.Response.body.requires_cvv);
+ } else if (setupFutureUsage === "off_session") {
expect(
response.body.customer_payment_methods[0].requires_cvv,
"requires_cvv"
@@ -10832,6 +10838,167 @@ Cypress.Commands.add("retrieveNonExistentPayoutTest", (globalState) => {
});
});
+// ============================================
+// Superposition Config Commands
+// ============================================
+
+// Base command: PUT a superposition context override.
+// `context` is a plain object whose keys match the superposition dimension names
+// required by the target config (see dimension_config.rs for each config's dimensions).
+Cypress.Commands.add(
+ "createSuperpositionConfig",
+ (globalState, overrideKey, overrideValue, context) => {
+ const superpositionBaseUrl = globalState.get("superpositionBaseUrl");
+ const superpositionSecret = globalState.get("superpositionSecret");
+ const orgId = globalState.get("superpositionOrgId") || "hyperswitch";
+ const workspaceId =
+ globalState.get("superpositionWorkspaceId") || "hyperswitch";
+
+ if (!superpositionBaseUrl || !superpositionSecret) {
+ cy.task(
+ "cli_log",
+ "Superposition credentials not set (SUPERPOSITION_BASE_URL, SUPERPOSITION_SECRET) — skipping config set"
+ );
+ return;
+ }
+
+ cy.request({
+ method: "PUT",
+ url: `${superpositionBaseUrl}/context`,
+ headers: {
+ "User-Agent": "Mozilla/5.0",
+ "x-org-id": orgId,
+ "x-workspace": workspaceId,
+ "X-Superposition-Secret": superpositionSecret,
+ "Content-Type": "application/json",
+ },
+ body: {
+ override: { [overrideKey]: overrideValue },
+ context,
+ description: "test config",
+ change_reason: "automated test",
+ },
+ failOnStatusCode: false,
+ }).then((response) => {
+ logRequestId(response.headers["x-request-id"]);
+
+ cy.wrap(response).then(() => {
+ expect(response.status, "superposition_config_status").to.equal(200);
+ cy.task(
+ "cli_log",
+ `Superposition config set: ${overrideKey}=${overrideValue}, context=${JSON.stringify(context)}`
+ );
+ });
+ });
+ // Polling interval is 10 s in CI and 15 s in all other envs
+ cy.wait(15000);
+ }
+);
+
+// Base command: DELETE a superposition context.
+// `context` must match the dimension context used when the override was created.
+Cypress.Commands.add("deleteSuperpositionContext", (globalState, context) => {
+ const superpositionBaseUrl = globalState.get("superpositionBaseUrl");
+ const superpositionSecret = globalState.get("superpositionSecret");
+ const orgId = globalState.get("superpositionOrgId") || "hyperswitch";
+ const workspaceId =
+ globalState.get("superpositionWorkspaceId") || "hyperswitch";
+
+ if (!superpositionBaseUrl || !superpositionSecret) {
+ cy.task(
+ "cli_log",
+ "Superposition credentials not set — skipping context delete"
+ );
+ return;
+ }
+
+ cy.request({
+ method: "DELETE",
+ url: `${superpositionBaseUrl}/context`,
+ headers: {
+ "User-Agent": "Mozilla/5.0",
+ "x-org-id": orgId,
+ "x-workspace": workspaceId,
+ "X-Superposition-Secret": superpositionSecret,
+ "Content-Type": "application/json",
+ },
+ body: { context },
+ failOnStatusCode: false,
+ }).then((response) => {
+ logRequestId(response.headers["x-request-id"]);
+
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ cy.task(
+ "cli_log",
+ `Superposition context deleted: ${JSON.stringify(context)}`
+ );
+ } else {
+ cy.task(
+ "cli_log",
+ `Superposition context delete returned ${response.status} (may not exist)`
+ );
+ }
+ });
+ });
+ // Polling interval is 10 s in CI and 15 s in all other envs
+ cy.wait(15000);
+});
+
+// Set an arbitrary superposition config.
+// `context` should match the dimensions required by the target config (see dimension_config.rs).
+// Example for requires_cvv (DimensionsWithProcessorAndProviderMerchantId):
+// { provider_merchant_id: merchantId, processor_merchant_id: merchantId }
+Cypress.Commands.add(
+ "setSuperpositionConfig",
+ (globalState, overrideKey, overrideValue, context) => {
+ cy.createSuperpositionConfig(
+ globalState,
+ overrideKey,
+ overrideValue,
+ context
+ );
+ }
+);
+
+// Delete a superposition config context.
+// `context` must match the dimensions used when the override was created.
+Cypress.Commands.add("deleteSuperpositionConfig", (globalState, context) => {
+ cy.deleteSuperpositionContext(globalState, context);
+});
+
+// Set enable_extended_card_bin for a profile.
+// Uses DimensionsWithProcessorAndProviderMerchantIdAndProfileId (see dimension_config.rs).
+Cypress.Commands.add(
+ "setExtendedCardBinConfig",
+ (globalState, value, profileId) => {
+ const context = {
+ provider_merchant_id: globalState.get("merchantId"),
+ processor_merchant_id: globalState.get("merchantId"),
+ profile_id: profileId || globalState.get("profileId"),
+ };
+ cy.createSuperpositionConfig(
+ globalState,
+ "enable_extended_card_bin",
+ value,
+ context
+ );
+ }
+);
+
+// Delete the enable_extended_card_bin superposition context for a profile.
+Cypress.Commands.add(
+ "deleteExtendedCardBinConfig",
+ (globalState, profileId) => {
+ const context = {
+ provider_merchant_id: globalState.get("merchantId"),
+ processor_merchant_id: globalState.get("merchantId"),
+ profile_id: profileId || globalState.get("profileId"),
+ };
+ cy.deleteSuperpositionContext(globalState, context);
+ }
+);
+
Cypress.Commands.add("resetRedirectReadCount", (testIdHash) => {
resetMitmRedirectSeq(testIdHash);
});
diff --git a/cypress-tests/cypress/utils/State.js b/cypress-tests/cypress/utils/State.js
index c8beded9db..484139a793 100644
--- a/cypress-tests/cypress/utils/State.js
+++ b/cypress-tests/cypress/utils/State.js
@@ -18,6 +18,13 @@ class State {
this.data["proxyHttps"] = Cypress.env("PROXY_HTTPS");
this.data["methodFlow"] = Cypress.env("METHOD_FLOW");
this.data["validationServiceUrl"] = Cypress.env("VALIDATION_SERVICE_URL");
+ this.data["superpositionBaseUrl"] = Cypress.env("SUPERPOSITION_BASE_URL");
+ this.data["superpositionSecret"] = Cypress.env("SUPERPOSITION_SECRET");
+ this.data["superpositionApiKey"] = Cypress.env("SUPERPOSITION_API_KEY");
+ this.data["superpositionOrgId"] = Cypress.env("SUPERPOSITION_ORG_ID");
+ this.data["superpositionWorkspaceId"] = Cypress.env(
+ "SUPERPOSITION_WORKSPACE_ID"
+ );
}
set(key, val) {