@fat-zebra/sdk 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to the Fat Zebra JS SDK will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.1.2] - 2026-06-17
9
+
10
+ ### Fixed
11
+
12
+ - Fixed a bug where the 3DS device data collection step could hang indefinitely due to an unexpected Cybersource payload format
13
+
8
14
  ## [2.1.0] - 2026-06-03
9
15
 
10
16
  > **Upgrade recommended.** This release fixes a critical issue where the React SDK could silently fall back to the legacy 3DS API, which is being decommissioned. Merchants should upgrade to avoid potential production failures.
@@ -58,13 +58,18 @@ class DeviceDataCollection {
58
58
  this.handleCollectionResponse(event);
59
59
  }
60
60
  static handleCollectionResponse(event) {
61
- const response = JSON.parse(event.data);
62
- if (response["MessageType"] == "profile.completed") {
63
- emit(PublicEvent.DEVICE_PROFILE_READY_THREE_D_SECURE_EVENT, { message: null, data: null });
61
+ try {
62
+ const response = typeof event.data === "string" ? JSON.parse(event.data) : event.data;
63
+ if (response["MessageType"] == "profile.completed") {
64
+ emit(PublicEvent.DEVICE_PROFILE_READY_THREE_D_SECURE_EVENT, { message: null, data: null });
65
+ }
66
+ else if (response["Status"] == false) {
67
+ // Still proceed, even if status is false (as per recommendations from cybersource support team.
68
+ emit(PublicEvent.DEVICE_PROFILE_READY_THREE_D_SECURE_EVENT, { message: null, data: null });
69
+ }
64
70
  }
65
- else if (response["Status"] == false) {
66
- // Still proceed, even if status is false (as per recommendations from cybersource support team.
67
- emit(PublicEvent.DEVICE_PROFILE_READY_THREE_D_SECURE_EVENT, { message: null, data: null });
71
+ catch (_a) {
72
+ // Unparseable payload do not proceed
68
73
  }
69
74
  }
70
75
  static collectDeviceData() {
@@ -138,8 +143,13 @@ export default DeviceDataCollection;
138
143
  __decorate([
139
144
  logMethod({
140
145
  mapArgs: (args) => {
141
- const params = args[0]; // grab the first argument.
142
- return JSON.parse(params.data);
146
+ const params = args[0];
147
+ try {
148
+ return typeof params.data === "string" ? JSON.parse(params.data) : params.data;
149
+ }
150
+ catch (_a) {
151
+ return params.data;
152
+ }
143
153
  },
144
154
  })
145
155
  ], DeviceDataCollection, "handleCollectionResponse", null);
package/dist/version.js CHANGED
@@ -1,6 +1,6 @@
1
- /*! fatzebra-sdk-commit: 058224c622e8fbff2bd14a9b64d79a602e336aba */
1
+ /*! fatzebra-sdk-commit: 98facc3e829be81d954b2fd8674d98d09532e61f */
2
2
  export const version = '1.5.9';
3
3
  // Placeholder replaced at build time by .github/scripts/stamp-version.js with the
4
4
  // deployed commit hash (`git rev-parse HEAD`). Stays as the placeholder for builds
5
5
  // that don't run the stamp step (e.g. local/package builds).
6
- export const commitHash = '058224c622e8fbff2bd14a9b64d79a602e336aba';
6
+ export const commitHash = '98facc3e829be81d954b2fd8674d98d09532e61f';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fat-zebra/sdk",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -30,7 +30,7 @@
30
30
  "@types/react-dom": "^19.1.9",
31
31
  "audit-ci": "^7.1.0",
32
32
  "dotenv": "^16.0.1",
33
- "esbuild": "^0.25.10",
33
+ "esbuild": "^0.28.1",
34
34
  "husky": "^9.1.7",
35
35
  "jest": "^30.2.0",
36
36
  "jest-environment-jsdom": "^30.2.0",
@@ -49,6 +49,7 @@
49
49
  "overrides": {
50
50
  "test-exclude": "^7.0.1",
51
51
  "minimatch": "^10.2.2",
52
+ "form-data": "^4.0.6",
52
53
  "jest-util": {
53
54
  "picomatch": "^4.0.4"
54
55
  },