@open-tender/store 0.1.303 → 0.1.304
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/dist/cjs/slices/kiosk.d.ts +16 -0
- package/dist/cjs/slices/kiosk.js +11 -7
- package/dist/esm/slices/kiosk.d.ts +16 -0
- package/dist/esm/slices/kiosk.js +11 -7
- package/package.json +1 -1
|
@@ -19,6 +19,22 @@ export interface KioskState {
|
|
|
19
19
|
styles: KioskStyles | null;
|
|
20
20
|
theme: AppTheme | null;
|
|
21
21
|
version?: string | null;
|
|
22
|
+
paymentConfigs: {
|
|
23
|
+
integration: string;
|
|
24
|
+
is_testing: boolean;
|
|
25
|
+
merchant_api_key: string;
|
|
26
|
+
merchant_id: string;
|
|
27
|
+
merchant_password: string;
|
|
28
|
+
merchant_username: string;
|
|
29
|
+
offline_limit: string;
|
|
30
|
+
saved_cards: boolean;
|
|
31
|
+
signature_threshold: string | null;
|
|
32
|
+
freedompay_store_id: string;
|
|
33
|
+
card_stor_service_url: string;
|
|
34
|
+
client_selling_system: string;
|
|
35
|
+
client_selling_system_version: string;
|
|
36
|
+
freedompay_terminal_id: string;
|
|
37
|
+
} | null;
|
|
22
38
|
}
|
|
23
39
|
export declare enum KioskActionType {
|
|
24
40
|
FetchKiosk = "kiosk/getKiosk",
|
package/dist/cjs/slices/kiosk.js
CHANGED
|
@@ -8,8 +8,8 @@ var services_1 = require("../services");
|
|
|
8
8
|
var errors_1 = require("../services/errors");
|
|
9
9
|
var config_1 = require("./config");
|
|
10
10
|
var order_1 = require("./order");
|
|
11
|
-
var types_1 = require("./types");
|
|
12
11
|
var revenueCenter_1 = require("./revenueCenter");
|
|
12
|
+
var types_1 = require("./types");
|
|
13
13
|
var initialState = {
|
|
14
14
|
app: null,
|
|
15
15
|
brand: null,
|
|
@@ -24,7 +24,8 @@ var initialState = {
|
|
|
24
24
|
retries: 0,
|
|
25
25
|
settings: null,
|
|
26
26
|
theme: null,
|
|
27
|
-
version: null
|
|
27
|
+
version: null,
|
|
28
|
+
paymentConfigs: null
|
|
28
29
|
};
|
|
29
30
|
var KioskActionType;
|
|
30
31
|
(function (KioskActionType) {
|
|
@@ -42,7 +43,7 @@ var getError = function (kiosk, store, devices) {
|
|
|
42
43
|
: errors_1.errorsApi.internalServerError;
|
|
43
44
|
};
|
|
44
45
|
exports.fetchKioskConfig = (0, toolkit_1.createAsyncThunk)(KioskActionType.FetchKiosk, function (_a, _b) { return tslib_1.__awaiter(void 0, [_a, _b], void 0, function (_c, _d) {
|
|
45
|
-
var posTerminalId, app, api, _e, kiosk, _f, devicesList, _g, stores, store, devices, err, brand, content, settings, theme, ratio, displaySettings, err_1;
|
|
46
|
+
var posTerminalId, app, api, _e, kiosk, _f, devicesList, _g, stores, paymentConfigs, store, devices, err, brand, content, settings, theme, ratio, displaySettings, err_1;
|
|
46
47
|
var apiUrl = _c.apiUrl;
|
|
47
48
|
var dispatch = _d.dispatch, getState = _d.getState, rejectWithValue = _d.rejectWithValue;
|
|
48
49
|
return tslib_1.__generator(this, function (_h) {
|
|
@@ -55,10 +56,11 @@ exports.fetchKioskConfig = (0, toolkit_1.createAsyncThunk)(KioskActionType.Fetch
|
|
|
55
56
|
return [4 /*yield*/, Promise.all([
|
|
56
57
|
api.getKioskConfig(),
|
|
57
58
|
api.getSettings('DEVICES'),
|
|
58
|
-
api.getSettings('STORE')
|
|
59
|
+
api.getSettings('STORE'),
|
|
60
|
+
api.fetchPaymentConfigs()
|
|
59
61
|
])];
|
|
60
62
|
case 1:
|
|
61
|
-
_e = _h.sent(), kiosk = _e[0], _f = _e[1], devicesList = _f === void 0 ? [] : _f, _g = _e[2], stores = _g === void 0 ? [] : _g;
|
|
63
|
+
_e = _h.sent(), kiosk = _e[0], _f = _e[1], devicesList = _f === void 0 ? [] : _f, _g = _e[2], stores = _g === void 0 ? [] : _g, paymentConfigs = _e[3];
|
|
62
64
|
store = stores[0] || null;
|
|
63
65
|
devices = devicesList[0] || null;
|
|
64
66
|
if (!kiosk || !store || !devices) {
|
|
@@ -83,7 +85,8 @@ exports.fetchKioskConfig = (0, toolkit_1.createAsyncThunk)(KioskActionType.Fetch
|
|
|
83
85
|
settings: displaySettings,
|
|
84
86
|
store: store,
|
|
85
87
|
styles: null,
|
|
86
|
-
theme: theme
|
|
88
|
+
theme: theme,
|
|
89
|
+
paymentConfigs: paymentConfigs
|
|
87
90
|
}];
|
|
88
91
|
case 2:
|
|
89
92
|
err_1 = _h.sent();
|
|
@@ -141,7 +144,7 @@ var kioskSlice = (0, toolkit_1.createSlice)({
|
|
|
141
144
|
extraReducers: function (builder) {
|
|
142
145
|
builder
|
|
143
146
|
.addCase(exports.fetchKioskConfig.fulfilled, function (state, action) {
|
|
144
|
-
var _a = action.payload, app = _a.app, brand = _a.brand, config = _a.config, content = _a.content, devices = _a.devices, ratio = _a.ratio, settings = _a.settings, store = _a.store, styles = _a.styles, theme = _a.theme;
|
|
147
|
+
var _a = action.payload, app = _a.app, brand = _a.brand, config = _a.config, content = _a.content, devices = _a.devices, ratio = _a.ratio, settings = _a.settings, store = _a.store, styles = _a.styles, theme = _a.theme, paymentConfigs = _a.paymentConfigs;
|
|
145
148
|
state.app = app;
|
|
146
149
|
state.brand = brand;
|
|
147
150
|
state.config = config;
|
|
@@ -155,6 +158,7 @@ var kioskSlice = (0, toolkit_1.createSlice)({
|
|
|
155
158
|
state.store = store;
|
|
156
159
|
state.styles = styles;
|
|
157
160
|
state.theme = theme;
|
|
161
|
+
state.paymentConfigs = paymentConfigs;
|
|
158
162
|
})
|
|
159
163
|
.addCase(exports.fetchKioskConfig.pending, function (state) {
|
|
160
164
|
state.loading = 'pending';
|
|
@@ -19,6 +19,22 @@ export interface KioskState {
|
|
|
19
19
|
styles: KioskStyles | null;
|
|
20
20
|
theme: AppTheme | null;
|
|
21
21
|
version?: string | null;
|
|
22
|
+
paymentConfigs: {
|
|
23
|
+
integration: string;
|
|
24
|
+
is_testing: boolean;
|
|
25
|
+
merchant_api_key: string;
|
|
26
|
+
merchant_id: string;
|
|
27
|
+
merchant_password: string;
|
|
28
|
+
merchant_username: string;
|
|
29
|
+
offline_limit: string;
|
|
30
|
+
saved_cards: boolean;
|
|
31
|
+
signature_threshold: string | null;
|
|
32
|
+
freedompay_store_id: string;
|
|
33
|
+
card_stor_service_url: string;
|
|
34
|
+
client_selling_system: string;
|
|
35
|
+
client_selling_system_version: string;
|
|
36
|
+
freedompay_terminal_id: string;
|
|
37
|
+
} | null;
|
|
22
38
|
}
|
|
23
39
|
export declare enum KioskActionType {
|
|
24
40
|
FetchKiosk = "kiosk/getKiosk",
|
package/dist/esm/slices/kiosk.js
CHANGED
|
@@ -5,8 +5,8 @@ import { PosAPI } from '../services';
|
|
|
5
5
|
import { errorsApi } from '../services/errors';
|
|
6
6
|
import { setApi } from './config';
|
|
7
7
|
import { setRevenueCenterId } from './order';
|
|
8
|
-
import { ReducerType } from './types';
|
|
9
8
|
import { fetchRevenueCenter } from './revenueCenter';
|
|
9
|
+
import { ReducerType } from './types';
|
|
10
10
|
var initialState = {
|
|
11
11
|
app: null,
|
|
12
12
|
brand: null,
|
|
@@ -21,7 +21,8 @@ var initialState = {
|
|
|
21
21
|
retries: 0,
|
|
22
22
|
settings: null,
|
|
23
23
|
theme: null,
|
|
24
|
-
version: null
|
|
24
|
+
version: null,
|
|
25
|
+
paymentConfigs: null
|
|
25
26
|
};
|
|
26
27
|
export var KioskActionType;
|
|
27
28
|
(function (KioskActionType) {
|
|
@@ -39,7 +40,7 @@ var getError = function (kiosk, store, devices) {
|
|
|
39
40
|
: errorsApi.internalServerError;
|
|
40
41
|
};
|
|
41
42
|
export var fetchKioskConfig = createAsyncThunk(KioskActionType.FetchKiosk, function (_a, _b) { return __awaiter(void 0, [_a, _b], void 0, function (_c, _d) {
|
|
42
|
-
var posTerminalId, app, api, _e, kiosk, _f, devicesList, _g, stores, store, devices, err, brand, content, settings, theme, ratio, displaySettings, err_1;
|
|
43
|
+
var posTerminalId, app, api, _e, kiosk, _f, devicesList, _g, stores, paymentConfigs, store, devices, err, brand, content, settings, theme, ratio, displaySettings, err_1;
|
|
43
44
|
var apiUrl = _c.apiUrl;
|
|
44
45
|
var dispatch = _d.dispatch, getState = _d.getState, rejectWithValue = _d.rejectWithValue;
|
|
45
46
|
return __generator(this, function (_h) {
|
|
@@ -52,10 +53,11 @@ export var fetchKioskConfig = createAsyncThunk(KioskActionType.FetchKiosk, funct
|
|
|
52
53
|
return [4 /*yield*/, Promise.all([
|
|
53
54
|
api.getKioskConfig(),
|
|
54
55
|
api.getSettings('DEVICES'),
|
|
55
|
-
api.getSettings('STORE')
|
|
56
|
+
api.getSettings('STORE'),
|
|
57
|
+
api.fetchPaymentConfigs()
|
|
56
58
|
])];
|
|
57
59
|
case 1:
|
|
58
|
-
_e = _h.sent(), kiosk = _e[0], _f = _e[1], devicesList = _f === void 0 ? [] : _f, _g = _e[2], stores = _g === void 0 ? [] : _g;
|
|
60
|
+
_e = _h.sent(), kiosk = _e[0], _f = _e[1], devicesList = _f === void 0 ? [] : _f, _g = _e[2], stores = _g === void 0 ? [] : _g, paymentConfigs = _e[3];
|
|
59
61
|
store = stores[0] || null;
|
|
60
62
|
devices = devicesList[0] || null;
|
|
61
63
|
if (!kiosk || !store || !devices) {
|
|
@@ -80,7 +82,8 @@ export var fetchKioskConfig = createAsyncThunk(KioskActionType.FetchKiosk, funct
|
|
|
80
82
|
settings: displaySettings,
|
|
81
83
|
store: store,
|
|
82
84
|
styles: null,
|
|
83
|
-
theme: theme
|
|
85
|
+
theme: theme,
|
|
86
|
+
paymentConfigs: paymentConfigs
|
|
84
87
|
}];
|
|
85
88
|
case 2:
|
|
86
89
|
err_1 = _h.sent();
|
|
@@ -138,7 +141,7 @@ var kioskSlice = createSlice({
|
|
|
138
141
|
extraReducers: function (builder) {
|
|
139
142
|
builder
|
|
140
143
|
.addCase(fetchKioskConfig.fulfilled, function (state, action) {
|
|
141
|
-
var _a = action.payload, app = _a.app, brand = _a.brand, config = _a.config, content = _a.content, devices = _a.devices, ratio = _a.ratio, settings = _a.settings, store = _a.store, styles = _a.styles, theme = _a.theme;
|
|
144
|
+
var _a = action.payload, app = _a.app, brand = _a.brand, config = _a.config, content = _a.content, devices = _a.devices, ratio = _a.ratio, settings = _a.settings, store = _a.store, styles = _a.styles, theme = _a.theme, paymentConfigs = _a.paymentConfigs;
|
|
142
145
|
state.app = app;
|
|
143
146
|
state.brand = brand;
|
|
144
147
|
state.config = config;
|
|
@@ -152,6 +155,7 @@ var kioskSlice = createSlice({
|
|
|
152
155
|
state.store = store;
|
|
153
156
|
state.styles = styles;
|
|
154
157
|
state.theme = theme;
|
|
158
|
+
state.paymentConfigs = paymentConfigs;
|
|
155
159
|
})
|
|
156
160
|
.addCase(fetchKioskConfig.pending, function (state) {
|
|
157
161
|
state.loading = 'pending';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.304",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|