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
CI(cypress): Add Webhook Processing Tests for Connectors in Cypress (#10818)
Aniket Burman09d0e1e7fb2a
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Authorizedotnet.js b/cypress-tests/cypress/e2e/configs/Payment/Authorizedotnet.jsindex 3463e65685..52f9eda72a 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Authorizedotnet.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Authorizedotnet.js@@ -745,4 +745,12 @@ export const connectorDetails = {},},},+ webhook: {+ TransactionIdConfig: {+ // Defines how to locate and parse the payment reference ID from connector-specific webhook payloads+ path: "payload.id",+ // Type of payment reference ID+ type: "string",+ },+ },};diff --git a/cypress-tests/cypress/e2e/configs/Payment/Noon.js b/cypress-tests/cypress/e2e/configs/Payment/Noon.jsindex 4fea83ccc1..f152aec504 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Noon.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Noon.js@@ -732,4 +732,12 @@ export const connectorDetails = {},},},+ webhook: {+ TransactionIdConfig: {+ // Defines how to locate and parse the payment reference ID from connector-specific webhook payloads+ path: "orderId",+ // Type of payment reference ID+ type: "number",+ },+ },};diff --git a/cypress-tests/cypress/e2e/configs/Payment/Stripe.js b/cypress-tests/cypress/e2e/configs/Payment/Stripe.jsindex c540b4b7e9..df3fe72fcc 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Stripe.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Stripe.js@@ -1008,4 +1008,12 @@ export const connectorDetails = {pmListDynamicFieldWithEmail: requiredFields,},},+ webhook: {+ TransactionIdConfig: {+ // Defines how to locate and parse the payment reference ID from connector-specific webhook payloads+ path: "data.object.id",+ // Type of payment reference ID+ type: "string",+ },+ },};diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.jsindex bbf7a885fc..0596b65115 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js@@ -443,6 +443,7 @@ export const CONNECTOR_LISTS = {UCS_CONNECTORS: ["authorizedotnet"],OVERCAPTURE: ["adyen"],MANUAL_RETRY: ["cybersource"],+ PAYMENTS_WEBHOOK: ["noon", "stripe", "authorizedotnet"],// Add more inclusion lists},};@@ -455,3 +456,52 @@ export const shouldExcludeConnector = (connectorId, list) => {export const shouldIncludeConnector = (connectorId, list) => {return !list.includes(connectorId);};++export function setNormalizedValue(+ webhookBody,+ config,+ connectorTransactionID+) {+ if (!config?.path) {+ throw new Error("Invalid config: missing path");+ }+ // Split the dot-separated path into individual keys+ const keys = config.path.split(".");+ let target = webhookBody;++ // Traverse the object until the parent of the final key+ for (const key of keys.slice(0, -1)) {+ if (!Object.prototype.hasOwnProperty.call(target, key)) {+ throw new Error(`Path does not exist: ${config.path}`);+ }+ target = target[key];+ }+ // The final key where the normalized value will be assigned+ const finalKey = keys[keys.length - 1];++ // Coerce value based on expected type+ const normalizedconnectorTransactionID = coerceValue(+ connectorTransactionID,+ config.type+ );++ target[finalKey] = normalizedconnectorTransactionID;+}++function coerceValue(value, type) {+ switch (type) {+ case "string":+ return String(value);++ case "number": {+ const num = Number(value);+ if (!Number.isFinite(num)) {+ throw new Error(`Cannot coerce "${value}" to number`);+ }+ return num;+ }++ default:+ return value;+ }+}diff --git a/cypress-tests/cypress/e2e/spec/Payment/00004-NoThreeDSAutoCapture.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00004-NoThreeDSAutoCapture.cy.jsindex c2f5bb1082..78c23f4fe5 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00004-NoThreeDSAutoCapture.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00004-NoThreeDSAutoCapture.cy.js@@ -59,7 +59,7 @@ describe("Card - NoThreeDS payment flow test", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -93,7 +93,7 @@ describe("Card - NoThreeDS payment flow test", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -141,7 +141,7 @@ describe("Card - NoThreeDS payment flow test", () => {"card_pm"]["PaymentConfirmWithShippingCost"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});});diff --git a/cypress-tests/cypress/e2e/spec/Payment/00006-NoThreeDSManualCapture.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00006-NoThreeDSManualCapture.cy.jsindex 1a0f28981c..7db395953b 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00006-NoThreeDSManualCapture.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00006-NoThreeDSManualCapture.cy.js@@ -62,7 +62,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {"card_pm"]["No3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -81,7 +81,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -116,7 +116,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {"card_pm"]["No3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -135,7 +135,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});});@@ -189,7 +189,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {"card_pm"]["No3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -208,7 +208,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {"card_pm"]["PartialCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -243,7 +243,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {"card_pm"]["No3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -262,7 +262,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {"card_pm"]["PartialCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});}diff --git a/cypress-tests/cypress/e2e/spec/Payment/00007-VoidPayment.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00007-VoidPayment.cy.jsindex c298f16483..bf5f8d1ed0 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00007-VoidPayment.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00007-VoidPayment.cy.js@@ -59,7 +59,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {"card_pm"]["No3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("void-call-test", () => {const data = getConnectorDetails(globalState.get("connectorId"))[@@ -161,7 +161,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {"card_pm"]["No3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("void-call-test", () => {const data = getConnectorDetails(globalState.get("connectorId"))[diff --git a/cypress-tests/cypress/e2e/spec/Payment/00008-SyncPayment.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00008-SyncPayment.cy.jsindex c7da98909a..cb531871b7 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00008-SyncPayment.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00008-SyncPayment.cy.js@@ -56,6 +56,6 @@ describe("Card - Sync payment flow test", () => {const data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});diff --git a/cypress-tests/cypress/e2e/spec/Payment/00009-RefundPayment.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00009-RefundPayment.cy.jsindex d2da9e92ae..610893b2db 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00009-RefundPayment.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00009-RefundPayment.cy.js@@ -59,7 +59,7 @@ describe("Card - Refund flow - No 3DS", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {@@ -127,7 +127,7 @@ describe("Card - Refund flow - No 3DS", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {@@ -194,7 +194,7 @@ describe("Card - Refund flow - No 3DS", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {@@ -254,7 +254,7 @@ describe("Card - Refund flow - No 3DS", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {@@ -341,7 +341,7 @@ describe("Card - Refund flow - No 3DS", () => {"card_pm"]["No3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -359,7 +359,7 @@ describe("Card - Refund flow - No 3DS", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {@@ -432,7 +432,7 @@ describe("Card - Refund flow - No 3DS", () => {"card_pm"]["No3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -450,7 +450,7 @@ describe("Card - Refund flow - No 3DS", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {@@ -540,7 +540,7 @@ describe("Card - Refund flow - No 3DS", () => {"card_pm"]["No3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -558,7 +558,7 @@ describe("Card - Refund flow - No 3DS", () => {"card_pm"]["PartialCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {@@ -631,7 +631,7 @@ describe("Card - Refund flow - No 3DS", () => {"card_pm"]["No3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -649,7 +649,7 @@ describe("Card - Refund flow - No 3DS", () => {"card_pm"]["PartialCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {@@ -829,7 +829,7 @@ describe("Card - Refund flow - 3DS", () => {"card_pm"]["3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {@@ -902,7 +902,7 @@ describe("Card - Refund flow - 3DS", () => {"card_pm"]["3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {@@ -971,7 +971,7 @@ describe("Card - Refund flow - 3DS", () => {"card_pm"]["3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {@@ -1033,7 +1033,7 @@ describe("Card - Refund flow - 3DS", () => {"card_pm"]["3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {@@ -1120,7 +1120,7 @@ describe("Card - Refund flow - 3DS", () => {"card_pm"]["3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -1138,7 +1138,7 @@ describe("Card - Refund flow - 3DS", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {@@ -1211,7 +1211,7 @@ describe("Card - Refund flow - 3DS", () => {"card_pm"]["3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -1229,7 +1229,7 @@ describe("Card - Refund flow - 3DS", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {@@ -1311,7 +1311,7 @@ describe("Card - Refund flow - 3DS", () => {"card_pm"]["3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -1329,7 +1329,7 @@ describe("Card - Refund flow - 3DS", () => {"card_pm"]["PartialCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {@@ -1402,7 +1402,7 @@ describe("Card - Refund flow - 3DS", () => {"card_pm"]["3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -1420,7 +1420,7 @@ describe("Card - Refund flow - 3DS", () => {"card_pm"]["PartialCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {diff --git a/cypress-tests/cypress/e2e/spec/Payment/00010-SyncRefund.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00010-SyncRefund.cy.jsindex 1d1581de5c..1a322adfb6 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00010-SyncRefund.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00010-SyncRefund.cy.js@@ -58,7 +58,7 @@ describe("Card - Sync Refund flow test", () => {"No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("refund-call-test", () => {diff --git a/cypress-tests/cypress/e2e/spec/Payment/00014-SaveCardFlow.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00014-SaveCardFlow.cy.jsindex 259ff24143..d02d311d10 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00014-SaveCardFlow.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00014-SaveCardFlow.cy.js@@ -56,7 +56,7 @@ describe("Card - SaveCard payment flow test", () => {"card_pm"]["SaveCardUseNo3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("retrieve-customerPM-call-test", () => {@@ -131,7 +131,7 @@ describe("Card - SaveCard payment flow test", () => {"card_pm"]["SaveCardUseNo3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("retrieve-customerPM-call-test", () => {@@ -171,7 +171,7 @@ describe("Card - SaveCard payment flow test", () => {"card_pm"]["SaveCardUseNo3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -190,7 +190,7 @@ describe("Card - SaveCard payment flow test", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -233,7 +233,7 @@ describe("Card - SaveCard payment flow test", () => {"card_pm"]["SaveCardUseNo3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("retrieve-customerPM-call-test", () => {@@ -272,7 +272,7 @@ describe("Card - SaveCard payment flow test", () => {"card_pm"]["SaveCardUseNo3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -291,7 +291,7 @@ describe("Card - SaveCard payment flow test", () => {"card_pm"]["PartialCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -334,7 +334,7 @@ describe("Card - SaveCard payment flow test", () => {"card_pm"]["SaveCardUseNo3DSAutoCaptureOffSession"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("retrieve-customerPM-call-test", () => {@@ -409,7 +409,7 @@ describe("Card - SaveCard payment flow test", () => {"card_pm"]["SaveCardUseNo3DSManualCaptureOffSession"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {const data = getConnectorDetails(globalState.get("connectorId"))[@@ -427,7 +427,7 @@ describe("Card - SaveCard payment flow test", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("retrieve-customerPM-call-test", () => {@@ -467,7 +467,7 @@ describe("Card - SaveCard payment flow test", () => {"card_pm"]["SaveCardConfirmManualCaptureOffSession"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -486,7 +486,7 @@ describe("Card - SaveCard payment flow test", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -540,7 +540,7 @@ describe("Card - SaveCard payment flow test", () => {"card_pm"]["SaveCardUseNo3DSAutoCaptureOffSession"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("retrieve-customerPM-call-test", () => {diff --git a/cypress-tests/cypress/e2e/spec/Payment/00015-ZeroAuthMandate.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00015-ZeroAuthMandate.cy.jsindex b330b251c1..ca4a48a150 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00015-ZeroAuthMandate.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00015-ZeroAuthMandate.cy.js@@ -54,7 +54,7 @@ describe("Card - SingleUse Mandates flow test", () => {"card_pm"]["ZeroAuthMandate"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Confirm No 3DS MIT", () => {@@ -77,7 +77,7 @@ describe("Card - SingleUse Mandates flow test", () => {"card_pm"]["MITAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -116,7 +116,7 @@ describe("Card - SingleUse Mandates flow test", () => {"card_pm"]["ZeroAuthMandate"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Confirm No 3DS MIT", () => {@@ -139,7 +139,7 @@ describe("Card - SingleUse Mandates flow test", () => {"card_pm"]["MITAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Confirm No 3DS MIT", () => {@@ -162,7 +162,7 @@ describe("Card - SingleUse Mandates flow test", () => {"card_pm"]["MITAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -207,7 +207,7 @@ describe("Card - SingleUse Mandates flow test", () => {"card_pm"]["ZeroAuthConfirmPayment"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Retrieve CustomerPM Call Test", () => {@@ -249,7 +249,7 @@ describe("Card - SingleUse Mandates flow test", () => {"card_pm"]["SaveCardConfirmAutoCaptureOffSession"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -301,7 +301,7 @@ describe("Card - SingleUse Mandates flow test", () => {"card_pm"]["ZeroAuthMandate"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Confirm No 3DS MIT", () => {@@ -324,7 +324,7 @@ describe("Card - SingleUse Mandates flow test", () => {"card_pm"]["MITAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Confirm No 3DS MIT", () => {@@ -347,7 +347,7 @@ describe("Card - SingleUse Mandates flow test", () => {"card_pm"]["MITAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -388,7 +388,7 @@ describe("Card - SingleUse Mandates flow test", () => {"card_pm"]["ZeroAuthMandate"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Confirm No 3DS MIT", () => {@@ -411,7 +411,7 @@ describe("Card - SingleUse Mandates flow test", () => {"card_pm"]["MITAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});});diff --git a/cypress-tests/cypress/e2e/spec/Payment/00016-ThreeDSManualCapture.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00016-ThreeDSManualCapture.cy.jsindex 41d33f5c25..e907bd6245 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00016-ThreeDSManualCapture.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00016-ThreeDSManualCapture.cy.js@@ -67,7 +67,7 @@ describe("Card - ThreeDS Manual payment flow test", () => {"card_pm"]["3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -86,7 +86,7 @@ describe("Card - ThreeDS Manual payment flow test", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -127,7 +127,7 @@ describe("Card - ThreeDS Manual payment flow test", () => {"card_pm"]["3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -146,7 +146,7 @@ describe("Card - ThreeDS Manual payment flow test", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});});@@ -205,7 +205,7 @@ describe("Card - ThreeDS Manual payment flow test", () => {"card_pm"]["3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -224,7 +224,7 @@ describe("Card - ThreeDS Manual payment flow test", () => {"card_pm"]["PartialCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -265,7 +265,7 @@ describe("Card - ThreeDS Manual payment flow test", () => {"card_pm"]["3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("capture-call-test", () => {@@ -284,7 +284,7 @@ describe("Card - ThreeDS Manual payment flow test", () => {"card_pm"]["PartialCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});}diff --git a/cypress-tests/cypress/e2e/spec/Payment/00018-BankRedirect.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00018-BankRedirect.cy.jsindex e402de4bec..05ba578524 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00018-BankRedirect.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00018-BankRedirect.cy.js@@ -430,7 +430,7 @@ describe("Bank Redirect tests", () => {"bank_redirect_pm"]["OnlineBankingFpx"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});diff --git a/cypress-tests/cypress/e2e/spec/Payment/00019-MandatesUsingPMID.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00019-MandatesUsingPMID.cy.jsindex 849ebd7df2..2650df6273 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00019-MandatesUsingPMID.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00019-MandatesUsingPMID.cy.js@@ -71,7 +71,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {"card_pm"]["PaymentMethodIdMandateNo3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Confirm No 3DS MIT", () => {@@ -94,7 +94,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {"card_pm"]["MITAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -162,7 +162,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Confirm No 3DS MIT", () => {@@ -185,7 +185,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {"card_pm"]["MITAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -225,7 +225,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {"card_pm"]["PaymentMethodIdMandateNo3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Confirm No 3DS MIT", () => {@@ -248,7 +248,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {"card_pm"]["MITAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Confirm No 3DS MIT", () => {@@ -271,7 +271,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {"card_pm"]["MITAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -322,7 +322,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Confirm No 3DS MIT 1", () => {@@ -359,7 +359,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Confirm No 3DS MIT 2", () => {@@ -393,7 +393,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -497,7 +497,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {"card_pm"]["PaymentMethodIdMandate3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Confirm No 3DS MIT", () => {@@ -583,7 +583,7 @@ describe("Card - Mandates using Payment Method Id flow test", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Confirm No 3DS MIT", () => {diff --git a/cypress-tests/cypress/e2e/spec/Payment/00021-UPI.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00021-UPI.cy.jsindex b021f28bec..21290d45d5 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00021-UPI.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00021-UPI.cy.js@@ -70,7 +70,7 @@ describe("UPI Payments - Hyperswitch", () => {"upi_pm"]["UpiCollect"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Refund payment", () => {@@ -150,7 +150,7 @@ describe("UPI Payments - Hyperswitch", () => {"upi_pm"]["UpiIntent"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});});diff --git a/cypress-tests/cypress/e2e/spec/Payment/00022-Variations.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00022-Variations.cy.jsindex ac62bb55d6..236e2732c8 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00022-Variations.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00022-Variations.cy.js@@ -266,7 +266,7 @@ describe("Corner cases", () => {"card_pm"]["No3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Capture call", () => {@@ -320,7 +320,7 @@ describe("Corner cases", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Capture call", () => {@@ -374,7 +374,7 @@ describe("Corner cases", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Confirm call", () => {@@ -428,7 +428,7 @@ describe("Corner cases", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Void call", () => {@@ -494,7 +494,7 @@ describe("Corner cases", () => {"card_pm"]["3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Handle redirection", () => {@@ -507,7 +507,7 @@ describe("Corner cases", () => {"card_pm"]["3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Capture call", () => {@@ -561,7 +561,7 @@ describe("Corner cases", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Refund call", () => {@@ -614,7 +614,7 @@ describe("Corner cases", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Refund call", () => {@@ -678,7 +678,7 @@ describe("Corner cases", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Confirm No 3DS MIT", () => {@@ -775,7 +775,7 @@ describe("Corner cases", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Create a payment with a duplicate payment ID", () => {@@ -826,7 +826,7 @@ describe("Corner cases", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Create new refund", () => {diff --git a/cypress-tests/cypress/e2e/spec/Payment/00026-DeletedCustomerPsyncFlow.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00026-DeletedCustomerPsyncFlow.cy.jsindex 07f285cadf..18d2eeb958 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00026-DeletedCustomerPsyncFlow.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00026-DeletedCustomerPsyncFlow.cy.js@@ -62,7 +62,7 @@ describe("Card - Customer Deletion and Psync", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Delete Customer", () => {@@ -74,7 +74,7 @@ describe("Card - Customer Deletion and Psync", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -139,7 +139,7 @@ describe("Card - Customer Deletion and Psync", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Delete Customer", () => {@@ -151,7 +151,7 @@ describe("Card - Customer Deletion and Psync", () => {"card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});});@@ -203,7 +203,7 @@ describe("Card - Customer Deletion and Psync", () => {"card_pm"]["No3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Capture Payment", () => {@@ -222,7 +222,7 @@ describe("Card - Customer Deletion and Psync", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Delete Customer", () => {@@ -234,7 +234,7 @@ describe("Card - Customer Deletion and Psync", () => {"card_pm"]["No3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -299,7 +299,7 @@ describe("Card - Customer Deletion and Psync", () => {"card_pm"]["3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Capture Payment", () => {@@ -318,7 +318,7 @@ describe("Card - Customer Deletion and Psync", () => {"card_pm"]["Capture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("Delete Customer", () => {@@ -330,7 +330,7 @@ describe("Card - Customer Deletion and Psync", () => {"card_pm"]["3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});});diff --git a/cypress-tests/cypress/e2e/spec/Payment/00029-Overcapture.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00029-Overcapture.cy.jsindex 1eb9aa17e6..a3b4bdee0a 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00029-Overcapture.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00029-Overcapture.cy.js@@ -87,7 +87,7 @@ describe("[Payment] Overcapture", () => {"card_pm"]["Overcapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});});diff --git a/cypress-tests/cypress/e2e/spec/Payment/00036-RewardPayment.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00036-RewardPayment.cy.jsindex 4bc761e92f..4ebe5cbbd1 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00036-RewardPayment.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00036-RewardPayment.cy.js@@ -73,7 +73,7 @@ describe("Reward Payment - Cashtocode", () => {"reward_pm"]["Evoucher"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -131,7 +131,7 @@ describe("Reward Payment - Cashtocode", () => {"reward_pm"]["Classic"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});});diff --git a/cypress-tests/cypress/e2e/spec/Payment/00037-CryptoPayment.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00037-CryptoPayment.cy.jsindex 0899c24724..7567dd4c73 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00037-CryptoPayment.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00037-CryptoPayment.cy.js@@ -69,7 +69,7 @@ describe("Crypto Payment", () => {});it("Retrieve Payment Call Test", () => {- cy.retrievePaymentCallTest(globalState);+ cy.retrievePaymentCallTest({ globalState });});});@@ -123,7 +123,7 @@ describe("Crypto Payment", () => {});it("Retrieve Payment Call Test", () => {- cy.retrievePaymentCallTest(globalState);+ cy.retrievePaymentCallTest({ globalState });});});});diff --git a/cypress-tests/cypress/e2e/spec/Payment/00039-PaymentWebhookFixture.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00039-PaymentWebhookFixture.cy.jsnew file mode 100644index 0000000000..0fb7854c26--- /dev/null+++ b/cypress-tests/cypress/e2e/spec/Payment/00039-PaymentWebhookFixture.cy.js@@ -0,0 +1,119 @@+import * as fixtures from "../../../fixtures/imports";+import State from "../../../utils/State";+import getConnectorDetails, * as utils from "../../configs/Payment/Utils";++let globalState;+let connector;+let expectedIntentStatus;++describe("Payment Webhook Tests", () => {+ before("seed global state", function () {+ let skip = false;++ cy.task("getGlobalState")+ .then((state) => {+ globalState = new State(state);+ connector = globalState.get("connectorId");++ if (+ utils.shouldIncludeConnector(+ connector,+ utils.CONNECTOR_LISTS.INCLUDE.PAYMENTS_WEBHOOK+ )+ ) {+ skip = true;+ }+ })+ .then(() => {+ if (skip) {+ this.skip();+ }+ });+ });++ after("flush global state", () => {+ cy.task("setGlobalState", globalState.data);+ });++ context("NoThreeDS Manual payment flow test", () => {+ it("create-payment-call-test", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["PaymentIntent"];++ cy.createPaymentIntentTest(+ fixtures.createPaymentBody,+ data,+ "no_three_ds",+ "automatic",+ globalState+ );+ });++ it("payment_methods-call-test", () => {+ cy.paymentMethodsCallTest(globalState);+ });++ it("Confirm No 3DS", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["No3DSAutoCapture"];++ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState).then(+ () => {+ expectedIntentStatus = globalState.get("paymentIntentStatus");+ }+ );+ });+ });++ context("Webhook Processing - Status Update & Retrieval", () => {+ let paymentId;+ let merchantId;++ before(() => {+ connector = globalState.get("connectorId");+ merchantId = globalState.get("merchantId");+ paymentId = globalState.get("paymentID");+ });++ it("Update-payment_status", () => {+ const PaymentsManualUpdateRequestBody = {+ attempt_status: "pending",+ attempt_id: `${paymentId}_1`,+ merchant_id: merchantId,+ payment_id: paymentId,+ };++ cy.manualPaymentStatusUpdateTest(+ globalState,+ PaymentsManualUpdateRequestBody+ );+ });++ it("send-webhook", () => {+ // Clone webhook fixture+ const webhookBody = structuredClone(+ fixtures.IncomingWebhookBody.webhookBodies[connector]["payment"]+ );++ // Extract webhook reference ID configuration for the specified connector+ // This config defines how to locate and parse the payment reference ID from connector-specific webhook payloads+ const data =+ getConnectorDetails(connector)["webhook"]["TransactionIdConfig"];++ // Normalize transaction ID+ utils.setNormalizedValue(+ webhookBody,+ data,+ globalState.get("connectorTransactionID")+ );++ cy.IncomingWebhookTest(globalState, webhookBody);+ });++ it("Retrieve Payment Call Test", () => {+ cy.retrievePaymentCallTest({ globalState, expectedIntentStatus });+ });+ });+});diff --git a/cypress-tests/cypress/e2e/spec/Routing/00000-PriorityRouting.cy.js b/cypress-tests/cypress/e2e/spec/Routing/00000-PriorityRouting.cy.jsindex a070592d76..3afd6ee25f 100644--- a/cypress-tests/cypress/e2e/spec/Routing/00000-PriorityRouting.cy.js+++ b/cypress-tests/cypress/e2e/spec/Routing/00000-PriorityRouting.cy.js@@ -125,7 +125,7 @@ describe("Priority Based Routing Test", () => {});it("retrieve-payment-call-test", () => {- cy.retrievePaymentCallTest(globalState, null);+ cy.retrievePaymentCallTest({ globalState });});});@@ -203,7 +203,7 @@ describe("Priority Based Routing Test", () => {});it("retrieve-payment-call-test", () => {- cy.retrievePaymentCallTest(globalState, null);+ cy.retrievePaymentCallTest({ globalState });});});});diff --git a/cypress-tests/cypress/e2e/spec/Routing/00001-VolumeBasedRouting.cy.js b/cypress-tests/cypress/e2e/spec/Routing/00001-VolumeBasedRouting.cy.jsindex 67411c7056..6638365fa1 100644--- a/cypress-tests/cypress/e2e/spec/Routing/00001-VolumeBasedRouting.cy.js+++ b/cypress-tests/cypress/e2e/spec/Routing/00001-VolumeBasedRouting.cy.js@@ -119,7 +119,7 @@ describe("Volume Based Routing Test", () => {});it("retrieve-payment-call-test", () => {- cy.retrievePaymentCallTest(globalState, null);+ cy.retrievePaymentCallTest({ globalState });});it("create-payment-call-test-for-eps", () => {@@ -234,7 +234,7 @@ describe("Volume Based Routing Test", () => {});it("retrieve-payment-call-test", () => {- cy.retrievePaymentCallTest(globalState, null);+ cy.retrievePaymentCallTest({ globalState });});it("create-payment-call-test-for-eps", () => {diff --git a/cypress-tests/cypress/e2e/spec/Routing/00002-RuleBasedRouting.cy.js b/cypress-tests/cypress/e2e/spec/Routing/00002-RuleBasedRouting.cy.jsindex 30b877aee3..62db937f6d 100644--- a/cypress-tests/cypress/e2e/spec/Routing/00002-RuleBasedRouting.cy.js+++ b/cypress-tests/cypress/e2e/spec/Routing/00002-RuleBasedRouting.cy.js@@ -173,7 +173,7 @@ describe("Rule Based Routing Test", () => {});it("retrieve-payment-call-test", () => {- cy.retrievePaymentCallTest(globalState, null);+ cy.retrievePaymentCallTest({ globalState });});it("create-payment-routing-test for bank redirect", () => {@@ -322,7 +322,7 @@ describe("Rule Based Routing Test", () => {});it("retrieve-payment-call-test", () => {- cy.retrievePaymentCallTest(globalState, null);+ cy.retrievePaymentCallTest({ globalState });});it("create-payment-call-test-with-EUR", () => {@@ -346,7 +346,7 @@ describe("Rule Based Routing Test", () => {});it("retrieve-payment-call-test", () => {- cy.retrievePaymentCallTest(globalState, null);+ cy.retrievePaymentCallTest({ globalState });});});@@ -477,7 +477,7 @@ describe("Rule Based Routing Test", () => {});it("retrieve-payment-call-test", () => {- cy.retrievePaymentCallTest(globalState, null);+ cy.retrievePaymentCallTest({ globalState });});it("create-payment-call-test-with-amount-9", () => {@@ -500,7 +500,7 @@ describe("Rule Based Routing Test", () => {cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);it("retrieve-payment-call-test", () => {- cy.retrievePaymentCallTest(globalState, null);+ cy.retrievePaymentCallTest({ globalState });});});}diff --git a/cypress-tests/cypress/e2e/spec/Routing/00003-Retries.cy.js b/cypress-tests/cypress/e2e/spec/Routing/00003-Retries.cy.jsindex 0e4eaed7c3..4f5c0e1755 100644--- a/cypress-tests/cypress/e2e/spec/Routing/00003-Retries.cy.js+++ b/cypress-tests/cypress/e2e/spec/Routing/00003-Retries.cy.js@@ -163,12 +163,12 @@ describe("Auto Retries & Step Up 3DS", () => {});it("Payment retrieve call", () => {- cy.retrievePaymentCallTest(+ cy.retrievePaymentCallTest({globalState,- null,- true,- maxAutoRetries + 1- );+ data: null,+ autoretries: true,+ attempt: maxAutoRetries + 1,+ });});});});@@ -216,12 +216,12 @@ describe("Auto Retries & Step Up 3DS", () => {});it("Payment retrieve call", () => {- cy.retrievePaymentCallTest(+ cy.retrievePaymentCallTest({globalState,- null,- true,- maxAutoRetries + 1- );+ data: null,+ autoretries: true,+ attempt: maxAutoRetries + 1,+ });});});});@@ -268,12 +268,12 @@ describe("Auto Retries & Step Up 3DS", () => {});it("Payment retrieve call", () => {- cy.retrievePaymentCallTest(+ cy.retrievePaymentCallTest({globalState,- null,- true,- maxAutoRetries + 1- );+ data: null,+ autoretries: true,+ attempt: maxAutoRetries + 1,+ });});});});@@ -368,12 +368,12 @@ describe("Auto Retries & Step Up 3DS", () => {});it("Payment retrieve call", () => {- cy.retrievePaymentCallTest(+ cy.retrievePaymentCallTest({globalState,- null,- true,- maxAutoRetries + 1- );+ data: null,+ autoretries: true,+ attempt: maxAutoRetries + 1,+ });});});});@@ -421,12 +421,12 @@ describe("Auto Retries & Step Up 3DS", () => {});it("Payment retrieve call", () => {- cy.retrievePaymentCallTest(+ cy.retrievePaymentCallTest({globalState,- null,- true,- maxAutoRetries + 1- );+ data: null,+ autoretries: true,+ attempt: maxAutoRetries + 1,+ });});});});@@ -474,12 +474,12 @@ describe("Auto Retries & Step Up 3DS", () => {});it("Payment retrieve call", () => {- cy.retrievePaymentCallTest(+ cy.retrievePaymentCallTest({globalState,- null,- true,- maxAutoRetries + 1- );+ data: null,+ autoretries: true,+ attempt: maxAutoRetries + 1,+ });});});});@@ -540,12 +540,12 @@ describe("Auto Retries & Step Up 3DS", () => {});it("Payment retrieve call", () => {- cy.retrievePaymentCallTest(+ cy.retrievePaymentCallTest({globalState,- null,- true,- maxAutoRetries + 1- );+ data: null,+ autoretries: true,+ attempt: maxAutoRetries + 1,+ });});});});@@ -593,7 +593,7 @@ describe("Auto Retries & Step Up 3DS", () => {});it("Payment retrieve call", () => {- cy.retrievePaymentCallTest(globalState, null, true);+ cy.retrievePaymentCallTest({ globalState, autoretries: true });});});@@ -623,7 +623,7 @@ describe("Auto Retries & Step Up 3DS", () => {});it("Payment retrieve call", () => {- cy.retrievePaymentCallTest(globalState, null, true);+ cy.retrievePaymentCallTest({ globalState, autoretries: true });});});});diff --git a/cypress-tests/cypress/e2e/spec/UnifiedConnectorService/0001-UCSComprehensiveTest.cy.js b/cypress-tests/cypress/e2e/spec/UnifiedConnectorService/0001-UCSComprehensiveTest.cy.jsindex f02259960a..907f3f73c9 100644--- a/cypress-tests/cypress/e2e/spec/UnifiedConnectorService/0001-UCSComprehensiveTest.cy.js+++ b/cypress-tests/cypress/e2e/spec/UnifiedConnectorService/0001-UCSComprehensiveTest.cy.js@@ -86,7 +86,7 @@ describe("UCS Comprehensive Test", () => {const data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});it("create+confirm-payment-call-test", () => {@@ -106,7 +106,7 @@ describe("UCS Comprehensive Test", () => {const data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSAutoCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});@@ -177,7 +177,7 @@ describe("UCS Comprehensive Test", () => {const data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSManualCapture"];- cy.retrievePaymentCallTest(globalState, data);+ cy.retrievePaymentCallTest({ globalState, data });});});diff --git a/cypress-tests/cypress/fixtures/imports.js b/cypress-tests/cypress/fixtures/imports.jsindex fa46991646..6fe1b9a54c 100644--- a/cypress-tests/cypress/fixtures/imports.js+++ b/cypress-tests/cypress/fixtures/imports.js@@ -26,6 +26,7 @@ import voidBody from "./void-payment-body.json";import ntidConfirmBody from "./create-ntid-mit.json";import blocklistCreateBody from "./blocklist-create-body.json";import eligibilityCheckBody from "./eligibility-check-body.json";+import * as IncomingWebhookBody from "./webhooks/import";export {apiKeyCreateBody,@@ -56,4 +57,5 @@ export {sessionTokenBody,updateConnectorBody,voidBody,+ IncomingWebhookBody,};diff --git a/cypress-tests/cypress/fixtures/webhooks/authorizedotnet_payment_webhook.json b/cypress-tests/cypress/fixtures/webhooks/authorizedotnet_payment_webhook.jsonnew file mode 100644index 0000000000..510255941b--- /dev/null+++ b/cypress-tests/cypress/fixtures/webhooks/authorizedotnet_payment_webhook.json@@ -0,0 +1,15 @@+{+ "notificationId": "d0e8e7fe-c3e7-4add-a480-27bc5ce28a18",+ "eventType": "net.authorize.payment.authcapture.created",+ "eventDate": "2017-03-29T20:48:02.0080095Z",+ "webhookId": "63d6fea2-aa13-4b1d-a204-f5fbc15942b7",+ "payload": {+ "responseCode": 1,+ "merchantReferenceId": "19102146534003137356",+ "authCode": "LZ6I19",+ "avsResponse": "Y",+ "authAmount": 45.0,+ "entityName": "transaction",+ "id": "{{connector_transaction_id}}"+ }+}diff --git a/cypress-tests/cypress/fixtures/webhooks/import.js b/cypress-tests/cypress/fixtures/webhooks/import.jsnew file mode 100644index 0000000000..59f5114e1f--- /dev/null+++ b/cypress-tests/cypress/fixtures/webhooks/import.js@@ -0,0 +1,15 @@+import stripePayment from "./stripe_payment_webhook.json";+import noonPayment from "./noon_payment_webhook.json";+import authorizedotnetPayment from "./authorizedotnet_payment_webhook.json";++export const webhookBodies = {+ stripe: {+ payment: stripePayment,+ },+ noon: {+ payment: noonPayment,+ },+ authorizedotnet: {+ payment: authorizedotnetPayment,+ },+};diff --git a/cypress-tests/cypress/fixtures/webhooks/noon_payment_webhook.json b/cypress-tests/cypress/fixtures/webhooks/noon_payment_webhook.jsonnew file mode 100644index 0000000000..63e74c0da9--- /dev/null+++ b/cypress-tests/cypress/fixtures/webhooks/noon_payment_webhook.json@@ -0,0 +1,13 @@+{+ "signature": "dGVzdF9zaWduYXR1cmU=",+ "orderId": "{{connector_transaction_id}}",+ "orderStatus": "AUTHORIZED",+ "eventType": "Fail",+ "eventId": "89d5cdd4-6f12-4ca4-b0ea-a3a14fbf49b2",+ "timeStamp": "2025-09-08T10:30:18.8451Z",+ "merchantOrderRef": "TR1234567890",+ "txnAmount": 400,+ "txnId": "473703108481",+ "txnRef": "91757884853710001",+ "merchantTxnRef": "auth-123"+}diff --git a/cypress-tests/cypress/fixtures/webhooks/stripe_payment_webhook.json b/cypress-tests/cypress/fixtures/webhooks/stripe_payment_webhook.jsonnew file mode 100644index 0000000000..d6cce5a225--- /dev/null+++ b/cypress-tests/cypress/fixtures/webhooks/stripe_payment_webhook.json@@ -0,0 +1,50 @@+{+ "id": "evt_1NG8Du2eZvKYlo2CUI79vXWy",+ "object": "event",+ "api_version": "2019-02-19",+ "created": 1686089970,+ "data": {+ "object": {+ "id": "{{connector_transaction_id}}",+ "object": "payment_intent",+ "application": null,+ "automatic_payment_methods": null,+ "cancellation_reason": null,+ "client_secret": "seti_1NG8Du2eZvKYlo2C9XMqbR0x_secret_O2CdhLwGFh2Aej7bCY7qp8jlIuyR8DJ",+ "created": 1686089970,+ "customer": null,+ "description": null,+ "flow_directions": null,+ "last_setup_error": null,+ "latest_attempt": null,+ "livemode": false,+ "mandate": null,+ "metadata": {},+ "next_action": null,+ "on_behalf_of": null,+ "payment_method": "pm_1NG8Du2eZvKYlo2CYzzldNr7",+ "payment_method_options": {+ "acss_debit": {+ "currency": "cad",+ "mandate_options": {+ "interval_description": "First day of every month",+ "payment_schedule": "interval",+ "transaction_type": "personal"+ },+ "verification_method": "automatic"+ }+ },+ "payment_method_types": ["acss_debit"],+ "single_use_mandate": null,+ "status": "requires_confirmation",+ "usage": "off_session"+ }+ },+ "livemode": false,+ "pending_webhooks": 0,+ "request": {+ "id": null,+ "idempotency_key": null+ },+ "type": "payment_intent.succeeded"+}diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.jsindex e62ae945ea..ce57a2b86d 100644--- a/cypress-tests/cypress/support/commands.js+++ b/cypress-tests/cypress/support/commands.js@@ -2054,6 +2054,11 @@ Cypress.Commands.add(if (response.status === 200) {globalState.set("paymentID", paymentIntentID);globalState.set("connectorId", response.body.connector);+ globalState.set(+ "connectorTransactionID",+ response.body.connector_transaction_id+ );+ globalState.set("paymentIntentStatus", response.body.status);expect(response.body.connector, "connector").to.equal(globalState.get("connectorId"));@@ -2832,7 +2837,13 @@ Cypress.Commands.add("voidCallTest", (requestBody, data, globalState) => {Cypress.Commands.add("retrievePaymentCallTest",- (globalState, data, autoretries = false, attempt = 1) => {+ ({+ globalState,+ data = null,+ autoretries = false,+ attempt = 1,+ expectedIntentStatus,+ }) => {const { Configs: configs = {} } = data || {};const configInfo = execConfig(validateConfig(configs));@@ -2866,6 +2877,13 @@ Cypress.Commands.add(expect(response.body.billing, "billing_address").to.not.be.null;expect(response.body.customer, "customer").to.not.be.empty;+ if (expectedIntentStatus) {+ expect(+ response.body.status,+ "payment status should match stored intent_status"+ ).to.equal(expectedIntentStatus);+ }+if (["succeeded", "processing", "requires_customer_action"].includes(response.body.status@@ -5106,3 +5124,71 @@ Cypress.Commands.add("diffCheckResult", (globalState) => {});});});++Cypress.Commands.add(+ "manualPaymentStatusUpdateTest",+ (globalState, PaymentsManualUpdateRequestBody) => {+ const merchantId = globalState.get("merchantId");+ const paymentId = globalState.get("paymentID");+ const completeUrl = `${Cypress.env("BASEURL")}/payments/${paymentId}/manual-update`;+ const adminApiKey = globalState.get("adminApiKey");++ cy.request({+ method: "PUT",+ url: completeUrl,+ headers: {+ "Content-Type": "application/json",+ "api-key": adminApiKey,+ "X-Merchant-Id": merchantId,+ },+ body: PaymentsManualUpdateRequestBody,+ failOnStatusCode: false,+ }).then((response) => {+ logRequestId(response.headers["x-request-id"]);++ cy.wrap(response).then(() => {+ expect(response.headers["content-type"]).to.include("application/json");+ if (response.status === 200) {+ expect(response.status).to.eq(200);+ expect(response.body.payment_id).to.equal(paymentId);+ expect(response.body.merchant_id).to.equal(merchantId);+ expect(response.body.attempt_status).to.equal(+ PaymentsManualUpdateRequestBody.attempt_status+ );+ } else {+ throw new Error(+ `Payment Update Call Failed with error code "${response.body.error.code}" error message "${response.body.error.message}"`+ );+ }+ });+ });+ }+);++Cypress.Commands.add("IncomingWebhookTest", (globalState, webhookPayload) => {+ const connector = globalState.get("connectorId");+ const merchantId = globalState.get("merchantId");+ const completeUrl = `${Cypress.env("BASEURL")}/webhooks/${merchantId}/${connector}`;++ // Send webhook POST request+ return cy+ .request({+ method: "POST",+ url: completeUrl,+ headers: { "Content-Type": "application/json" },+ body: webhookPayload,+ failOnStatusCode: false,+ })+ .then((response) => {+ logRequestId(response.headers["x-request-id"]);++ return cy.wrap(response).then(() => {+ // Throw for failed status+ if (response.status !== 200) {+ throw new Error(+ `Webhook failed with error code "${response.body.error.code}" error message "${response.body.error.message}"`+ );+ }+ });+ });+});