@tap-payments/auth-jsconnect 2.10.12-beta → 2.10.13-beta
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/build/app/settings.d.ts +1 -0
- package/build/app/settings.js +7 -3
- package/build/constants/app.d.ts +1 -0
- package/build/constants/app.js +1 -0
- package/build/features/app/connectExpress/connectExpressStore.js +37 -18
- package/build/features/shared/Background/LogoBackground.js +1 -1
- package/package.json +1 -1
package/build/app/settings.d.ts
CHANGED
package/build/app/settings.js
CHANGED
|
@@ -56,7 +56,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
56
56
|
};
|
|
57
57
|
var _a;
|
|
58
58
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
59
|
-
import { getStoredData, storeData, isArray, findItem, getBrowserInfo, getFingerPrint, sortCountries, findCountryByIso2, getRequestHeaders, encryptString, dangerousMessage, getParameterByName, setBaseUrl, getUserLanguage } from '../utils';
|
|
59
|
+
import { getStoredData, storeData, isArray, findItem, getBrowserInfo, getFingerPrint, sortCountries, findCountryByIso2, getRequestHeaders, encryptString, dangerousMessage, getParameterByName, setBaseUrl, getUserLanguage, sleep } from '../utils';
|
|
60
60
|
import { BUSINESS_COUNTRIES, DEFAULT_COUNTRY_ISO2, DefaultDeviceInfo, LOCAL_STORAGE_KEYS } from '../constants';
|
|
61
61
|
import i18n from '../i18n';
|
|
62
62
|
import { updateLocale } from '../utils/locale';
|
|
@@ -179,7 +179,7 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
|
|
|
179
179
|
});
|
|
180
180
|
}); });
|
|
181
181
|
export var onCloseComplete = createAsyncThunk('settings/onCloseComplete', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
182
|
-
var settings, _a, appConfig, authId, postURL, redirectUrl, bi, merchantId, brandId, entityId, body, data, urlQueryStart, newUrl;
|
|
182
|
+
var settings, _a, appConfig, authId, postURL, redirectUrl, bi, merchantId, brandId, entityId, nextScreen, body, data, urlQueryStart, newUrl;
|
|
183
183
|
var _b, _c;
|
|
184
184
|
return __generator(this, function (_d) {
|
|
185
185
|
switch (_d.label) {
|
|
@@ -188,7 +188,7 @@ export var onCloseComplete = createAsyncThunk('settings/onCloseComplete', functi
|
|
|
188
188
|
_a = settings.data, appConfig = _a.appConfig, authId = _a.authId;
|
|
189
189
|
postURL = appConfig.postURL, redirectUrl = appConfig.redirectUrl;
|
|
190
190
|
bi = settings.data.deviceInfo.browser.browser_id;
|
|
191
|
-
merchantId = params.merchantId, brandId = params.brandId, entityId = params.entityId;
|
|
191
|
+
merchantId = params.merchantId, brandId = params.brandId, entityId = params.entityId, nextScreen = params.nextScreen;
|
|
192
192
|
if (!authId) return [3, 2];
|
|
193
193
|
body = {
|
|
194
194
|
post_url: postURL || '',
|
|
@@ -203,6 +203,10 @@ export var onCloseComplete = createAsyncThunk('settings/onCloseComplete', functi
|
|
|
203
203
|
case 1:
|
|
204
204
|
data = _d.sent();
|
|
205
205
|
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, data);
|
|
206
|
+
if (nextScreen) {
|
|
207
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen(nextScreen)); });
|
|
208
|
+
return [2];
|
|
209
|
+
}
|
|
206
210
|
if (settings.data.appConfig.mode === 'popup') {
|
|
207
211
|
settings.data.appConfig.onFlowCompleted({ auth_id: authId, bi: bi });
|
|
208
212
|
thunkApi.dispatch(handleOpen(false));
|
package/build/constants/app.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const LOCAL_STORAGE_KEYS: {
|
|
|
11
11
|
languageMode: string;
|
|
12
12
|
};
|
|
13
13
|
export declare const SCOPE_AUTH = "auth";
|
|
14
|
+
export declare const SCOPE_MERCHANT = "merchant";
|
|
14
15
|
export declare const DEFAULT_COUNTRY_ISO2 = "KW";
|
|
15
16
|
export declare const NAFATH_VERIFICATION_FAILED = "nafath_verification_failed";
|
|
16
17
|
export declare const COLLECT_DOB_INFO_NAFATH = "collect_date_of_birth";
|
package/build/constants/app.js
CHANGED
|
@@ -12,6 +12,7 @@ export var LOCAL_STORAGE_KEYS = {
|
|
|
12
12
|
languageMode: 'languageMode'
|
|
13
13
|
};
|
|
14
14
|
export var SCOPE_AUTH = 'auth';
|
|
15
|
+
export var SCOPE_MERCHANT = 'merchant';
|
|
15
16
|
export var DEFAULT_COUNTRY_ISO2 = 'KW';
|
|
16
17
|
export var NAFATH_VERIFICATION_FAILED = 'nafath_verification_failed';
|
|
17
18
|
export var COLLECT_DOB_INFO_NAFATH = 'collect_date_of_birth';
|
|
@@ -59,7 +59,7 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
|
59
59
|
import { handleNextScreenStep, handleCurrentActiveScreen, handleOpen, handleSetCountryByIso2, onCloseComplete, storeAuthId } from '../../../app/settings';
|
|
60
60
|
import { FlowsTypes, AuthForType, BusinessType, LicenseType, AuthForScreen } from '../../../@types';
|
|
61
61
|
import API from '../../../api';
|
|
62
|
-
import { ADD_NEW_ENTITY, COLLECT_DOB_INFO_NAFATH, CONNECT_EXPRESS_STEP_NAMES, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_FL_LICENSE, SCOPE_AUTH } from '../../../constants';
|
|
62
|
+
import { ADD_NEW_ENTITY, COLLECT_DOB_INFO_NAFATH, CONNECT_EXPRESS_STEP_NAMES, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_FL_LICENSE, SCOPE_AUTH, SCOPE_MERCHANT } from '../../../constants';
|
|
63
63
|
import { defaultCountry } from '../../../constants';
|
|
64
64
|
import { getIndividualName, capitalizeTheFirstLetterOfEachWord, sleep, findCountryByIddPrefix, concatenateObjectValues, isSA, isKW, isOtherThanKWOrSA, sendCustomEventToGTM, sendCustomDimension, getMetaData, isNetworkError, isTimeoutError } from '../../../utils';
|
|
65
65
|
export var updateBusinessCountryAsync = createAsyncThunk('connectExpress/updateBusinessCountryAsync', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -888,10 +888,10 @@ export var checkBrandNameAvailabilityAsync = createAsyncThunk('connectExpress/ch
|
|
|
888
888
|
export var createAccountAsync = createAsyncThunk('connectExpress/createAccountAsync', function (_a, thunkApi) {
|
|
889
889
|
var isRetry = _a.isRetry;
|
|
890
890
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
891
|
-
var _b, connectExpress, settings, responseData, _c, postURL, scope, redirectUrl, mode, showBoard, notification, platforms, payment_provider, leadId, authId, bi, leadData, accountData, data, body, data, urlQueryStart;
|
|
892
|
-
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
893
|
-
return __generator(this, function (
|
|
894
|
-
switch (
|
|
891
|
+
var _b, connectExpress, settings, responseData, _c, postURL, scope, redirectUrl, mode, showBoard, notification, platforms, payment_provider, leadId, authId, bi, leadData, accountData, data, body, data, data, urlQueryStart;
|
|
892
|
+
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
893
|
+
return __generator(this, function (_y) {
|
|
894
|
+
switch (_y.label) {
|
|
895
895
|
case 0:
|
|
896
896
|
_b = thunkApi.getState(), connectExpress = _b.connectExpress, settings = _b.settings;
|
|
897
897
|
responseData = connectExpress.data.responseData;
|
|
@@ -905,12 +905,12 @@ export var createAccountAsync = createAsyncThunk('connectExpress/createAccountAs
|
|
|
905
905
|
if (!isRetry) return [3, 2];
|
|
906
906
|
return [4, thunkApi.dispatch(getLeadByIdAsync(leadId)).unwrap()];
|
|
907
907
|
case 1:
|
|
908
|
-
data = (
|
|
908
|
+
data = (_y.sent()).data;
|
|
909
909
|
if (data === null || data === void 0 ? void 0 : data.board_id) {
|
|
910
910
|
leadData = data;
|
|
911
911
|
accountData = data;
|
|
912
912
|
}
|
|
913
|
-
|
|
913
|
+
_y.label = 2;
|
|
914
914
|
case 2:
|
|
915
915
|
body = {
|
|
916
916
|
lead_id: leadId,
|
|
@@ -922,8 +922,8 @@ export var createAccountAsync = createAsyncThunk('connectExpress/createAccountAs
|
|
|
922
922
|
if (!!(leadData === null || leadData === void 0 ? void 0 : leadData.board_id)) return [3, 4];
|
|
923
923
|
return [4, API.accountService.expressCreateAccount(body)];
|
|
924
924
|
case 3:
|
|
925
|
-
accountData =
|
|
926
|
-
|
|
925
|
+
accountData = _y.sent();
|
|
926
|
+
_y.label = 4;
|
|
927
927
|
case 4:
|
|
928
928
|
sendCustomEventToGTM({
|
|
929
929
|
event: 'Send Event',
|
|
@@ -939,22 +939,41 @@ export var createAccountAsync = createAsyncThunk('connectExpress/createAccountAs
|
|
|
939
939
|
(_m = (_l = settings.data.appConfig).onCreated) === null || _m === void 0 ? void 0 : _m.call(_l, accountData);
|
|
940
940
|
(_p = (_o = settings.data.appConfig).onFlowCompleted) === null || _p === void 0 ? void 0 : _p.call(_o, accountData);
|
|
941
941
|
(_r = (_q = settings.data.appConfig).onStepCompleted) === null || _r === void 0 ? void 0 : _r.call(_q, settings.data.activeScreen.name, accountData);
|
|
942
|
-
if (
|
|
943
|
-
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
944
|
-
return [2, { accountData: accountData }];
|
|
945
|
-
}
|
|
946
|
-
if (!(scope === SCOPE_AUTH)) return [3, 8];
|
|
942
|
+
if (!(scope === SCOPE_MERCHANT)) return [3, 8];
|
|
947
943
|
if (!!(leadData === null || leadData === void 0 ? void 0 : leadData.board_id)) return [3, 6];
|
|
948
944
|
return [4, thunkApi.dispatch(getLeadByIdAsync(leadId)).unwrap()];
|
|
949
945
|
case 5:
|
|
950
|
-
data = (
|
|
946
|
+
data = (_y.sent()).data;
|
|
951
947
|
leadData = data;
|
|
952
|
-
|
|
953
|
-
case 6:
|
|
948
|
+
_y.label = 6;
|
|
949
|
+
case 6:
|
|
950
|
+
if (!postURL) return [3, 8];
|
|
951
|
+
return [4, thunkApi.dispatch(onCloseComplete({
|
|
952
|
+
merchantId: (_s = leadData === null || leadData === void 0 ? void 0 : leadData.merchant) === null || _s === void 0 ? void 0 : _s.id,
|
|
953
|
+
brandId: (_t = leadData === null || leadData === void 0 ? void 0 : leadData.brand) === null || _t === void 0 ? void 0 : _t.id,
|
|
954
|
+
entityId: (_u = leadData === null || leadData === void 0 ? void 0 : leadData.entity) === null || _u === void 0 ? void 0 : _u.id,
|
|
955
|
+
nextScreen: showBoard ? 'CONNECT_EXPRESS_PREPARING_DATA_STEP' : ''
|
|
956
|
+
}))];
|
|
954
957
|
case 7:
|
|
955
|
-
|
|
958
|
+
_y.sent();
|
|
956
959
|
return [2, { accountData: accountData }];
|
|
957
960
|
case 8:
|
|
961
|
+
if (showBoard) {
|
|
962
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
963
|
+
return [2, { accountData: accountData }];
|
|
964
|
+
}
|
|
965
|
+
if (!(scope === SCOPE_AUTH)) return [3, 12];
|
|
966
|
+
if (!!(leadData === null || leadData === void 0 ? void 0 : leadData.board_id)) return [3, 10];
|
|
967
|
+
return [4, thunkApi.dispatch(getLeadByIdAsync(leadId)).unwrap()];
|
|
968
|
+
case 9:
|
|
969
|
+
data = (_y.sent()).data;
|
|
970
|
+
leadData = data;
|
|
971
|
+
_y.label = 10;
|
|
972
|
+
case 10: return [4, thunkApi.dispatch(onCloseComplete({ merchantId: (_v = leadData === null || leadData === void 0 ? void 0 : leadData.merchant) === null || _v === void 0 ? void 0 : _v.id, brandId: (_w = leadData === null || leadData === void 0 ? void 0 : leadData.brand) === null || _w === void 0 ? void 0 : _w.id, entityId: (_x = leadData === null || leadData === void 0 ? void 0 : leadData.entity) === null || _x === void 0 ? void 0 : _x.id }))];
|
|
973
|
+
case 11:
|
|
974
|
+
_y.sent();
|
|
975
|
+
return [2, { accountData: accountData }];
|
|
976
|
+
case 12:
|
|
958
977
|
if (redirectUrl && mode === 'page') {
|
|
959
978
|
urlQueryStart = redirectUrl.includes('?') ? '&' : '?';
|
|
960
979
|
window.open("".concat(redirectUrl).concat(urlQueryStart, "authentication_id=").concat(authId, "&bi=").concat(bi), '_self');
|