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

fix(cypress): fix cypress throwing error when `connectorId` is not passed and miscellaneous fixes (#5746)

Pa1NarK4eec86949881
diff --git a/cypress-tests/cypress.config.js b/cypress-tests/cypress.config.js
index aec6bf2eb6..8e7eb77fe2 100644
--- a/cypress-tests/cypress.config.js
+++ b/cypress-tests/cypress.config.js
@@ -4,7 +4,7 @@ const path = require("path");
let globalState;
// Fetch from environment variable
-const connectorId = process.env.CYPRESS_CONNECTOR;
+const connectorId = process.env.CYPRESS_CONNECTOR || "service";
const reportName = process.env.REPORT_NAME || `${connectorId}_report`;
module.exports = defineConfig({
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Commons.js b/cypress-tests/cypress/e2e/PaymentUtils/Commons.js
index 9318480b64..f1c9614745 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Commons.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Commons.js
@@ -20,11 +20,13 @@ function normalise(input) {
// Add more known exceptions here
};
- if (exceptions[input.toLowerCase()]) {
- return exceptions[input.toLowerCase()];
- } else {
- return input;
+ if (typeof input !== "string") {
+ const spec_name = Cypress.spec.name.split("-")[1].split(".")[0];
+ return `${spec_name}`;
}
+
+ const lowerCaseInput = input.toLowerCase();
+ return exceptions[lowerCaseInput] || input;
}
const successfulNo3DSCardDetails = {
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Fiservemea.js b/cypress-tests/cypress/e2e/PaymentUtils/Fiservemea.js
index b648fbe3b4..a0d1f30e3e 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Fiservemea.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Fiservemea.js
@@ -1,164 +1,163 @@
const successfulNo3DSCardDetails = {
- card_number: "5204740000001002",
- card_exp_month: "10",
- card_exp_year: "24",
- card_holder_name: "Joseph Doe",
- card_cvc: "002",
- };
-
- export const connectorDetails = {
- card_pm: {
- PaymentIntent: {
- Request: {
- payment_method: "card",
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "EUR",
- customer_acceptance: null,
- setup_future_usage: "on_session",
- },
- Response: {
- status: 200,
- body: {
- status: "requires_payment_method",
- },
- },
+ card_number: "5204740000001002",
+ card_exp_month: "10",
+ card_exp_year: "24",
+ card_holder_name: "Joseph Doe",
+ card_cvc: "002",
+};
+
+export const connectorDetails = {
+ card_pm: {
+ PaymentIntent: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
},
- No3DSManualCapture: {
- Request: {
- payment_method: "card",
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "EUR",
- customer_acceptance: null,
- setup_future_usage: "on_session",
- },
- Response: {
- status: 200,
- body: {
- status: "requires_capture",
- },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
},
},
- No3DSAutoCapture: {
- Request: {
- payment_method: "card",
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "EUR",
- customer_acceptance: null,
- setup_future_usage: "on_session",
- },
- Response: {
- status: 200,
- body: {
- status: "succeeded",
- },
- },
+ },
+ No3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
},
- Capture: {
- Request: {
- payment_method: "card",
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "EUR",
- customer_acceptance: null,
- },
- Response: {
- status: 200,
- body: {
- status: "succeeded",
- amount: 6500,
- amount_capturable: 0,
- amount_received: 6500,
- },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
},
},
- PartialCapture: {
- Request: {},
- Response: {
- status: 200,
- body: {
- status: "partially_captured",
- amount: 6500,
- amount_capturable: 0,
- amount_received: 100,
- },
- },
+ },
+ No3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
},
- Void: {
- Request: {},
- Response: {
- status: 200,
- body: {
- status: "cancelled",
- },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
},
},
- Refund: {
- Request: {
- payment_method: "card",
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "EUR",
- customer_acceptance: null,
+ },
+ Capture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ amount: 6500,
+ amount_capturable: 0,
+ amount_received: 6500,
},
- Response: {
- status: 200,
- body: {
- status: "succeeded",
- },
+ },
+ },
+ PartialCapture: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "partially_captured",
+ amount: 6500,
+ amount_capturable: 0,
+ amount_received: 100,
},
},
- PartialRefund: {
- Request: {
- payment_method: "card",
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "EUR",
- customer_acceptance: null,
+ },
+ Void: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "cancelled",
},
- Response: {
- status: 200,
- body: {
- status: "succeeded",
- },
+ },
+ },
+ Refund: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
},
},
- SyncRefund: {
- Request: {
- payment_method: "card",
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "EUR",
- customer_acceptance: null,
+ },
+ PartialRefund: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
},
- Response: {
- status: 200,
- body: {
- status: "succeeded",
- },
+ },
+ },
+ SyncRefund: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
},
},
- ZeroAuthMandate: {
- Response: {
- status: 501,
- body: {
- error: {
- type: "invalid_request",
- message: "Setup Mandate flow for Fiservemea is not implemented",
- code: "IR_00",
- },
+ },
+ ZeroAuthMandate: {
+ Response: {
+ status: 501,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Setup Mandate flow for Fiservemea is not implemented",
+ code: "IR_00",
},
},
},
},
- };
-
\ No newline at end of file
+ },
+};
diff --git a/cypress-tests/cypress/e2e/RoutingTest/00002-RuleBasedRouting.cy.js b/cypress-tests/cypress/e2e/RoutingTest/00002-RuleBasedRouting.cy.js
index 320c5ed839..583573ba69 100644
--- a/cypress-tests/cypress/e2e/RoutingTest/00002-RuleBasedRouting.cy.js
+++ b/cypress-tests/cypress/e2e/RoutingTest/00002-RuleBasedRouting.cy.js
@@ -23,8 +23,6 @@ describe("Rule Based Routing Test", () => {
let res_data = data["Response"];
cy.createJWTToken(req_data, res_data, globalState);
- if (should_continue)
- should_continue = utils.should_continue_further(res_data);
});
it("merchant retrieve call", () => {
diff --git a/cypress-tests/package-lock.json b/cypress-tests/package-lock.json
index 42dacf23b2..abac33d9e3 100644
--- a/cypress-tests/package-lock.json
+++ b/cypress-tests/package-lock.json
@@ -12,7 +12,7 @@
"prettier": "^3.3.2"
},
"devDependencies": {
- "cypress": "^13.13.3",
+ "cypress": "^13.14.1",
"cypress-mochawesome-reporter": "^3.8.2",
"jsqr": "^1.4.0"
}
@@ -722,11 +722,12 @@
}
},
"node_modules/cypress": {
- "version": "13.13.3",
- "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.13.3.tgz",
- "integrity": "sha512-hUxPrdbJXhUOTzuML+y9Av7CKoYznbD83pt8g3klgpioEha0emfx4WNIuVRx0C76r0xV2MIwAW9WYiXfVJYFQw==",
+ "version": "13.14.1",
+ "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.14.1.tgz",
+ "integrity": "sha512-Wo+byPmjps66hACEH5udhXINEiN3qS3jWNGRzJOjrRJF3D0+YrcP2LVB1T7oYaVQM/S+eanqEvBWYc8cf7Vcbg==",
"dev": true,
"hasInstallScript": true,
+ "license": "MIT",
"dependencies": {
"@cypress/request": "^3.0.1",
"@cypress/xvfb": "^1.2.4",
diff --git a/cypress-tests/package.json b/cypress-tests/package.json
index 57b5b5cdc8..7bb40354ef 100644
--- a/cypress-tests/package.json
+++ b/cypress-tests/package.json
@@ -15,7 +15,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
- "cypress": "^13.13.3",
+ "cypress": "^13.14.1",
"cypress-mochawesome-reporter": "^3.8.2",
"jsqr": "^1.4.0"
},