@ekyc_qoobiss/qbs-ect-cmp 1.12.6 → 1.12.8
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/agreement-check_17.cjs.entry.js +63 -17
- package/dist/collection/components/identification-component/identification-component.js +39 -13
- package/dist/collection/helpers/ApiCall.js +1 -2
- package/dist/collection/helpers/Events.js +2 -4
- package/dist/collection/helpers/store.js +18 -0
- package/dist/collection/helpers/textValues.js +4 -0
- package/dist/esm/agreement-check_17.entry.js +63 -17
- package/dist/qbs-ect-cmp/{p-2b405f2e.entry.js → p-ee681a53.entry.js} +2 -2
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/helpers/textValues.d.ts +4 -0
- package/package.json +1 -1
|
@@ -262,6 +262,10 @@ class SessionKeys {
|
|
|
262
262
|
SessionKeys.FlowStatusKey = 'qbs-ect-flowstatus';
|
|
263
263
|
SessionKeys.RequestIdKey = 'qbs-ect-requestid';
|
|
264
264
|
SessionKeys.TokenKey = 'qbs-ect-token';
|
|
265
|
+
SessionKeys.InitialisedKey = 'qbs-ect-initialised';
|
|
266
|
+
SessionKeys.HasIdBackKey = 'qbs-ect-has-id-back';
|
|
267
|
+
SessionKeys.AgreementValidationKey = 'qbs-ect-agreement-validation';
|
|
268
|
+
SessionKeys.PhoneValidationKey = 'qbs-ect-phone-validation';
|
|
265
269
|
class IdCaptureValues extends GlobalValues {
|
|
266
270
|
}
|
|
267
271
|
IdCaptureValues.Button = 'Încerc din nou';
|
|
@@ -356,6 +360,24 @@ const { state, onChange } = createStore({
|
|
|
356
360
|
});
|
|
357
361
|
onChange('flowStatus', value => {
|
|
358
362
|
sessionStorage.setItem(SessionKeys.FlowStatusKey, FlowStatus[value]);
|
|
363
|
+
});
|
|
364
|
+
onChange('token', value => {
|
|
365
|
+
sessionStorage.setItem(SessionKeys.TokenKey, value);
|
|
366
|
+
});
|
|
367
|
+
onChange('requestId', value => {
|
|
368
|
+
sessionStorage.setItem(SessionKeys.RequestIdKey, value);
|
|
369
|
+
});
|
|
370
|
+
onChange('initialised', value => {
|
|
371
|
+
sessionStorage.setItem(SessionKeys.InitialisedKey, String(value));
|
|
372
|
+
});
|
|
373
|
+
onChange('hasIdBack', value => {
|
|
374
|
+
sessionStorage.setItem(SessionKeys.HasIdBackKey, String(value));
|
|
375
|
+
});
|
|
376
|
+
onChange('agreementsValidation', value => {
|
|
377
|
+
sessionStorage.setItem(SessionKeys.AgreementValidationKey, String(value));
|
|
378
|
+
});
|
|
379
|
+
onChange('phoneValidation', value => {
|
|
380
|
+
sessionStorage.setItem(SessionKeys.PhoneValidationKey, String(value));
|
|
359
381
|
});
|
|
360
382
|
|
|
361
383
|
class ApiCall {
|
|
@@ -419,7 +441,6 @@ class ApiCall {
|
|
|
419
441
|
let jsonResp = await this.post(this.urls.IdentityInsert, JSON.stringify(data));
|
|
420
442
|
if (state.requestId == '') {
|
|
421
443
|
state.requestId = jsonResp.requestId;
|
|
422
|
-
sessionStorage.setItem(SessionKeys.RequestIdKey, jsonResp.requestId);
|
|
423
444
|
}
|
|
424
445
|
state.hasIdBack = jsonResp.hasIdBack;
|
|
425
446
|
state.agreementsValidation = jsonResp.agreementsValidation;
|
|
@@ -5122,9 +5143,7 @@ class Events {
|
|
|
5122
5143
|
}));
|
|
5123
5144
|
}
|
|
5124
5145
|
static flowCompleted() {
|
|
5125
|
-
sessionStorage.
|
|
5126
|
-
sessionStorage.removeItem(SessionKeys.FlowStatusKey);
|
|
5127
|
-
sessionStorage.removeItem(SessionKeys.TokenKey);
|
|
5146
|
+
sessionStorage.clear();
|
|
5128
5147
|
this.cameraModule.dispatchEvent(new CustomEvent('ect-completed', {
|
|
5129
5148
|
detail: {},
|
|
5130
5149
|
bubbles: true,
|
|
@@ -5133,6 +5152,7 @@ class Events {
|
|
|
5133
5152
|
}));
|
|
5134
5153
|
}
|
|
5135
5154
|
static flowError(error) {
|
|
5155
|
+
sessionStorage.clear();
|
|
5136
5156
|
this.cameraModule.dispatchEvent(new CustomEvent('ect-error', {
|
|
5137
5157
|
detail: { error },
|
|
5138
5158
|
bubbles: true,
|
|
@@ -5974,18 +5994,16 @@ const IdentificationComponent = class {
|
|
|
5974
5994
|
}
|
|
5975
5995
|
if (state.token !== newValue) {
|
|
5976
5996
|
state.token = newValue;
|
|
5977
|
-
sessionStorage.setItem(SessionKeys.TokenKey, state.token);
|
|
5978
5997
|
await this.initializeRequest();
|
|
5979
5998
|
}
|
|
5980
5999
|
}
|
|
5981
6000
|
async onOrderIdChange(newValue, _oldValue) {
|
|
5982
6001
|
if (state.requestId !== newValue) {
|
|
5983
6002
|
state.requestId = newValue;
|
|
5984
|
-
sessionStorage.setItem(SessionKeys.RequestIdKey, state.requestId);
|
|
5985
6003
|
state.initialised = false;
|
|
6004
|
+
sessionStorage.clear();
|
|
5986
6005
|
if (state.flowStatus != FlowStatus.LANDING) {
|
|
5987
6006
|
state.flowStatus = FlowStatus.LANDING;
|
|
5988
|
-
sessionStorage.setItem(SessionKeys.FlowStatusKey, FlowStatus[state.flowStatus]);
|
|
5989
6007
|
}
|
|
5990
6008
|
await this.initializeRequest();
|
|
5991
6009
|
}
|
|
@@ -6061,27 +6079,55 @@ const IdentificationComponent = class {
|
|
|
6061
6079
|
}
|
|
6062
6080
|
async componentWillLoad() {
|
|
6063
6081
|
Events.init(window);
|
|
6082
|
+
state.apiBaseUrl = this.api_url;
|
|
6083
|
+
state.environment = this.env;
|
|
6064
6084
|
if (this.token) {
|
|
6065
6085
|
state.token = this.token;
|
|
6066
6086
|
}
|
|
6067
|
-
|
|
6068
|
-
state.
|
|
6069
|
-
sessionStorage.setItem(SessionKeys.RequestIdKey, state.requestId);
|
|
6087
|
+
else {
|
|
6088
|
+
state.token = sessionStorage.getItem(SessionKeys.TokenKey);
|
|
6070
6089
|
}
|
|
6071
6090
|
if (this.redirect_id) {
|
|
6072
6091
|
state.redirectId = this.redirect_id;
|
|
6073
6092
|
}
|
|
6074
|
-
|
|
6075
|
-
|
|
6093
|
+
var flowSt = sessionStorage.getItem(SessionKeys.FlowStatusKey);
|
|
6094
|
+
if (flowSt) {
|
|
6095
|
+
state.flowStatus = FlowStatus[flowSt];
|
|
6096
|
+
}
|
|
6097
|
+
if (!state.flowStatus) {
|
|
6098
|
+
state.flowStatus = FlowStatus.LANDING;
|
|
6099
|
+
}
|
|
6100
|
+
var ini = sessionStorage.getItem(SessionKeys.InitialisedKey);
|
|
6101
|
+
if (ini && ini.toLowerCase() == 'true') {
|
|
6102
|
+
state.initialised = true;
|
|
6103
|
+
}
|
|
6104
|
+
var hasIdBk = sessionStorage.getItem(SessionKeys.HasIdBackKey);
|
|
6105
|
+
if (hasIdBk && hasIdBk.toLowerCase() == 'true') {
|
|
6106
|
+
state.hasIdBack = true;
|
|
6107
|
+
}
|
|
6108
|
+
var agrVal = sessionStorage.getItem(SessionKeys.AgreementValidationKey);
|
|
6109
|
+
if (agrVal && agrVal.toLowerCase() == 'true') {
|
|
6110
|
+
state.agreementsValidation = true;
|
|
6111
|
+
}
|
|
6112
|
+
var phoneVal = sessionStorage.getItem(SessionKeys.PhoneValidationKey);
|
|
6113
|
+
if (phoneVal && phoneVal.toLowerCase() == 'true') {
|
|
6114
|
+
state.phoneValidation = true;
|
|
6115
|
+
}
|
|
6116
|
+
const savedRequest = sessionStorage.getItem(SessionKeys.RequestIdKey);
|
|
6117
|
+
if (this.order_id) {
|
|
6118
|
+
if (savedRequest && savedRequest != this.order_id) {
|
|
6119
|
+
sessionStorage.clear();
|
|
6120
|
+
state.flowStatus = FlowStatus.LANDING;
|
|
6121
|
+
state.initialised = false;
|
|
6122
|
+
}
|
|
6123
|
+
else {
|
|
6124
|
+
state.requestId = this.order_id;
|
|
6125
|
+
}
|
|
6126
|
+
}
|
|
6076
6127
|
this.apiCall = new ApiCall();
|
|
6077
6128
|
await this.initializeRequest();
|
|
6078
6129
|
}
|
|
6079
6130
|
componentWillRender() {
|
|
6080
|
-
state.flowStatus = FlowStatus[sessionStorage.getItem(SessionKeys.FlowStatusKey)];
|
|
6081
|
-
if (!state.flowStatus) {
|
|
6082
|
-
state.flowStatus = FlowStatus.LANDING;
|
|
6083
|
-
sessionStorage.setItem(SessionKeys.FlowStatusKey, FlowStatus[state.flowStatus]);
|
|
6084
|
-
}
|
|
6085
6131
|
if (this.idSide == '') {
|
|
6086
6132
|
this.idSide = state.hasIdBack ? 'front' : '';
|
|
6087
6133
|
}
|
|
@@ -15,18 +15,16 @@ export class IdentificationComponent {
|
|
|
15
15
|
}
|
|
16
16
|
if (store.token !== newValue) {
|
|
17
17
|
store.token = newValue;
|
|
18
|
-
sessionStorage.setItem(SessionKeys.TokenKey, store.token);
|
|
19
18
|
await this.initializeRequest();
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
21
|
async onOrderIdChange(newValue, _oldValue) {
|
|
23
22
|
if (store.requestId !== newValue) {
|
|
24
23
|
store.requestId = newValue;
|
|
25
|
-
sessionStorage.setItem(SessionKeys.RequestIdKey, store.requestId);
|
|
26
24
|
store.initialised = false;
|
|
25
|
+
sessionStorage.clear();
|
|
27
26
|
if (store.flowStatus != FlowStatus.LANDING) {
|
|
28
27
|
store.flowStatus = FlowStatus.LANDING;
|
|
29
|
-
sessionStorage.setItem(SessionKeys.FlowStatusKey, FlowStatus[store.flowStatus]);
|
|
30
28
|
}
|
|
31
29
|
await this.initializeRequest();
|
|
32
30
|
}
|
|
@@ -101,27 +99,55 @@ export class IdentificationComponent {
|
|
|
101
99
|
}
|
|
102
100
|
async componentWillLoad() {
|
|
103
101
|
Events.init(window);
|
|
102
|
+
store.apiBaseUrl = this.api_url;
|
|
103
|
+
store.environment = this.env;
|
|
104
104
|
if (this.token) {
|
|
105
105
|
store.token = this.token;
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
store.
|
|
109
|
-
sessionStorage.setItem(SessionKeys.RequestIdKey, store.requestId);
|
|
107
|
+
else {
|
|
108
|
+
store.token = sessionStorage.getItem(SessionKeys.TokenKey);
|
|
110
109
|
}
|
|
111
110
|
if (this.redirect_id) {
|
|
112
111
|
store.redirectId = this.redirect_id;
|
|
113
112
|
}
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
var flowSt = sessionStorage.getItem(SessionKeys.FlowStatusKey);
|
|
114
|
+
if (flowSt) {
|
|
115
|
+
store.flowStatus = FlowStatus[flowSt];
|
|
116
|
+
}
|
|
117
|
+
if (!store.flowStatus) {
|
|
118
|
+
store.flowStatus = FlowStatus.LANDING;
|
|
119
|
+
}
|
|
120
|
+
var ini = sessionStorage.getItem(SessionKeys.InitialisedKey);
|
|
121
|
+
if (ini && ini.toLowerCase() == 'true') {
|
|
122
|
+
store.initialised = true;
|
|
123
|
+
}
|
|
124
|
+
var hasIdBk = sessionStorage.getItem(SessionKeys.HasIdBackKey);
|
|
125
|
+
if (hasIdBk && hasIdBk.toLowerCase() == 'true') {
|
|
126
|
+
store.hasIdBack = true;
|
|
127
|
+
}
|
|
128
|
+
var agrVal = sessionStorage.getItem(SessionKeys.AgreementValidationKey);
|
|
129
|
+
if (agrVal && agrVal.toLowerCase() == 'true') {
|
|
130
|
+
store.agreementsValidation = true;
|
|
131
|
+
}
|
|
132
|
+
var phoneVal = sessionStorage.getItem(SessionKeys.PhoneValidationKey);
|
|
133
|
+
if (phoneVal && phoneVal.toLowerCase() == 'true') {
|
|
134
|
+
store.phoneValidation = true;
|
|
135
|
+
}
|
|
136
|
+
const savedRequest = sessionStorage.getItem(SessionKeys.RequestIdKey);
|
|
137
|
+
if (this.order_id) {
|
|
138
|
+
if (savedRequest && savedRequest != this.order_id) {
|
|
139
|
+
sessionStorage.clear();
|
|
140
|
+
store.flowStatus = FlowStatus.LANDING;
|
|
141
|
+
store.initialised = false;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
store.requestId = this.order_id;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
116
147
|
this.apiCall = new ApiCall();
|
|
117
148
|
await this.initializeRequest();
|
|
118
149
|
}
|
|
119
150
|
componentWillRender() {
|
|
120
|
-
store.flowStatus = FlowStatus[sessionStorage.getItem(SessionKeys.FlowStatusKey)];
|
|
121
|
-
if (!store.flowStatus) {
|
|
122
|
-
store.flowStatus = FlowStatus.LANDING;
|
|
123
|
-
sessionStorage.setItem(SessionKeys.FlowStatusKey, FlowStatus[store.flowStatus]);
|
|
124
|
-
}
|
|
125
151
|
if (this.idSide == '') {
|
|
126
152
|
this.idSide = store.hasIdBack ? 'front' : '';
|
|
127
153
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OrderStatuses } from '../models/OrderStatuses';
|
|
2
2
|
import store from './store';
|
|
3
|
-
import { ApiUrls
|
|
3
|
+
import { ApiUrls } from './textValues';
|
|
4
4
|
import { FlowStatus } from '../models/FlowStatus';
|
|
5
5
|
export class ApiCall {
|
|
6
6
|
constructor() {
|
|
@@ -63,7 +63,6 @@ export class ApiCall {
|
|
|
63
63
|
let jsonResp = await this.post(this.urls.IdentityInsert, JSON.stringify(data));
|
|
64
64
|
if (store.requestId == '') {
|
|
65
65
|
store.requestId = jsonResp.requestId;
|
|
66
|
-
sessionStorage.setItem(SessionKeys.RequestIdKey, jsonResp.requestId);
|
|
67
66
|
}
|
|
68
67
|
store.hasIdBack = jsonResp.hasIdBack;
|
|
69
68
|
store.agreementsValidation = jsonResp.agreementsValidation;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SessionKeys } from './textValues';
|
|
2
1
|
export default class Events {
|
|
3
2
|
static init(element) {
|
|
4
3
|
this.cameraModule = element;
|
|
@@ -12,9 +11,7 @@ export default class Events {
|
|
|
12
11
|
}));
|
|
13
12
|
}
|
|
14
13
|
static flowCompleted() {
|
|
15
|
-
sessionStorage.
|
|
16
|
-
sessionStorage.removeItem(SessionKeys.FlowStatusKey);
|
|
17
|
-
sessionStorage.removeItem(SessionKeys.TokenKey);
|
|
14
|
+
sessionStorage.clear();
|
|
18
15
|
this.cameraModule.dispatchEvent(new CustomEvent('ect-completed', {
|
|
19
16
|
detail: {},
|
|
20
17
|
bubbles: true,
|
|
@@ -23,6 +20,7 @@ export default class Events {
|
|
|
23
20
|
}));
|
|
24
21
|
}
|
|
25
22
|
static flowError(error) {
|
|
23
|
+
sessionStorage.clear();
|
|
26
24
|
this.cameraModule.dispatchEvent(new CustomEvent('ect-error', {
|
|
27
25
|
detail: { error },
|
|
28
26
|
bubbles: true,
|
|
@@ -18,4 +18,22 @@ const { state, onChange } = createStore({
|
|
|
18
18
|
onChange('flowStatus', value => {
|
|
19
19
|
sessionStorage.setItem(SessionKeys.FlowStatusKey, FlowStatus[value]);
|
|
20
20
|
});
|
|
21
|
+
onChange('token', value => {
|
|
22
|
+
sessionStorage.setItem(SessionKeys.TokenKey, value);
|
|
23
|
+
});
|
|
24
|
+
onChange('requestId', value => {
|
|
25
|
+
sessionStorage.setItem(SessionKeys.RequestIdKey, value);
|
|
26
|
+
});
|
|
27
|
+
onChange('initialised', value => {
|
|
28
|
+
sessionStorage.setItem(SessionKeys.InitialisedKey, String(value));
|
|
29
|
+
});
|
|
30
|
+
onChange('hasIdBack', value => {
|
|
31
|
+
sessionStorage.setItem(SessionKeys.HasIdBackKey, String(value));
|
|
32
|
+
});
|
|
33
|
+
onChange('agreementsValidation', value => {
|
|
34
|
+
sessionStorage.setItem(SessionKeys.AgreementValidationKey, String(value));
|
|
35
|
+
});
|
|
36
|
+
onChange('phoneValidation', value => {
|
|
37
|
+
sessionStorage.setItem(SessionKeys.PhoneValidationKey, String(value));
|
|
38
|
+
});
|
|
21
39
|
export default state;
|
|
@@ -45,6 +45,10 @@ export class SessionKeys {
|
|
|
45
45
|
SessionKeys.FlowStatusKey = 'qbs-ect-flowstatus';
|
|
46
46
|
SessionKeys.RequestIdKey = 'qbs-ect-requestid';
|
|
47
47
|
SessionKeys.TokenKey = 'qbs-ect-token';
|
|
48
|
+
SessionKeys.InitialisedKey = 'qbs-ect-initialised';
|
|
49
|
+
SessionKeys.HasIdBackKey = 'qbs-ect-has-id-back';
|
|
50
|
+
SessionKeys.AgreementValidationKey = 'qbs-ect-agreement-validation';
|
|
51
|
+
SessionKeys.PhoneValidationKey = 'qbs-ect-phone-validation';
|
|
48
52
|
export class IdCaptureValues extends GlobalValues {
|
|
49
53
|
}
|
|
50
54
|
IdCaptureValues.Button = 'Încerc din nou';
|
|
@@ -258,6 +258,10 @@ class SessionKeys {
|
|
|
258
258
|
SessionKeys.FlowStatusKey = 'qbs-ect-flowstatus';
|
|
259
259
|
SessionKeys.RequestIdKey = 'qbs-ect-requestid';
|
|
260
260
|
SessionKeys.TokenKey = 'qbs-ect-token';
|
|
261
|
+
SessionKeys.InitialisedKey = 'qbs-ect-initialised';
|
|
262
|
+
SessionKeys.HasIdBackKey = 'qbs-ect-has-id-back';
|
|
263
|
+
SessionKeys.AgreementValidationKey = 'qbs-ect-agreement-validation';
|
|
264
|
+
SessionKeys.PhoneValidationKey = 'qbs-ect-phone-validation';
|
|
261
265
|
class IdCaptureValues extends GlobalValues {
|
|
262
266
|
}
|
|
263
267
|
IdCaptureValues.Button = 'Încerc din nou';
|
|
@@ -352,6 +356,24 @@ const { state, onChange } = createStore({
|
|
|
352
356
|
});
|
|
353
357
|
onChange('flowStatus', value => {
|
|
354
358
|
sessionStorage.setItem(SessionKeys.FlowStatusKey, FlowStatus[value]);
|
|
359
|
+
});
|
|
360
|
+
onChange('token', value => {
|
|
361
|
+
sessionStorage.setItem(SessionKeys.TokenKey, value);
|
|
362
|
+
});
|
|
363
|
+
onChange('requestId', value => {
|
|
364
|
+
sessionStorage.setItem(SessionKeys.RequestIdKey, value);
|
|
365
|
+
});
|
|
366
|
+
onChange('initialised', value => {
|
|
367
|
+
sessionStorage.setItem(SessionKeys.InitialisedKey, String(value));
|
|
368
|
+
});
|
|
369
|
+
onChange('hasIdBack', value => {
|
|
370
|
+
sessionStorage.setItem(SessionKeys.HasIdBackKey, String(value));
|
|
371
|
+
});
|
|
372
|
+
onChange('agreementsValidation', value => {
|
|
373
|
+
sessionStorage.setItem(SessionKeys.AgreementValidationKey, String(value));
|
|
374
|
+
});
|
|
375
|
+
onChange('phoneValidation', value => {
|
|
376
|
+
sessionStorage.setItem(SessionKeys.PhoneValidationKey, String(value));
|
|
355
377
|
});
|
|
356
378
|
|
|
357
379
|
class ApiCall {
|
|
@@ -415,7 +437,6 @@ class ApiCall {
|
|
|
415
437
|
let jsonResp = await this.post(this.urls.IdentityInsert, JSON.stringify(data));
|
|
416
438
|
if (state.requestId == '') {
|
|
417
439
|
state.requestId = jsonResp.requestId;
|
|
418
|
-
sessionStorage.setItem(SessionKeys.RequestIdKey, jsonResp.requestId);
|
|
419
440
|
}
|
|
420
441
|
state.hasIdBack = jsonResp.hasIdBack;
|
|
421
442
|
state.agreementsValidation = jsonResp.agreementsValidation;
|
|
@@ -5118,9 +5139,7 @@ class Events {
|
|
|
5118
5139
|
}));
|
|
5119
5140
|
}
|
|
5120
5141
|
static flowCompleted() {
|
|
5121
|
-
sessionStorage.
|
|
5122
|
-
sessionStorage.removeItem(SessionKeys.FlowStatusKey);
|
|
5123
|
-
sessionStorage.removeItem(SessionKeys.TokenKey);
|
|
5142
|
+
sessionStorage.clear();
|
|
5124
5143
|
this.cameraModule.dispatchEvent(new CustomEvent('ect-completed', {
|
|
5125
5144
|
detail: {},
|
|
5126
5145
|
bubbles: true,
|
|
@@ -5129,6 +5148,7 @@ class Events {
|
|
|
5129
5148
|
}));
|
|
5130
5149
|
}
|
|
5131
5150
|
static flowError(error) {
|
|
5151
|
+
sessionStorage.clear();
|
|
5132
5152
|
this.cameraModule.dispatchEvent(new CustomEvent('ect-error', {
|
|
5133
5153
|
detail: { error },
|
|
5134
5154
|
bubbles: true,
|
|
@@ -5970,18 +5990,16 @@ const IdentificationComponent = class {
|
|
|
5970
5990
|
}
|
|
5971
5991
|
if (state.token !== newValue) {
|
|
5972
5992
|
state.token = newValue;
|
|
5973
|
-
sessionStorage.setItem(SessionKeys.TokenKey, state.token);
|
|
5974
5993
|
await this.initializeRequest();
|
|
5975
5994
|
}
|
|
5976
5995
|
}
|
|
5977
5996
|
async onOrderIdChange(newValue, _oldValue) {
|
|
5978
5997
|
if (state.requestId !== newValue) {
|
|
5979
5998
|
state.requestId = newValue;
|
|
5980
|
-
sessionStorage.setItem(SessionKeys.RequestIdKey, state.requestId);
|
|
5981
5999
|
state.initialised = false;
|
|
6000
|
+
sessionStorage.clear();
|
|
5982
6001
|
if (state.flowStatus != FlowStatus.LANDING) {
|
|
5983
6002
|
state.flowStatus = FlowStatus.LANDING;
|
|
5984
|
-
sessionStorage.setItem(SessionKeys.FlowStatusKey, FlowStatus[state.flowStatus]);
|
|
5985
6003
|
}
|
|
5986
6004
|
await this.initializeRequest();
|
|
5987
6005
|
}
|
|
@@ -6057,27 +6075,55 @@ const IdentificationComponent = class {
|
|
|
6057
6075
|
}
|
|
6058
6076
|
async componentWillLoad() {
|
|
6059
6077
|
Events.init(window);
|
|
6078
|
+
state.apiBaseUrl = this.api_url;
|
|
6079
|
+
state.environment = this.env;
|
|
6060
6080
|
if (this.token) {
|
|
6061
6081
|
state.token = this.token;
|
|
6062
6082
|
}
|
|
6063
|
-
|
|
6064
|
-
state.
|
|
6065
|
-
sessionStorage.setItem(SessionKeys.RequestIdKey, state.requestId);
|
|
6083
|
+
else {
|
|
6084
|
+
state.token = sessionStorage.getItem(SessionKeys.TokenKey);
|
|
6066
6085
|
}
|
|
6067
6086
|
if (this.redirect_id) {
|
|
6068
6087
|
state.redirectId = this.redirect_id;
|
|
6069
6088
|
}
|
|
6070
|
-
|
|
6071
|
-
|
|
6089
|
+
var flowSt = sessionStorage.getItem(SessionKeys.FlowStatusKey);
|
|
6090
|
+
if (flowSt) {
|
|
6091
|
+
state.flowStatus = FlowStatus[flowSt];
|
|
6092
|
+
}
|
|
6093
|
+
if (!state.flowStatus) {
|
|
6094
|
+
state.flowStatus = FlowStatus.LANDING;
|
|
6095
|
+
}
|
|
6096
|
+
var ini = sessionStorage.getItem(SessionKeys.InitialisedKey);
|
|
6097
|
+
if (ini && ini.toLowerCase() == 'true') {
|
|
6098
|
+
state.initialised = true;
|
|
6099
|
+
}
|
|
6100
|
+
var hasIdBk = sessionStorage.getItem(SessionKeys.HasIdBackKey);
|
|
6101
|
+
if (hasIdBk && hasIdBk.toLowerCase() == 'true') {
|
|
6102
|
+
state.hasIdBack = true;
|
|
6103
|
+
}
|
|
6104
|
+
var agrVal = sessionStorage.getItem(SessionKeys.AgreementValidationKey);
|
|
6105
|
+
if (agrVal && agrVal.toLowerCase() == 'true') {
|
|
6106
|
+
state.agreementsValidation = true;
|
|
6107
|
+
}
|
|
6108
|
+
var phoneVal = sessionStorage.getItem(SessionKeys.PhoneValidationKey);
|
|
6109
|
+
if (phoneVal && phoneVal.toLowerCase() == 'true') {
|
|
6110
|
+
state.phoneValidation = true;
|
|
6111
|
+
}
|
|
6112
|
+
const savedRequest = sessionStorage.getItem(SessionKeys.RequestIdKey);
|
|
6113
|
+
if (this.order_id) {
|
|
6114
|
+
if (savedRequest && savedRequest != this.order_id) {
|
|
6115
|
+
sessionStorage.clear();
|
|
6116
|
+
state.flowStatus = FlowStatus.LANDING;
|
|
6117
|
+
state.initialised = false;
|
|
6118
|
+
}
|
|
6119
|
+
else {
|
|
6120
|
+
state.requestId = this.order_id;
|
|
6121
|
+
}
|
|
6122
|
+
}
|
|
6072
6123
|
this.apiCall = new ApiCall();
|
|
6073
6124
|
await this.initializeRequest();
|
|
6074
6125
|
}
|
|
6075
6126
|
componentWillRender() {
|
|
6076
|
-
state.flowStatus = FlowStatus[sessionStorage.getItem(SessionKeys.FlowStatusKey)];
|
|
6077
|
-
if (!state.flowStatus) {
|
|
6078
|
-
state.flowStatus = FlowStatus.LANDING;
|
|
6079
|
-
sessionStorage.setItem(SessionKeys.FlowStatusKey, FlowStatus[state.flowStatus]);
|
|
6080
|
-
}
|
|
6081
6127
|
if (this.idSide == '') {
|
|
6082
6128
|
this.idSide = state.hasIdBack ? 'front' : '';
|
|
6083
6129
|
}
|