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
test(cypress): add network_transaction_link_id assertions for Nuvei (#14447)
Vasanth2ac5e8e91bbf
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Nuvei.js b/cypress-tests/cypress/e2e/configs/Payment/Nuvei.jsindex 76619dfc73..659c1583b8 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Nuvei.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Nuvei.js@@ -152,6 +152,8 @@ export const connectorDetails = {status: "succeeded",payment_method: "card",attempt_count: 1,+ // Placeholder value: asserts the field is a non-empty string in the response (actual TLID is dynamic per transaction)+ network_transaction_link_id: "dynamic_tlid",},},},@@ -181,6 +183,8 @@ export const connectorDetails = {payment_method: "card",attempt_count: 1,// payment_method_data removed - Nuvei returns dynamic card metadata (issuer, country) that varies per transaction+ // Placeholder value: asserts the field is a non-empty string in the response (actual TLID is dynamic per transaction)+ network_transaction_link_id: "dynamic_tlid",},},},@@ -250,6 +254,8 @@ export const connectorDetails = {amount: 11500,amount_capturable: 0,amount_received: 11500,+ // Placeholder value: asserts the field is a non-empty string in the response (actual TLID is dynamic per transaction)+ network_transaction_link_id: "dynamic_tlid",},},},diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.jsindex 762ac510c6..5ecee3d071 100644--- a/cypress-tests/cypress/support/commands.js+++ b/cypress-tests/cypress/support/commands.js@@ -3577,7 +3577,13 @@ Cypress.Commands.add(response.body[key]?.card?.auth_code,"payment_method_data.card.auth_code").to.be.a("string").and.not.be.empty;- } else if (key === "payment_account_reference") {+ } else if (+ key === "payment_account_reference" ||+ key === "network_transaction_link_id"+ ) {+ // Connector-generated dynamic values (e.g. TLID, PAR) cannot be+ // deep-compared; configs use a non-null placeholder ("dynamic_tlid",+ // "dynamic_par") to assert the field is populated, and null to assert it is absent.if (resData.body[key] === null) {expect(response.body[key], [key]).to.be.null;} else {@@ -3681,7 +3687,13 @@ Cypress.Commands.add(response.body[key]?.card?.auth_code,"payment_method_data.card.auth_code").to.be.a("string").and.not.be.empty;- } else if (key === "payment_account_reference") {+ } else if (+ key === "payment_account_reference" ||+ key === "network_transaction_link_id"+ ) {+ // Connector-generated dynamic values (e.g. TLID, PAR) cannot be+ // deep-compared; configs use a non-null placeholder ("dynamic_tlid",+ // "dynamic_par") to assert the field is populated, and null to assert it is absent.if (resData.body[key] === null) {expect(response.body[key], [key]).to.be.null;} else {@@ -4441,7 +4453,13 @@ Cypress.Commands.add(response.body[key]?.card?.auth_code,"payment_method_data.card.auth_code").to.be.a("string").and.not.be.empty;- } else if (key === "payment_account_reference") {+ } else if (+ key === "payment_account_reference" ||+ key === "network_transaction_link_id"+ ) {+ // Connector-generated dynamic values (e.g. TLID, PAR) cannot be+ // deep-compared; configs use a non-null placeholder ("dynamic_tlid",+ // "dynamic_par") to assert the field is populated, and null to assert it is absent.if (resData.body[key] === null) {expect(response.body[key], [key]).to.be.null;} else {@@ -4515,7 +4533,13 @@ Cypress.Commands.add(response.body[key]?.card?.auth_code,"payment_method_data.card.auth_code").to.be.a("string").and.not.be.empty;- } else if (key === "payment_account_reference") {+ } else if (+ key === "payment_account_reference" ||+ key === "network_transaction_link_id"+ ) {+ // Connector-generated dynamic values (e.g. TLID, PAR) cannot be+ // deep-compared; configs use a non-null placeholder ("dynamic_tlid",+ // "dynamic_par") to assert the field is populated, and null to assert it is absent.if (resData.body[key] === null) {expect(response.body[key], [key]).to.be.null;} else {@@ -4794,7 +4818,13 @@ Cypress.Commands.add(response.body[key]?.card?.auth_code,"payment_method_data.card.auth_code").to.be.a("string").and.not.be.empty;- } else if (key === "payment_account_reference") {+ } else if (+ key === "payment_account_reference" ||+ key === "network_transaction_link_id"+ ) {+ // Connector-generated dynamic values (e.g. TLID, PAR) cannot be+ // deep-compared; configs use a non-null placeholder ("dynamic_tlid",+ // "dynamic_par") to assert the field is populated, and null to assert it is absent.if (resData.body[key] === null) {expect(response.body[key], [key]).to.be.null;} else {@@ -4989,6 +5019,26 @@ Cypress.Commands.add(}}+ if (+ resData.body &&+ Object.prototype.hasOwnProperty.call(+ resData.body,+ "network_transaction_link_id"+ )+ ) {+ if (resData.body.network_transaction_link_id === null) {+ expect(+ response.body.network_transaction_link_id,+ "network_transaction_link_id"+ ).to.be.null;+ } else {+ expect(+ response.body.network_transaction_link_id,+ "network_transaction_link_id"+ ).to.be.a("string").and.to.not.be.empty;+ }+ }+if (resData.body &&Object.prototype.hasOwnProperty.call(