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): fix webhook for novalnet (#13558)

Vasanth37132f423763
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
index ee9a06552e..5c7a01af82 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
@@ -825,6 +825,9 @@ function coerceValue(value, type) {
if (!Number.isFinite(num)) {
throw new Error(`Cannot coerce "${value}" to number`);
}
+ if (!Number.isSafeInteger(num)) {
+ return BigInt(value);
+ }
return num;
}
@@ -833,6 +836,12 @@ function coerceValue(value, type) {
}
}
+export function stringifyWithBigInt(obj) {
+ return JSON.stringify(obj, (_, value) =>
+ typeof value === "bigint" ? `__bigint__${value}` : value
+ ).replace(/"__bigint__(\d+)"/g, "$1");
+}
+
export function stampPaymentMethodType(scenarios, paymentMethodType) {
const cloned = JSON.parse(JSON.stringify(scenarios));
for (const scenario of Object.values(cloned)) {
diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.js
index db72de936b..abfdd2a250 100644
--- a/cypress-tests/cypress/support/commands.js
+++ b/cypress-tests/cypress/support/commands.js
@@ -32,6 +32,7 @@ import getConnectorDetails, {
getValueByKey,
injectHelcimTestCard,
setNormalizedValue,
+ stringifyWithBigInt,
} from "../e2e/configs/Payment/Utils";
import { execConfig, validateConfig } from "../utils/featureFlags";
import * as RequestBodyUtils from "../utils/RequestBodyUtils";
@@ -8143,7 +8144,7 @@ Cypress.Commands.add(
([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`
)
.join("&")
- : webhookBody;
+ : stringifyWithBigInt(webhookBody);
const headers = {
"Content-Type": contentType,