@tap-payments/auth-jsconnect 2.10.8-development → 2.10.9-development

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.
@@ -68,9 +68,6 @@ export var verifyToken = createAsyncThunk('terminal/verifyLeadToken', function (
68
68
  return [4, API.leadService.verifyToken(payload)];
69
69
  case 1:
70
70
  data = _d.sent();
71
- if (!data.merchant_id) {
72
- data.merchant_id = 'merchant_09UaS2025106ZQ1s8eD2B57';
73
- }
74
71
  _b = data || {}, step_name = _b.step_name, merchant_id = _b.merchant_id, config = _b.config, country_code = _b.country_code;
75
72
  if (isInternally)
76
73
  data.step_name = TERMINAL_STEP_NAMES.PHONE_AUTH;
@@ -114,24 +111,24 @@ export var resendOTP = createAsyncThunk('terminal/resendOTP', function (params,
114
111
  });
115
112
  }); });
116
113
  export var verifyTokenOTP = createAsyncThunk('terminal/verifyOtp', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
117
- var _a, terminal, settings, authData, payload, data, _b, config, country_code, _c, merchant_id, publicKey, countryIso2, terminalData, nextScreen;
118
- var _d, _e, _f, _g;
119
- return __generator(this, function (_h) {
120
- switch (_h.label) {
114
+ var _a, terminal, settings, authData, payload, data, _b, config, country_code, merchant_id, publicKey, countryIso2, terminalData, nextScreen;
115
+ var _c, _d, _e, _f;
116
+ return __generator(this, function (_g) {
117
+ switch (_g.label) {
121
118
  case 0:
122
119
  _a = thunkApi.getState(), terminal = _a.terminal, settings = _a.settings;
123
120
  authData = (terminal.data.responseData || {}).authData;
124
121
  payload = {
125
122
  data: params.otp,
126
- service_name: (_d = authData === null || authData === void 0 ? void 0 : authData.verification_by) === null || _d === void 0 ? void 0 : _d.service_name,
123
+ service_name: (_c = authData === null || authData === void 0 ? void 0 : authData.verification_by) === null || _c === void 0 ? void 0 : _c.service_name,
127
124
  verify_token: authData === null || authData === void 0 ? void 0 : authData.verify_token,
128
125
  step_name: TERMINAL_STEP_NAMES.PHONE_AUTH,
129
126
  encryption_contract: ['data']
130
127
  };
131
128
  return [4, API.leadService.verifyTokenOTP(payload)];
132
129
  case 1:
133
- data = _h.sent();
134
- _b = data || {}, config = _b.config, country_code = _b.country_code, _c = _b.merchant_id, merchant_id = _c === void 0 ? 'merchant_09UaS2025106ZQ1s8eD2B57' : _c;
130
+ data = _g.sent();
131
+ _b = data || {}, config = _b.config, country_code = _b.country_code, merchant_id = _b.merchant_id;
135
132
  publicKey = config === null || config === void 0 ? void 0 : config.public_key;
136
133
  countryIso2 = country_code || (authData === null || authData === void 0 ? void 0 : authData.country_code);
137
134
  if (publicKey)
@@ -140,9 +137,9 @@ export var verifyTokenOTP = createAsyncThunk('terminal/verifyOtp', function (par
140
137
  thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
141
138
  return [4, API.terminalService.retrieveTerminalDeviceList([merchant_id])];
142
139
  case 2:
143
- terminalData = _h.sent();
144
- nextScreen = ((_e = terminalData === null || terminalData === void 0 ? void 0 : terminalData.terminal_devices) === null || _e === void 0 ? void 0 : _e.length) ? CONNECT_FLOWS.terminal.terminalDeviceList : CONNECT_FLOWS.terminal.noTerminalLinked;
145
- (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, { otp: params.otp });
140
+ terminalData = _g.sent();
141
+ nextScreen = ((_d = terminalData === null || terminalData === void 0 ? void 0 : terminalData.terminal_devices) === null || _d === void 0 ? void 0 : _d.length) ? CONNECT_FLOWS.terminal.terminalDeviceList : CONNECT_FLOWS.terminal.noTerminalLinked;
142
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, { otp: params.otp });
146
143
  return [2, { data: data, terminalData: terminalData, formData: params, nextScreen: nextScreen }];
147
144
  }
148
145
  });
@@ -23,20 +23,20 @@ import { pushNotificationLinkNewTerminal, terminalSelector } from '../../../app/
23
23
  import { CodeDescription, QRCodeImage } from './styles';
24
24
  import { LinkNewTerminalContainer, LinkTerminalText, QRCodeDescription } from '../shared';
25
25
  var LinkNewTerminal = function () {
26
- var _a, _b;
26
+ var _a, _b, _c, _d;
27
27
  var t = useTranslation().t;
28
28
  var dispatch = useAppDispatch();
29
29
  var data = useAppSelector(terminalSelector).data;
30
- var _c = React.useState(false), isReady = _c[0], setIsReady = _c[1];
31
- var _d = React.useState(false), success = _d[0], setSuccess = _d[1];
32
- var _e = React.useState(false), failed = _e[0], setFailed = _e[1];
30
+ var _e = React.useState(false), isReady = _e[0], setIsReady = _e[1];
31
+ var _f = React.useState(false), success = _f[0], setSuccess = _f[1];
32
+ var _g = React.useState(false), failed = _g[0], setFailed = _g[1];
33
33
  var terminalInfo = data.terminalInfo, responseData = data.responseData;
34
- var _f = responseData || {}, terminalData = _f.terminalData, linkNewTerminalData = _f.linkNewTerminalData;
34
+ var _h = responseData || {}, terminalData = _h.terminalData, linkNewTerminalData = _h.linkNewTerminalData;
35
35
  var terminal_devices = (terminalData || {}).terminal_devices;
36
- var qrCode = "data:image/png;base64,".concat(linkNewTerminalData === null || linkNewTerminalData === void 0 ? void 0 : linkNewTerminalData.qr);
37
- var code = linkNewTerminalData === null || linkNewTerminalData === void 0 ? void 0 : linkNewTerminalData.code;
36
+ var qrCode = "data:image/png;base64,".concat((_a = linkNewTerminalData === null || linkNewTerminalData === void 0 ? void 0 : linkNewTerminalData.linking) === null || _a === void 0 ? void 0 : _a.qr);
37
+ var code = (_b = linkNewTerminalData === null || linkNewTerminalData === void 0 ? void 0 : linkNewTerminalData.linking) === null || _b === void 0 ? void 0 : _b.code;
38
38
  var expiry = TERMINAL_PUSH_NOTIFICATION_DURATION;
39
- var deviceName = ((_b = (_a = terminalInfo.selectedTerminalDevice.model) === null || _a === void 0 ? void 0 : _a.name[0]) === null || _b === void 0 ? void 0 : _b.text) || '';
39
+ var deviceName = ((_d = (_c = terminalInfo.selectedTerminalDevice.model) === null || _c === void 0 ? void 0 : _c.name[0]) === null || _d === void 0 ? void 0 : _d.text) || '';
40
40
  var newTerminal = true;
41
41
  React.useEffect(function () {
42
42
  if (linkNewTerminalData && !isReady) {
@@ -139,6 +139,6 @@ var TerminalDeviceList = function () {
139
139
  })
140
140
  .catch(function () { });
141
141
  };
142
- return (_jsxs(ScreenContainer, __assign({ minHeight: 200, sx: { pl: 2.5, pr: 2.5 }, justifyContent: 'space-between' }, { children: [_jsxs(Container, { children: [_jsx(Header, { onLinkClick: handleOnClickNewTerminalLink, loading: terminalListLoading && newLinkClicked }), _jsx(DeviceList, { devices: linkedDevices, onClick: handleOnClickLinkedTerminal }), !!(unLinkedDevices === null || unLinkedDevices === void 0 ? void 0 : unLinkedDevices.length) && _jsx(TextTypography, __assign({ sx: { pt: 1, pb: 1 } }, { children: t('terminal_unlinked') })), _jsx(DeviceList, { loading: terminalListLoading && !newLinkClicked, devices: unLinkedDevices, onClick: handleOnClickUnlinkedTerminal })] }), _jsx(Button, __assign({ sx: { mb: 1.5, mt: 1.5 }, onClick: function () { return handleOnBack(); }, variant: 'text' }, { children: loading ? _jsx(Loader, { innerColor: 'black', outerColor: 'black', size: 15, toggleAnimation: !!loading }) : t('back') }))] })));
142
+ return (_jsxs(ScreenContainer, __assign({ minHeight: 200, sx: { pl: 2.5, pr: 2.5 }, justifyContent: 'space-between' }, { children: [_jsxs(Container, { children: [_jsx(Header, { onLinkClick: handleOnClickNewTerminalLink, loading: terminalListLoading && newLinkClicked }), _jsx(DeviceList, { devices: linkedDevices, onClick: handleOnClickLinkedTerminal }), !!(unLinkedDevices === null || unLinkedDevices === void 0 ? void 0 : unLinkedDevices.length) && !!(linkedDevices === null || linkedDevices === void 0 ? void 0 : linkedDevices.length) && _jsx(TextTypography, __assign({ sx: { pt: 1, pb: 1 } }, { children: t('terminal_unlinked') })), _jsx(DeviceList, { loading: terminalListLoading && !newLinkClicked, devices: unLinkedDevices, onClick: handleOnClickUnlinkedTerminal })] }), _jsx(Button, __assign({ sx: { mb: 1.5, mt: 1.5 }, onClick: function () { return handleOnBack(); }, variant: 'text' }, { children: loading ? _jsx(Loader, { innerColor: 'black', outerColor: 'black', size: 15, toggleAnimation: !!loading }) : t('back') }))] })));
143
143
  };
144
144
  export default React.memo(TerminalDeviceList);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.10.8-development",
3
+ "version": "2.10.9-development",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",