nets-service-sdk 1.1.2 → 1.1.4

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.
Files changed (2) hide show
  1. package/dist/index.js +21 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -986,14 +986,14 @@ var require_responseHandler = __commonJS({
986
986
  if (status) {
987
987
  fw.updateConfig({ terminal_status: true });
988
988
  sendMessage2("clientRoom", "STATUS_MESSAGE", {
989
- success: true,
989
+ status: "SUCCESS",
990
990
  request: "status_scheck",
991
991
  action: "COMPLETED"
992
992
  });
993
993
  } else {
994
994
  fw.updateConfig({ terminal_status: false });
995
995
  sendMessage2("clientRoom", "STATUS_MESSAGE", {
996
- success: false,
996
+ status: "FAILED",
997
997
  request: "status_scheck",
998
998
  action: "FAILED_TO_GET_THE_STATUS"
999
999
  });
@@ -1023,13 +1023,13 @@ var require_responseHandler = __commonJS({
1023
1023
  if (response.status) {
1024
1024
  fw.updateConfig({ last_logon: /* @__PURE__ */ new Date() });
1025
1025
  sendMessage2("clientRoom", "LOGON_MESSAGE", {
1026
- success: true,
1026
+ status: "SUCCESS",
1027
1027
  request: "logon",
1028
1028
  action: "COMPLETED"
1029
1029
  });
1030
1030
  } else {
1031
1031
  sendMessage2("clientRoom", "LOGON_MESSAGE", {
1032
- success: false,
1032
+ status: "FAILED",
1033
1033
  request: "logon",
1034
1034
  action: "FAILED_TO_LOGON"
1035
1035
  });
@@ -1069,14 +1069,14 @@ var require_responseHandler = __commonJS({
1069
1069
  }
1070
1070
  if (response.translated.status == "TIME_OUT") {
1071
1071
  sendMessage2("clientRoom", "PAYMENT_MESSAGE", {
1072
- success: true,
1072
+ status: "RETRY",
1073
1073
  response,
1074
1074
  action: "RETRY"
1075
1075
  });
1076
1076
  }
1077
1077
  if (response.translated.status == "USER_CANCELLED" || response.translated.status == "OUT_OF_PAPER" || response.translated.status == "INVALID_CARD" || response.translated.status == "DECLINED" || response.translated.status == "CARD_NOT_SUPPORTED") {
1078
1078
  sendMessage2("clientRoom", "PAYMENT_MESSAGE", {
1079
- success: true,
1079
+ status: "CANCELLED",
1080
1080
  response,
1081
1081
  action: "CANCELLED"
1082
1082
  });
@@ -1101,21 +1101,21 @@ var require_responseHandler = __commonJS({
1101
1101
  if (response.translated) {
1102
1102
  if (response.translated.status == "APPROVED") {
1103
1103
  sendMessage2("clientRoom", "PAYMENT_MESSAGE", {
1104
- success: true,
1104
+ status: "SUCCESS",
1105
1105
  response,
1106
1106
  action: "COMPLETED"
1107
1107
  });
1108
1108
  }
1109
1109
  if (response.translated.status == "TIME_OUT") {
1110
1110
  sendMessage2("clientRoom", "PAYMENT_MESSAGE", {
1111
- success: true,
1111
+ status: "RETRY",
1112
1112
  response,
1113
1113
  action: "RETRY"
1114
1114
  });
1115
1115
  }
1116
1116
  if (response.translated.status == "USER_CANCELLED" || response.translated.status == "OUT_OF_PAPER" || response.translated.status == "INVALID_CARD" || response.translated.status == "DECLINED" || response.translated.status == "CARD_NOT_SUPPORTED") {
1117
1117
  sendMessage2("clientRoom", "PAYMENT_MESSAGE", {
1118
- success: true,
1118
+ status: "CANCELLED",
1119
1119
  response,
1120
1120
  action: "CANCELLED"
1121
1121
  });
@@ -1351,6 +1351,10 @@ var require_communication = __commonJS({
1351
1351
  message: `Failed to store transaction: ${error.message}`
1352
1352
  });
1353
1353
  }
1354
+ sendMessage2("clientRoom", "STATUS_MESSAGE", {
1355
+ status: "INITIATED",
1356
+ action: "STATUS_CHECK_INITIATED"
1357
+ });
1354
1358
  global.port.write(calculated.buffer);
1355
1359
  }
1356
1360
  if (requestType == "LOGON") {
@@ -1368,6 +1372,10 @@ var require_communication = __commonJS({
1368
1372
  message: `Failed to store transaction: ${error.message}`
1369
1373
  });
1370
1374
  }
1375
+ sendMessage2("clientRoom", "LOGON_MESSAGE", {
1376
+ status: "INITIATED",
1377
+ action: "LOGON_INITIATED"
1378
+ });
1371
1379
  global.port.write(calculated.buffer);
1372
1380
  }
1373
1381
  if (requestType == "PAYMENT" || requestType == "CREDIT_PAYMENT") {
@@ -1387,6 +1395,10 @@ var require_communication = __commonJS({
1387
1395
  message: `Failed to store transaction: ${error.message}`
1388
1396
  });
1389
1397
  }
1398
+ sendMessage2("clientRoom", "PAYMENT_MESSAGE", {
1399
+ status: "INITIATED",
1400
+ action: "PAYMENT_INITIATED"
1401
+ });
1390
1402
  global.port.write(calculated.buffer);
1391
1403
  exports2.checkACKorNACK();
1392
1404
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nets-service-sdk",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Utility functions for Nets Service",
5
5
  "source": "src/index.js",
6
6
  "main": "dist/index.js",