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 feature_metadata coverage for bankofamerica (#12082)

HS-QUALIBOT2be42f499096
diff --git a/cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js b/cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js
index fd65a0fbd4..17766cb214 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js
@@ -748,6 +748,42 @@ export const connectorDetails = {
},
},
},
+ PaymentIntentWithFeatureMetadata: {
+ Request: {
+ currency: "USD",
+ amount: 6540,
+ feature_metadata: {
+ search_tags: ["qa-test", "feature-metadata-test", "automated"],
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ },
+ PaymentWithFeatureMetadata: {
+ Request: {
+ currency: "USD",
+ amount: 6540,
+ feature_metadata: {
+ search_tags: ["qa-test", "feature-metadata-test"],
+ },
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
},
pm_list: {
PmListResponse: {
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
index 2652ffa5ae..755187fe62 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
@@ -518,6 +518,7 @@ export const CONNECTOR_LISTS = {
"finix",
],
BILLING_DESCRIPTOR_INVALID_PHONE: ["nuvei"],
+ FEATURE_METADATA: ["bankofamerica"],
AUTO_RETRY: [
"cybersource",
"checkout",
diff --git a/cypress-tests/cypress/e2e/spec/Payment/51-FeatureMetadata.cy.js b/cypress-tests/cypress/e2e/spec/Payment/51-FeatureMetadata.cy.js
new file mode 100644
index 0000000000..29db267f0a
--- /dev/null
+++ b/cypress-tests/cypress/e2e/spec/Payment/51-FeatureMetadata.cy.js
@@ -0,0 +1,97 @@
+import * as fixtures from "../../../fixtures/imports";
+import State from "../../../utils/State";
+import getConnectorDetails, * as utils from "../../configs/Payment/Utils";
+
+let globalState;
+
+describe("Card - Feature Metadata payment flow test", () => {
+ before("seed global state", function () {
+ let skip = false;
+
+ cy.task("getGlobalState")
+ .then((state) => {
+ globalState = new State(state);
+ const connectorId = globalState.get("connectorId");
+
+ if (
+ utils.shouldIncludeConnector(
+ connectorId,
+ utils.CONNECTOR_LISTS.INCLUDE.FEATURE_METADATA
+ )
+ ) {
+ skip = true;
+ }
+ })
+ .then(() => {
+ if (skip) {
+ this.skip();
+ }
+ });
+ });
+
+ after("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ context(
+ "Create payment intent with feature_metadata and confirm payment with feature_metadata",
+ () => {
+ it("Create Payment Intent with feature_metadata → Create+Confirm Payment with feature_metadata → Retrieve Payment", () => {
+ let shouldContinue = true;
+
+ cy.step("Create Payment Intent with feature_metadata", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntentWithFeatureMetadata"];
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Create+Confirm Payment with feature_metadata", () => {
+ if (!shouldContinue) {
+ cy.task(
+ "cli_log",
+ "Skipping step: Create+Confirm Payment with feature_metadata"
+ );
+ return;
+ }
+
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentWithFeatureMetadata"];
+
+ cy.createConfirmPaymentTest(
+ fixtures.createConfirmPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ 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 });
+ });
+ });
+ }
+ );
+});
diff --git a/cypress-tests/cypress/fixtures/imports.js b/cypress-tests/cypress/fixtures/imports.js
index c9639e0e3b..9797131564 100644
--- a/cypress-tests/cypress/fixtures/imports.js
+++ b/cypress-tests/cypress/fixtures/imports.js
@@ -34,7 +34,7 @@ import paymentMethodCreate from "./modularPmService/modular-pm-service-pm-create
import paymentMethodUpdate from "./modularPmService/modular-pm-service-pm-update.json";
import paymentMethodSessionCreate from "./modularPmService/modular-pm-service-pms-create.json";
import paymentMethodSessionUpdate from "./modularPmService/modular-pm-service-update-pms-saved-pm.json";
-import paymentMethodSessionConfirm from "./modularPmService/modular-pm-service-pms-confim.json";
+import paymentMethodSessionConfirm from "./modularPmService/modular-pm-service-pms-confirm.json";
import modularPmServicePaymentsCall from "./modularPmService/modular-pm-service-payments-call.json";
export {
apiKeyCreateBody,
diff --git a/cypress-tests/cypress/fixtures/modularPmService/modular-pm-service-pms-confim.json b/cypress-tests/cypress/fixtures/modularPmService/modular-pm-service-pms-confirm.json
similarity index 100%
rename from cypress-tests/cypress/fixtures/modularPmService/modular-pm-service-pms-confim.json
rename to cypress-tests/cypress/fixtures/modularPmService/modular-pm-service-pms-confirm.json