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

ci(cypress): add assertion for `connector_mandate_id` (#7474)

likhinbopanna44c0a5523598
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00019-MandatesUsingPMID.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00019-MandatesUsingPMID.cy.js
index 7f54afea48..196b5fb7c9 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/00019-MandatesUsingPMID.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/00019-MandatesUsingPMID.cy.js
@@ -29,7 +29,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
it("Create No 3DS Payment Intent", () => {
const data = getConnectorDetails(globalState.get("connectorId"))[
"card_pm"
- ]["PaymentIntent"];
+ ]["PaymentIntentOffSession"];
cy.createPaymentIntentTest(
fixtures.createPaymentBody,
@@ -93,7 +93,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {
it("Create No 3DS Payment Intent", () => {
const data = getConnectorDetails(globalState.get("connectorId"))[
"card_pm"
- ]["PaymentIntent"];
+ ]["PaymentIntentOffSession"];
cy.createPaymentIntentTest(
fixtures.createPaymentBody,
diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.js
index 2ec260e9a6..914841ea38 100644
--- a/cypress-tests/cypress/support/commands.js
+++ b/cypress-tests/cypress/support/commands.js
@@ -1559,6 +1559,7 @@ Cypress.Commands.add(
const merchantConnectorId = globalState.get(
`${configInfo.merchantConnectorPrefix}Id`
);
+ const setupFutureUsage = globalState.get("setupFutureUsage");
const paymentIntentID = globalState.get("paymentID");
const profileId = globalState.get(`${configInfo.profilePrefix}Id`);
const url = `${baseUrl}/payments/${paymentIntentID}/confirm`;
@@ -1625,6 +1626,12 @@ Cypress.Commands.add(
expect(resData.body[key], [key]).to.deep.equal(
response.body[key]
);
+ if (setupFutureUsage === "off_session") {
+ expect(
+ response.body.connector_mandate_id,
+ "connector_mandate_id"
+ ).to.not.be.null;
+ }
}
} else {
throw new Error(
@@ -1650,6 +1657,12 @@ Cypress.Commands.add(
expect(resData.body[key], [key]).to.deep.equal(
response.body[key]
);
+ if (setupFutureUsage === "off_session") {
+ expect(
+ response.body.connector_mandate_id,
+ "connector_mandate_id"
+ ).to.not.be.null;
+ }
}
} else {
throw new Error(
@@ -2455,6 +2468,7 @@ Cypress.Commands.add(
const merchant_connector_id = globalState.get(
`${configInfo.merchantConnectorPrefix}Id`
);
+ const setupFutureUsage = globalState.get("setupFutureUsage");
for (const key in reqData) {
requestBody[key] = reqData[key];
@@ -2526,6 +2540,12 @@ Cypress.Commands.add(
} else if (response.body.authentication_type === "no_three_ds") {
for (const key in resData.body) {
expect(resData.body[key]).to.equal(response.body[key]);
+ if (setupFutureUsage === "off_session") {
+ expect(
+ response.body.connector_mandate_id,
+ "connector_mandate_id"
+ ).to.not.be.null;
+ }
}
} else {
throw new Error(
@@ -2549,6 +2569,12 @@ Cypress.Commands.add(
} else if (response.body.authentication_type === "no_three_ds") {
for (const key in resData.body) {
expect(resData.body[key]).to.equal(response.body[key]);
+ if (setupFutureUsage === "off_session") {
+ expect(
+ response.body.connector_mandate_id,
+ "connector_mandate_id"
+ ).to.not.be.null;
+ }
}
} else {
throw new Error(