@tap-payments/auth-jsconnect 2.9.16-development → 2.9.17-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.
@@ -508,7 +508,7 @@ export var BUSINESS_SCREENS_NAVIGATION = [
508
508
  },
509
509
  {
510
510
  name: 'BUSINESS_DOB_STEP',
511
- next: 'BUSINESS_BUSINESS_TYPE_STEP',
511
+ next: ['BUSINESS_BUSINESS_TYPE_STEP', 'BUSINESS_MOBILE_OWNERSHIP'],
512
512
  prev: 'BUSINESS_IDBOD_STEP',
513
513
  order: 2
514
514
  },
@@ -353,7 +353,7 @@ export var verifyNafath = createAsyncThunk('business/verifyNafathParams', functi
353
353
  _h.sent();
354
354
  isNextScreenDob = data.step_name === COLLECT_DOB_INFO_NAFATH;
355
355
  isNextScreenCollectMobileOwnership = data.step_name === BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP;
356
- if (isSA(business.data.mobileData.countryCode.iso2) && isNextScreenCollectMobileOwnership) {
356
+ if (isNextScreenCollectMobileOwnership) {
357
357
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_MOBILE_OWNERSHIP'));
358
358
  }
359
359
  else {
@@ -577,7 +577,12 @@ export var updateLeadDOB = createAsyncThunk('business/updateLeadDOB', function (
577
577
  _g.sent();
578
578
  _g.label = 4;
579
579
  case 4:
580
- thunkApi.dispatch(handleNextScreenStep());
580
+ if (data.step_name === BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP) {
581
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_MOBILE_OWNERSHIP'));
582
+ }
583
+ else {
584
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
585
+ }
581
586
  (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, requestBody);
582
587
  return [2, { data: data, formData: params }];
583
588
  }
@@ -71,7 +71,7 @@ import { handleCurrentActiveScreen, handleNextScreenStep, handleSetCountryByIso2
71
71
  import { COLLECT_DOB_INFO_NAFATH, CONNECT_STEP_NAMES, defaultCountry, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, OTHER_BRAND } from '../../../constants';
72
72
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
73
73
  import { AuthForType, FlowsTypes } from '../../../@types';
74
- import { capitalizeTheFirstLetterOfEachWord, concatenateObjectValues, findCountryByIddPrefix, fixBrandList, isTwitter, getIndividualName, isWebsite, sleep, sendCustomEventToGTM, isOtherThanKWOrSA, isKW, findCountryByIso2, getMetaData, isSA, isNetworkError } from '../../../utils';
74
+ import { capitalizeTheFirstLetterOfEachWord, concatenateObjectValues, findCountryByIddPrefix, fixBrandList, isTwitter, getIndividualName, isWebsite, sleep, sendCustomEventToGTM, isOtherThanKWOrSA, isKW, findCountryByIso2, getMetaData, isNetworkError } from '../../../utils';
75
75
  export var updateBusinessCountry = createAsyncThunk('connect/updateBusinessCountry', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
76
76
  var connect, payload, data;
77
77
  return __generator(this, function (_a) {
@@ -509,7 +509,7 @@ export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', funct
509
509
  leadResponse = _g.sent();
510
510
  leadResponse.brand = __assign(__assign({}, leadResponse.brand), brandData);
511
511
  (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
512
- if (isSA(leadResponse.country_code) && leadResponse.step_name === CONNECT_STEP_NAMES.CONNECT_MOBILE_OWNERSHIP) {
512
+ if (leadResponse.step_name === CONNECT_STEP_NAMES.CONNECT_MOBILE_OWNERSHIP) {
513
513
  thunkApi.dispatch(handleNextScreenStep('CONNECT_MOBILE_OWNERSHIP'));
514
514
  }
515
515
  else {
@@ -685,18 +685,18 @@ export var createNIDNafathAuthIdentityAsync = createAsyncThunk('connectExpress/c
685
685
  });
686
686
  }); });
687
687
  export var verifyNafathIdentityAsync = createAsyncThunk('connectExpress/verifyNafathIdentityAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
688
- var _a, connectExpress, settings, authData, expiry, interval, maxCalls, count, data, isSuccess, isFailed, needToCollectMoreInfo, creatingAccount, askDobInfo, collectPhoneOwnershipScreen;
689
- var _b, _c, _d, _e, _f, _g, _h;
690
- return __generator(this, function (_j) {
691
- switch (_j.label) {
688
+ var connectExpress, authData, expiry, interval, maxCalls, count, data, isSuccess, isFailed, needToCollectMoreInfo, creatingAccount, askDobInfo, collectPhoneOwnershipScreen;
689
+ var _a, _b, _c, _d, _e, _f, _g;
690
+ return __generator(this, function (_h) {
691
+ switch (_h.label) {
692
692
  case 0:
693
- _a = thunkApi.getState(), connectExpress = _a.connectExpress, settings = _a.settings;
693
+ connectExpress = thunkApi.getState().connectExpress;
694
694
  authData = (connectExpress.data.responseData || {}).authData;
695
695
  expiry = (authData === null || authData === void 0 ? void 0 : authData.expiry) || 120;
696
696
  interval = 3;
697
697
  maxCalls = Math.floor(expiry / interval);
698
698
  count = 1;
699
- _j.label = 1;
699
+ _h.label = 1;
700
700
  case 1:
701
701
  if (!(count <= maxCalls)) return [3, 7];
702
702
  if (thunkApi.signal.aborted) {
@@ -704,23 +704,23 @@ export var verifyNafathIdentityAsync = createAsyncThunk('connectExpress/verifyNa
704
704
  }
705
705
  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 })];
706
706
  case 2:
707
- data = _j.sent();
708
- isSuccess = ((_c = (_b = data.auth) === null || _b === void 0 ? void 0 : _b.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'success';
709
- isFailed = ((_e = (_d = data.auth) === null || _d === void 0 ? void 0 : _d.status) === null || _e === void 0 ? void 0 : _e.toLowerCase()) === 'failed';
707
+ data = _h.sent();
708
+ isSuccess = ((_b = (_a = data.auth) === null || _a === void 0 ? void 0 : _a.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
709
+ isFailed = ((_d = (_c = data.auth) === null || _c === void 0 ? void 0 : _c.status) === null || _d === void 0 ? void 0 : _d.toLowerCase()) === 'failed';
710
710
  if (isFailed) {
711
- (_f = params.onFailure) === null || _f === void 0 ? void 0 : _f.call(params);
711
+ (_e = params.onFailure) === null || _e === void 0 ? void 0 : _e.call(params);
712
712
  return [2, { data: data }];
713
713
  }
714
714
  if (!isSuccess) return [3, 4];
715
- return [4, thunkApi.dispatch(getLeadByIdAsync((_g = data.auth) === null || _g === void 0 ? void 0 : _g.lead_id)).unwrap()];
715
+ return [4, thunkApi.dispatch(getLeadByIdAsync((_f = data.auth) === null || _f === void 0 ? void 0 : _f.lead_id)).unwrap()];
716
716
  case 3:
717
- _j.sent();
717
+ _h.sent();
718
718
  needToCollectMoreInfo = data.step_name === 'collect_info';
719
719
  creatingAccount = data.step_name === 'create_account';
720
720
  askDobInfo = data.step_name === COLLECT_DOB_INFO_NAFATH;
721
721
  collectPhoneOwnershipScreen = data.step_name === CONNECT_EXPRESS_STEP_NAMES.COLLECT_MOBILE_OWNERSHIP;
722
- (_h = params.onSuccess) === null || _h === void 0 ? void 0 : _h.call(params);
723
- if (isSA(settings.data.businessCountry.iso2) && collectPhoneOwnershipScreen) {
722
+ (_g = params.onSuccess) === null || _g === void 0 ? void 0 : _g.call(params);
723
+ if (collectPhoneOwnershipScreen) {
724
724
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('COLLECT_MOBILE_OWNERSHIP')); });
725
725
  }
726
726
  if (askDobInfo) {
@@ -735,8 +735,8 @@ export var verifyNafathIdentityAsync = createAsyncThunk('connectExpress/verifyNa
735
735
  return [2, { data: data, isNextScreenIsDob: askDobInfo }];
736
736
  case 4: return [4, sleep(interval * 1000)];
737
737
  case 5:
738
- _j.sent();
739
- _j.label = 6;
738
+ _h.sent();
739
+ _h.label = 6;
740
740
  case 6:
741
741
  count++;
742
742
  return [3, 1];
@@ -1034,7 +1034,7 @@ export var updateLeadIndividualAsync = createAsyncThunk('connectExpress/updateLe
1034
1034
  needToCollectMoreInfo = data.step_name === 'collect_info';
1035
1035
  creatingAccount = data.step_name === 'create_account';
1036
1036
  collectPhoneOwnershipScreen = data.step_name === CONNECT_EXPRESS_STEP_NAMES.COLLECT_MOBILE_OWNERSHIP;
1037
- if (isSA(settings.data.businessCountry.iso2) && collectPhoneOwnershipScreen) {
1037
+ if (collectPhoneOwnershipScreen) {
1038
1038
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('COLLECT_MOBILE_OWNERSHIP')); });
1039
1039
  }
1040
1040
  if (creatingAccount) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.9.16-development",
3
+ "version": "2.9.17-development",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",