@tap-payments/auth-jsconnect 2.8.75-development → 2.8.76-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.
|
@@ -417,7 +417,7 @@ export var verifyNafath = createAsyncThunk('auth/verifyNafath', function (params
|
|
|
417
417
|
return [4, API.authService.getVerifyAuth(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_token)];
|
|
418
418
|
case 2:
|
|
419
419
|
data = _e.sent();
|
|
420
|
-
isSuccess = ((_b = data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === '
|
|
420
|
+
isSuccess = ((_b = data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
421
421
|
if (isSuccess) {
|
|
422
422
|
if (scope === 'merchant') {
|
|
423
423
|
openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
|
|
@@ -329,7 +329,7 @@ export var verifyNafath = createAsyncThunk('business/verifyNafathParams', functi
|
|
|
329
329
|
return [4, API.authService.getTokenVerify(responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token)];
|
|
330
330
|
case 2:
|
|
331
331
|
data = _g.sent();
|
|
332
|
-
isSuccess = ((_c = data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === '
|
|
332
|
+
isSuccess = ((_c = data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'success';
|
|
333
333
|
if (!isSuccess) return [3, 5];
|
|
334
334
|
return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
|
|
335
335
|
case 3:
|
|
@@ -379,7 +379,7 @@ export var verifyNafath = createAsyncThunk('connect/verifyNafath', function (par
|
|
|
379
379
|
return [4, API.authService.getVerifyAuth(responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token)];
|
|
380
380
|
case 2:
|
|
381
381
|
authResponse = _g.sent();
|
|
382
|
-
isSuccess = ((_b = authResponse.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === '
|
|
382
|
+
isSuccess = ((_b = authResponse.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
383
383
|
if (!isSuccess) return [3, 13];
|
|
384
384
|
lead_id = authResponse.lead_id;
|
|
385
385
|
if (!lead_id)
|
|
@@ -341,9 +341,9 @@ export var createNafathAuth = createAsyncThunk('connectExpress/createNafathAuth'
|
|
|
341
341
|
}); });
|
|
342
342
|
export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
343
343
|
var _a, settings, connectExpress, authData, _b, scope, redirectUrl, authConfigData, isScopeAuthentication, bi, isDataHasIndividualOnly, authDataHasValue, expiry, interval, maxCalls, count, data, isSuccess, authId, urlQueryStart, _c, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount;
|
|
344
|
-
var _d, _e
|
|
345
|
-
return __generator(this, function (
|
|
346
|
-
switch (
|
|
344
|
+
var _d, _e;
|
|
345
|
+
return __generator(this, function (_f) {
|
|
346
|
+
switch (_f.label) {
|
|
347
347
|
case 0:
|
|
348
348
|
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
349
349
|
authData = (connectExpress.data.responseData || {}).authData;
|
|
@@ -356,7 +356,7 @@ export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsyn
|
|
|
356
356
|
interval = 3;
|
|
357
357
|
maxCalls = Math.floor(expiry / interval);
|
|
358
358
|
count = 1;
|
|
359
|
-
|
|
359
|
+
_f.label = 1;
|
|
360
360
|
case 1:
|
|
361
361
|
if (!(count <= maxCalls)) return [3, 9];
|
|
362
362
|
if (thunkApi.signal.aborted) {
|
|
@@ -364,10 +364,10 @@ export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsyn
|
|
|
364
364
|
}
|
|
365
365
|
return [4, API.authService.getVerifyAuth(authData === null || authData === void 0 ? void 0 : authData.auth_token)];
|
|
366
366
|
case 2:
|
|
367
|
-
data =
|
|
368
|
-
isSuccess = ((
|
|
367
|
+
data = _f.sent();
|
|
368
|
+
isSuccess = ((_d = data.status) === null || _d === void 0 ? void 0 : _d.toLowerCase()) === 'success';
|
|
369
369
|
if (!isSuccess) return [3, 6];
|
|
370
|
-
authId = data.
|
|
370
|
+
authId = data.id;
|
|
371
371
|
thunkApi.dispatch(storeAuthId(authId));
|
|
372
372
|
if (isScopeAuthentication && !data.new_user && isDataHasIndividualOnly && authId) {
|
|
373
373
|
if (settings.data.appConfig.mode === 'popup') {
|
|
@@ -384,19 +384,19 @@ export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsyn
|
|
|
384
384
|
if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 4];
|
|
385
385
|
return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
|
|
386
386
|
case 3:
|
|
387
|
-
_c =
|
|
387
|
+
_c = _f.sent(), brandList = _c.brandList, entityList = _c.entityList;
|
|
388
388
|
if (brandList.length && entityList.length) {
|
|
389
389
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP')); });
|
|
390
390
|
return [2, data];
|
|
391
391
|
}
|
|
392
|
-
|
|
393
|
-
case 4: return [4, thunkApi.dispatch(getLeadByIdAsync(data.
|
|
392
|
+
_f.label = 4;
|
|
393
|
+
case 4: return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead_id)).unwrap()];
|
|
394
394
|
case 5:
|
|
395
|
-
|
|
395
|
+
_f.sent();
|
|
396
396
|
stepName = data.step_name;
|
|
397
397
|
needToCollectMoreInfo = stepName === 'collect_info';
|
|
398
398
|
creatingAccount = stepName === 'create_account';
|
|
399
|
-
(
|
|
399
|
+
(_e = params.onSuccess) === null || _e === void 0 ? void 0 : _e.call(params);
|
|
400
400
|
if (creatingAccount) {
|
|
401
401
|
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP')); });
|
|
402
402
|
}
|
|
@@ -406,8 +406,8 @@ export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsyn
|
|
|
406
406
|
return [2, data];
|
|
407
407
|
case 6: return [4, sleep(interval * 1000)];
|
|
408
408
|
case 7:
|
|
409
|
-
|
|
410
|
-
|
|
409
|
+
_f.sent();
|
|
410
|
+
_f.label = 8;
|
|
411
411
|
case 8:
|
|
412
412
|
count++;
|
|
413
413
|
return [3, 1];
|
|
@@ -689,7 +689,7 @@ export var verifyNafathIdentityAsync = createAsyncThunk('connectExpress/verifyNa
|
|
|
689
689
|
return [4, API.authService.getExpressTokenVerify({ token: authData === null || authData === void 0 ? void 0 : authData.verify_token, leadId: authData === null || authData === void 0 ? void 0 : authData.lead_id })];
|
|
690
690
|
case 2:
|
|
691
691
|
data = _d.sent();
|
|
692
|
-
isSuccess = ((_b = (_a = data.auth) === null || _a === void 0 ? void 0 : _a.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === '
|
|
692
|
+
isSuccess = ((_b = (_a = data.auth) === null || _a === void 0 ? void 0 : _a.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
693
693
|
if (!isSuccess) return [3, 4];
|
|
694
694
|
return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead.id)).unwrap()];
|
|
695
695
|
case 3:
|