@open-tender/store 0.1.302 → 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.
@@ -83,5 +83,21 @@ declare class PosAPI {
83
83
  getAllergens(): Promise<Allergens>;
84
84
  testPrint(): Promise<boolean>;
85
85
  rateOrder(orderId: string, data: any): Promise<unknown>;
86
+ fetchPaymentConfigs(): Promise<{
87
+ integration: string;
88
+ is_testing: false;
89
+ merchant_api_key: string;
90
+ merchant_id: string;
91
+ merchant_password: string;
92
+ merchant_username: string;
93
+ offline_limit: string;
94
+ saved_cards: boolean;
95
+ signature_threshold: string | null;
96
+ freedompay_store_id: string;
97
+ card_stor_service_url: string;
98
+ client_selling_system: string;
99
+ client_selling_system_version: string;
100
+ freedompay_terminal_id: string;
101
+ }>;
86
102
  }
87
103
  export default PosAPI;
@@ -384,6 +384,9 @@ var PosAPI = /** @class */ (function () {
384
384
  PosAPI.prototype.rateOrder = function (orderId, data) {
385
385
  return this.request("/orders/".concat(orderId, "/rating"), 'POST', data);
386
386
  };
387
+ PosAPI.prototype.fetchPaymentConfigs = function () {
388
+ return this.request("/kiosk/payment-config");
389
+ };
387
390
  return PosAPI;
388
391
  }());
389
392
  exports.default = PosAPI;
@@ -21,6 +21,22 @@ export interface ConfigState {
21
21
  error: RequestError | null;
22
22
  retries: number;
23
23
  accessibilityOn?: boolean;
24
+ paymentConfigs: {
25
+ integration: string;
26
+ is_testing: boolean;
27
+ merchant_api_key: string;
28
+ merchant_id: string;
29
+ merchant_password: string;
30
+ merchant_username: string;
31
+ offline_limit: string;
32
+ saved_cards: boolean;
33
+ signature_threshold: string | null;
34
+ freedompay_store_id: string;
35
+ card_stor_service_url: string;
36
+ client_selling_system: string;
37
+ client_selling_system_version: string;
38
+ freedompay_terminal_id: string;
39
+ } | null;
24
40
  }
25
41
  export declare enum ConfigActionType {
26
42
  FetchConfig = "config/getConfig"
@@ -28,14 +28,15 @@ var initialState = {
28
28
  loading: 'idle',
29
29
  error: null,
30
30
  retries: 0,
31
- accessibilityOn: false
31
+ accessibilityOn: false,
32
+ paymentConfigs: null
32
33
  };
33
34
  var ConfigActionType;
34
35
  (function (ConfigActionType) {
35
36
  ConfigActionType["FetchConfig"] = "config/getConfig";
36
37
  })(ConfigActionType || (exports.ConfigActionType = ConfigActionType = {}));
37
38
  exports.fetchConfig = (0, toolkit_1.createAsyncThunk)(ConfigActionType.FetchConfig, function (_a, _b) { return tslib_1.__awaiter(void 0, [_a, _b], void 0, function (_c, _d) {
38
- var posTerminalId, kdsTerminalId, app, api, _e, _f, devicesList, _g, stores, _h, selectOptions, _j, itemTypes, _k, menuColors, store, devices, err, cashier, employee, tz, businessDate, err_1, err_2;
39
+ var posTerminalId, kdsTerminalId, app, api, _e, _f, devicesList, _g, stores, _h, selectOptions, _j, itemTypes, _k, menuColors, paymentConfigs, store, devices, err, cashier, employee, tz, businessDate, err_1, err_2;
39
40
  var apiUrl = _c.apiUrl;
40
41
  var dispatch = _d.dispatch, getState = _d.getState, rejectWithValue = _d.rejectWithValue;
41
42
  return tslib_1.__generator(this, function (_l) {
@@ -57,10 +58,11 @@ exports.fetchConfig = (0, toolkit_1.createAsyncThunk)(ConfigActionType.FetchConf
57
58
  // api.getSettings<SelectOptions>('SELECT_OPTION'),
58
59
  api.getSelectOptions(),
59
60
  api.getSettings('ITEM_TYPE'),
60
- api.getSettings('ITEM_COLORS')
61
+ api.getSettings('ITEM_COLORS'),
62
+ api.fetchPaymentConfigs()
61
63
  ])];
62
64
  case 1:
63
- _e = _l.sent(), _f = _e[0], devicesList = _f === void 0 ? [] : _f, _g = _e[1], stores = _g === void 0 ? [] : _g, _h = _e[2], selectOptions = _h === void 0 ? [] : _h, _j = _e[3], itemTypes = _j === void 0 ? [] : _j, _k = _e[4], menuColors = _k === void 0 ? [] : _k;
65
+ _e = _l.sent(), _f = _e[0], devicesList = _f === void 0 ? [] : _f, _g = _e[1], stores = _g === void 0 ? [] : _g, _h = _e[2], selectOptions = _h === void 0 ? [] : _h, _j = _e[3], itemTypes = _j === void 0 ? [] : _j, _k = _e[4], menuColors = _k === void 0 ? [] : _k, paymentConfigs = _e[5];
64
66
  store = stores[0] || null;
65
67
  devices = devicesList[0] || null;
66
68
  if (!store || !devices) {
@@ -102,7 +104,8 @@ exports.fetchConfig = (0, toolkit_1.createAsyncThunk)(ConfigActionType.FetchConf
102
104
  hasCashDrawer: true,
103
105
  error: null,
104
106
  loading: 'idle',
105
- retries: 0
107
+ retries: 0,
108
+ paymentConfigs: paymentConfigs
106
109
  }];
107
110
  case 6:
108
111
  err_2 = _l.sent();
@@ -141,7 +144,7 @@ var configSlice = (0, toolkit_1.createSlice)({
141
144
  state.loading = 'pending';
142
145
  })
143
146
  .addCase(exports.fetchConfig.fulfilled, function (state, action) {
144
- var _a = action.payload, api = _a.api, app = _a.app, devices = _a.devices, store = _a.store, selectOptions = _a.selectOptions, menuColors = _a.menuColors, hasPinpad = _a.hasPinpad, hasCashDrawer = _a.hasCashDrawer;
147
+ var _a = action.payload, api = _a.api, app = _a.app, devices = _a.devices, store = _a.store, selectOptions = _a.selectOptions, menuColors = _a.menuColors, hasPinpad = _a.hasPinpad, hasCashDrawer = _a.hasCashDrawer, paymentConfigs = _a.paymentConfigs;
145
148
  state.api = api;
146
149
  state.app = app;
147
150
  state.store = store;
@@ -153,6 +156,7 @@ var configSlice = (0, toolkit_1.createSlice)({
153
156
  state.loading = 'idle';
154
157
  state.retries = 0;
155
158
  state.error = null;
159
+ state.paymentConfigs = paymentConfigs;
156
160
  })
157
161
  .addCase(exports.fetchConfig.rejected, function (state, action) {
158
162
  state.error = action.payload;
@@ -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",
@@ -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';
@@ -83,5 +83,21 @@ declare class PosAPI {
83
83
  getAllergens(): Promise<Allergens>;
84
84
  testPrint(): Promise<boolean>;
85
85
  rateOrder(orderId: string, data: any): Promise<unknown>;
86
+ fetchPaymentConfigs(): Promise<{
87
+ integration: string;
88
+ is_testing: false;
89
+ merchant_api_key: string;
90
+ merchant_id: string;
91
+ merchant_password: string;
92
+ merchant_username: string;
93
+ offline_limit: string;
94
+ saved_cards: boolean;
95
+ signature_threshold: string | null;
96
+ freedompay_store_id: string;
97
+ card_stor_service_url: string;
98
+ client_selling_system: string;
99
+ client_selling_system_version: string;
100
+ freedompay_terminal_id: string;
101
+ }>;
86
102
  }
87
103
  export default PosAPI;
@@ -382,6 +382,9 @@ var PosAPI = /** @class */ (function () {
382
382
  PosAPI.prototype.rateOrder = function (orderId, data) {
383
383
  return this.request("/orders/".concat(orderId, "/rating"), 'POST', data);
384
384
  };
385
+ PosAPI.prototype.fetchPaymentConfigs = function () {
386
+ return this.request("/kiosk/payment-config");
387
+ };
385
388
  return PosAPI;
386
389
  }());
387
390
  export default PosAPI;
@@ -21,6 +21,22 @@ export interface ConfigState {
21
21
  error: RequestError | null;
22
22
  retries: number;
23
23
  accessibilityOn?: boolean;
24
+ paymentConfigs: {
25
+ integration: string;
26
+ is_testing: boolean;
27
+ merchant_api_key: string;
28
+ merchant_id: string;
29
+ merchant_password: string;
30
+ merchant_username: string;
31
+ offline_limit: string;
32
+ saved_cards: boolean;
33
+ signature_threshold: string | null;
34
+ freedompay_store_id: string;
35
+ card_stor_service_url: string;
36
+ client_selling_system: string;
37
+ client_selling_system_version: string;
38
+ freedompay_terminal_id: string;
39
+ } | null;
24
40
  }
25
41
  export declare enum ConfigActionType {
26
42
  FetchConfig = "config/getConfig"
@@ -25,14 +25,15 @@ var initialState = {
25
25
  loading: 'idle',
26
26
  error: null,
27
27
  retries: 0,
28
- accessibilityOn: false
28
+ accessibilityOn: false,
29
+ paymentConfigs: null
29
30
  };
30
31
  export var ConfigActionType;
31
32
  (function (ConfigActionType) {
32
33
  ConfigActionType["FetchConfig"] = "config/getConfig";
33
34
  })(ConfigActionType || (ConfigActionType = {}));
34
35
  export var fetchConfig = createAsyncThunk(ConfigActionType.FetchConfig, function (_a, _b) { return __awaiter(void 0, [_a, _b], void 0, function (_c, _d) {
35
- var posTerminalId, kdsTerminalId, app, api, _e, _f, devicesList, _g, stores, _h, selectOptions, _j, itemTypes, _k, menuColors, store, devices, err, cashier, employee, tz, businessDate, err_1, err_2;
36
+ var posTerminalId, kdsTerminalId, app, api, _e, _f, devicesList, _g, stores, _h, selectOptions, _j, itemTypes, _k, menuColors, paymentConfigs, store, devices, err, cashier, employee, tz, businessDate, err_1, err_2;
36
37
  var apiUrl = _c.apiUrl;
37
38
  var dispatch = _d.dispatch, getState = _d.getState, rejectWithValue = _d.rejectWithValue;
38
39
  return __generator(this, function (_l) {
@@ -54,10 +55,11 @@ export var fetchConfig = createAsyncThunk(ConfigActionType.FetchConfig, function
54
55
  // api.getSettings<SelectOptions>('SELECT_OPTION'),
55
56
  api.getSelectOptions(),
56
57
  api.getSettings('ITEM_TYPE'),
57
- api.getSettings('ITEM_COLORS')
58
+ api.getSettings('ITEM_COLORS'),
59
+ api.fetchPaymentConfigs()
58
60
  ])];
59
61
  case 1:
60
- _e = _l.sent(), _f = _e[0], devicesList = _f === void 0 ? [] : _f, _g = _e[1], stores = _g === void 0 ? [] : _g, _h = _e[2], selectOptions = _h === void 0 ? [] : _h, _j = _e[3], itemTypes = _j === void 0 ? [] : _j, _k = _e[4], menuColors = _k === void 0 ? [] : _k;
62
+ _e = _l.sent(), _f = _e[0], devicesList = _f === void 0 ? [] : _f, _g = _e[1], stores = _g === void 0 ? [] : _g, _h = _e[2], selectOptions = _h === void 0 ? [] : _h, _j = _e[3], itemTypes = _j === void 0 ? [] : _j, _k = _e[4], menuColors = _k === void 0 ? [] : _k, paymentConfigs = _e[5];
61
63
  store = stores[0] || null;
62
64
  devices = devicesList[0] || null;
63
65
  if (!store || !devices) {
@@ -99,7 +101,8 @@ export var fetchConfig = createAsyncThunk(ConfigActionType.FetchConfig, function
99
101
  hasCashDrawer: true,
100
102
  error: null,
101
103
  loading: 'idle',
102
- retries: 0
104
+ retries: 0,
105
+ paymentConfigs: paymentConfigs
103
106
  }];
104
107
  case 6:
105
108
  err_2 = _l.sent();
@@ -138,7 +141,7 @@ var configSlice = createSlice({
138
141
  state.loading = 'pending';
139
142
  })
140
143
  .addCase(fetchConfig.fulfilled, function (state, action) {
141
- var _a = action.payload, api = _a.api, app = _a.app, devices = _a.devices, store = _a.store, selectOptions = _a.selectOptions, menuColors = _a.menuColors, hasPinpad = _a.hasPinpad, hasCashDrawer = _a.hasCashDrawer;
144
+ var _a = action.payload, api = _a.api, app = _a.app, devices = _a.devices, store = _a.store, selectOptions = _a.selectOptions, menuColors = _a.menuColors, hasPinpad = _a.hasPinpad, hasCashDrawer = _a.hasCashDrawer, paymentConfigs = _a.paymentConfigs;
142
145
  state.api = api;
143
146
  state.app = app;
144
147
  state.store = store;
@@ -150,6 +153,7 @@ var configSlice = createSlice({
150
153
  state.loading = 'idle';
151
154
  state.retries = 0;
152
155
  state.error = null;
156
+ state.paymentConfigs = paymentConfigs;
153
157
  })
154
158
  .addCase(fetchConfig.rejected, function (state, action) {
155
159
  state.error = action.payload;
@@ -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",
@@ -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.302",
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",