@tap-payments/auth-jsconnect 2.8.51-development → 2.8.52-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/@types/app.d.ts +0 -1
- package/build/@types/form.d.ts +0 -1
- package/build/@types/redux.d.ts +0 -1
- package/build/api/axios.js +1 -2
- package/build/api/entity.d.ts +2 -2
- package/build/api/entity.js +4 -12
- package/build/api/index.d.ts +2 -2
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +2 -0
- package/build/constants/app.js +2 -0
- package/build/features/app/auth/authStore.js +23 -2
- package/build/features/app/bank/bankStore.d.ts +18 -13
- package/build/features/app/bank/bankStore.js +165 -184
- package/build/features/app/board/boardStore.js +30 -52
- package/build/features/app/brand/brandStore.d.ts +33 -16
- package/build/features/app/brand/brandStore.js +242 -239
- package/build/features/app/business/businessStore.d.ts +5 -0
- package/build/features/app/business/businessStore.js +87 -76
- package/build/features/app/connectExpress/connectExpressStore.d.ts +6 -15
- package/build/features/app/connectExpress/connectExpressStore.js +68 -107
- package/build/features/app/entity/entityStore.d.ts +36 -20
- package/build/features/app/entity/entityStore.js +246 -196
- package/build/features/app/individual/individualStore.d.ts +38 -22
- package/build/features/app/individual/individualStore.js +266 -263
- package/build/features/app/password/passwordStore.d.ts +23 -40
- package/build/features/app/password/passwordStore.js +233 -226
- package/build/features/app/tax/taxStore.d.ts +7 -13
- package/build/features/app/tax/taxStore.js +147 -168
- package/build/features/auth/Auth.js +5 -1
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +1 -13
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +26 -4
- package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +1 -7
- package/build/features/auth/screens/OTP/OTP.js +6 -1
- package/build/features/auth/screens/OTP/OTPInput.js +11 -0
- package/build/features/bank/Bank.d.ts +0 -1
- package/build/features/bank/Bank.js +4 -7
- package/build/features/bank/screens/BankDetails/BankDetails.js +5 -18
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/bank/screens/Verify/Verify.js +5 -5
- package/build/features/board/Board.js +4 -8
- package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -3
- package/build/features/brand/Brand.d.ts +0 -1
- package/build/features/brand/Brand.js +4 -7
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +35 -8
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +12 -49
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +3 -3
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -6
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +18 -5
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +7 -2
- package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +5 -23
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +7 -23
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/brand/screens/Verify/Verify.js +1 -1
- package/build/features/business/Business.js +4 -9
- package/build/features/business/screens/Activities/Activities.js +3 -12
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +2 -2
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +1 -1
- package/build/features/business/screens/BrandDetails/SalesChannel.d.ts +1 -1
- package/build/features/business/screens/BusinessType/BusinessType.js +2 -10
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +26 -4
- package/build/features/business/screens/CivilID/CivilID.js +1 -1
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +36 -9
- package/build/features/business/screens/Customers/Customers.js +3 -12
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -6
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +18 -5
- package/build/features/business/screens/IDBOD/IDBOD.js +2 -10
- package/build/features/business/screens/OTP/OTP.js +1 -1
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -14
- package/build/features/business/screens/Verify/Verify.js +3 -13
- package/build/features/connect/Connect.js +4 -5
- package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +2 -9
- package/build/features/connect/screens/CivilID/CivilID.js +7 -2
- package/build/features/connect/screens/Individual/Email.js +1 -3
- package/build/features/connect/screens/Individual/Individual.js +1 -1
- package/build/features/connect/screens/Merchant/BrandList.js +3 -3
- package/build/features/connect/screens/Merchant/Merchant.js +1 -1
- package/build/features/connect/screens/Merchant/SalesChannels.js +1 -1
- package/build/features/connect/screens/Mobile/Mobile.js +8 -11
- package/build/features/connect/screens/NID/NID.js +1 -1
- package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
- package/build/features/connectExpress/ConnectExpress.js +18 -5
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +2 -5
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +1 -6
- package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +0 -3
- package/build/features/connectExpress/screens/AuthenticationList/validation.js +0 -10
- package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +1 -7
- package/build/features/connectExpress/screens/CivilID/CivilID.js +7 -2
- package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +9 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +26 -4
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +7 -2
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +9 -2
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
- package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +24 -14
- package/build/features/connectExpress/screens/IdentityOTP/OTP.js +8 -7
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +7 -5
- package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -9
- package/build/features/connectExpress/screens/NID/NID.js +7 -2
- package/build/features/connectExpress/screens/NID/TAC.d.ts +7 -2
- package/build/features/connectExpress/screens/NIDMissed/NID.js +1 -1
- package/build/features/connectExpress/screens/OTP/OTP.js +6 -1
- package/build/features/connectExpress/screens/OTP/OTPInput.js +11 -1
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/Entity.d.ts +0 -1
- package/build/features/entity/Entity.js +4 -7
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +2 -2
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -8
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +4 -8
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +10 -34
- package/build/features/entity/screens/EntityName/EntityName.js +15 -32
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +35 -8
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +1 -1
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +1 -1
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/screens/Verify/Verify.js +1 -1
- package/build/features/featuresScreens.js +7 -67
- package/build/features/individual/Individual.d.ts +0 -1
- package/build/features/individual/Individual.js +4 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +14 -54
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -5
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +26 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -3
- package/build/features/individual/screens/IndividualList/Email.js +2 -3
- package/build/features/individual/screens/IndividualList/IndividualList.d.ts +2 -2
- package/build/features/individual/screens/IndividualList/IndividualList.js +5 -18
- package/build/features/individual/screens/IndividualList/UserList.js +9 -13
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +26 -4
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +1 -1
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +20 -76
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/individual/screens/Verify/Verify.js +1 -1
- package/build/features/password/Password.d.ts +0 -1
- package/build/features/password/Password.js +28 -75
- package/build/features/password/screens/CreatePassword/CreatePassword.js +4 -8
- package/build/features/password/screens/OTP/OTP.js +1 -1
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/password/screens/Verify/Verify.js +5 -5
- package/build/features/shared/Address/CountryList.d.ts +23 -7
- package/build/features/shared/Address/InputSelect.d.ts +23 -7
- package/build/features/shared/Button/FlowsButtons.js +3 -13
- package/build/features/shared/Containers/FeatureContainer.d.ts +0 -1
- package/build/features/shared/Containers/FeatureContainer.js +3 -3
- package/build/features/shared/Input/Input.d.ts +2 -2
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +1 -5
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +3 -3
- package/build/features/shared/UploadFile/FileUpload.d.ts +7 -2
- package/build/features/shared/UploadFile/UploadFile.d.ts +7 -2
- package/build/features/shared/UploadFile/UploadWrapper.d.ts +7 -2
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +7 -2
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +7 -2
- package/build/features/signIn/SignIn.js +3 -12
- package/build/features/tax/Tax.d.ts +0 -1
- package/build/features/tax/Tax.js +4 -7
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -7
- package/build/features/tax/screens/Verify/Verify.js +5 -5
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/useVerifyToken.d.ts +2 -5
- package/build/hooks/useVerifyToken.js +5 -10
- package/build/utils/common.js +4 -4
- package/build/utils/locale.js +1 -2
- package/build/utils/string.d.ts +2 -5
- package/build/utils/string.js +5 -34
- package/package.json +2 -2
- package/build/features/bank/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/bank/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/bank/screens/OperatorError/index.d.ts +0 -3
- package/build/features/bank/screens/OperatorError/index.js +0 -2
- package/build/features/board/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/board/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/board/screens/OperatorError/index.d.ts +0 -3
- package/build/features/board/screens/OperatorError/index.js +0 -2
- package/build/features/brand/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/brand/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/brand/screens/OperatorError/index.d.ts +0 -3
- package/build/features/brand/screens/OperatorError/index.js +0 -2
- package/build/features/business/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/business/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/business/screens/OperatorError/index.d.ts +0 -3
- package/build/features/business/screens/OperatorError/index.js +0 -2
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +0 -9
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +0 -90
- package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/connectExpress/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/connectExpress/screens/OperatorError/index.d.ts +0 -3
- package/build/features/connectExpress/screens/OperatorError/index.js +0 -2
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -5
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +0 -34
- package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +0 -2
- package/build/features/connectExpress/screens/PrepareDataLoading/index.js +0 -2
- package/build/features/entity/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/entity/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/entity/screens/OperatorError/index.d.ts +0 -3
- package/build/features/entity/screens/OperatorError/index.js +0 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +0 -14
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.js +0 -76
- package/build/features/individual/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/individual/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/individual/screens/OperatorError/index.d.ts +0 -3
- package/build/features/individual/screens/OperatorError/index.js +0 -2
- package/build/features/password/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/password/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/password/screens/OperatorError/index.d.ts +0 -3
- package/build/features/password/screens/OperatorError/index.js +0 -2
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -4
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +0 -10
- package/build/features/password/screens/PrepareDataLoading/index.d.ts +0 -2
- package/build/features/password/screens/PrepareDataLoading/index.js +0 -2
- package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/signIn/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/signIn/screens/OperatorError/index.d.ts +0 -3
- package/build/features/signIn/screens/OperatorError/index.js +0 -2
- package/build/features/tax/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/tax/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/tax/screens/OperatorError/index.d.ts +0 -3
- package/build/features/tax/screens/OperatorError/index.js +0 -2
- package/build/hooks/useFormDirtyCheck.d.ts +0 -10
- package/build/hooks/useFormDirtyCheck.js +0 -66
|
@@ -51,14 +51,14 @@ import API from '../../../api';
|
|
|
51
51
|
import { DocumentPurpose, FlowsTypes } from '../../../@types';
|
|
52
52
|
import { handleCurrentActiveScreen, handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
53
53
|
import { BANK_STEP_NAMES } from '../../../constants';
|
|
54
|
-
import { hasNoneEditableValue, isStringHasOneAsterisk, retrieveIndividualData,
|
|
54
|
+
import { hasNoneEditableValue, isStringHasOneAsterisk, retrieveIndividualData, sleep } from '../../../utils';
|
|
55
55
|
export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (_a, thunkApi) {
|
|
56
56
|
var token = _a.token, isInternally = _a.isInternally;
|
|
57
57
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
-
var payload, data,
|
|
59
|
-
var
|
|
60
|
-
return __generator(this, function (
|
|
61
|
-
switch (
|
|
58
|
+
var payload, data, boardData, boardInfoData, individualData, _b, board_id, board_info_id, config, country_code, publicKey, countryIso2, _c, id_1, type_1, serviceCallBack, _d, boardRes, individualRes;
|
|
59
|
+
var _e, _f, _g, _h, _j;
|
|
60
|
+
return __generator(this, function (_k) {
|
|
61
|
+
switch (_k.label) {
|
|
62
62
|
case 0:
|
|
63
63
|
payload = __assign({ service_name: 'tap_email', verify_token: token }, (isInternally && {
|
|
64
64
|
notification: {
|
|
@@ -67,51 +67,68 @@ export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (_
|
|
|
67
67
|
}));
|
|
68
68
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
69
69
|
case 1:
|
|
70
|
-
data = (
|
|
71
|
-
|
|
70
|
+
data = (_k.sent()).data;
|
|
71
|
+
individualData = undefined;
|
|
72
|
+
if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
|
|
72
73
|
throw new Error(data.errors[0].description);
|
|
73
|
-
|
|
74
|
-
_b = data || {}, config = _b.config, country_code = _b.country_code, step_name = _b.step_name, bank_account_id = _b.bank_account_id, wallet_id = _b.wallet_id, boardId = _b.id;
|
|
74
|
+
_b = data || {}, board_id = _b.id, board_info_id = _b.board_info_id, config = _b.config, country_code = _b.country_code;
|
|
75
75
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (publicKey)
|
|
76
|
+
countryIso2 = country_code;
|
|
77
|
+
if (publicKey) {
|
|
79
78
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return [3,
|
|
79
|
+
}
|
|
80
|
+
if (countryIso2)
|
|
81
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
82
|
+
if (!board_id) return [3, 6];
|
|
83
|
+
if (!board_info_id) return [3, 3];
|
|
84
|
+
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
85
85
|
case 2:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
case 3:
|
|
90
|
-
data_1 = _j.sent();
|
|
91
|
-
if (!country_code && ((_d = data_1 === null || data_1 === void 0 ? void 0 : data_1.entity) === null || _d === void 0 ? void 0 : _d.country))
|
|
92
|
-
thunkApi.dispatch(handleSetCountryByIso2(data_1.entity.country));
|
|
93
|
-
if (!((_h = (_g = (_f = (_e = data_1 === null || data_1 === void 0 ? void 0 : data_1.business) === null || _e === void 0 ? void 0 : _e.entity) === null || _f === void 0 ? void 0 : _f.merchant) === null || _g === void 0 ? void 0 : _g.wallet) === null || _h === void 0 ? void 0 : _h.id))
|
|
94
|
-
throw new Error('wallet_id_missing');
|
|
95
|
-
if (data_1 === null || data_1 === void 0 ? void 0 : data_1.bank_account)
|
|
96
|
-
bankData = data_1.bank_account;
|
|
97
|
-
return [3, 6];
|
|
86
|
+
boardInfoData = _k.sent();
|
|
87
|
+
_k.label = 3;
|
|
88
|
+
case 3: return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
98
89
|
case 4:
|
|
99
|
-
|
|
100
|
-
|
|
90
|
+
boardData = _k.sent();
|
|
91
|
+
_c = ((_f = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _f === void 0 ? void 0 : _f.recipient) || {}, id_1 = _c.id, type_1 = _c.type;
|
|
92
|
+
serviceCallBack = function () { return API.individualService.retrieveIndividual(id_1, type_1); };
|
|
93
|
+
return [4, retrieveIndividualData(type_1, boardData, serviceCallBack)];
|
|
101
94
|
case 5:
|
|
102
|
-
|
|
103
|
-
|
|
95
|
+
_d = _k.sent(), boardRes = _d.boardRes, individualRes = _d.individualRes;
|
|
96
|
+
boardData = boardRes;
|
|
97
|
+
individualData = individualRes;
|
|
98
|
+
_k.label = 6;
|
|
104
99
|
case 6:
|
|
100
|
+
if (!countryIso2 && ((_g = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _g === void 0 ? void 0 : _g.country)) {
|
|
101
|
+
countryIso2 = boardData.entity.country;
|
|
102
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
103
|
+
}
|
|
105
104
|
if (isInternally)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
thunkApi.dispatch(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
105
|
+
data.step_name = BANK_STEP_NAMES.BANK_INFO;
|
|
106
|
+
if (data.step_name === BANK_STEP_NAMES.PHONE_AUTH) {
|
|
107
|
+
thunkApi.dispatch(handleCurrentActiveScreen('BANK_VERIFY_STEP'));
|
|
108
|
+
}
|
|
109
|
+
else if (data.step_name === BANK_STEP_NAMES.BANK_INFO) {
|
|
110
|
+
if (isInternally)
|
|
111
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
112
|
+
else
|
|
113
|
+
thunkApi.dispatch(handleNextScreenStep());
|
|
114
|
+
}
|
|
115
|
+
return [2, {
|
|
116
|
+
data: data,
|
|
117
|
+
individualData: individualData,
|
|
118
|
+
boardResponse: {
|
|
119
|
+
user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
|
|
120
|
+
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
121
|
+
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
122
|
+
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
123
|
+
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
124
|
+
name: (_h = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _h === void 0 ? void 0 : _h.names,
|
|
125
|
+
contact: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.contact,
|
|
126
|
+
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
127
|
+
individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
|
|
128
|
+
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification
|
|
129
|
+
},
|
|
130
|
+
token: token
|
|
131
|
+
}];
|
|
115
132
|
}
|
|
116
133
|
});
|
|
117
134
|
});
|
|
@@ -134,118 +151,75 @@ export var resendOTP = createAsyncThunk('resendOTPBank', function (params, thunk
|
|
|
134
151
|
});
|
|
135
152
|
}); });
|
|
136
153
|
export var verifyBankLeadOTP = createAsyncThunk('verifyBankLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
137
|
-
var _a, bank, settings, responseBody, payload, data,
|
|
138
|
-
var _c, _d, _e
|
|
139
|
-
return __generator(this, function (
|
|
140
|
-
switch (
|
|
154
|
+
var _a, bank, settings, responseBody, payload, data, publicKey;
|
|
155
|
+
var _b, _c, _d, _e;
|
|
156
|
+
return __generator(this, function (_f) {
|
|
157
|
+
switch (_f.label) {
|
|
141
158
|
case 0:
|
|
142
159
|
_a = thunkApi.getState(), bank = _a.bank, settings = _a.settings;
|
|
143
160
|
responseBody = bank.data.verify.responseBody;
|
|
144
161
|
payload = {
|
|
145
162
|
data: params.otp,
|
|
146
|
-
service_name: (
|
|
163
|
+
service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
|
|
147
164
|
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
148
165
|
step_name: BANK_STEP_NAMES.PHONE_AUTH,
|
|
149
166
|
encryption_contract: ['data']
|
|
150
167
|
};
|
|
151
168
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
152
169
|
case 1:
|
|
153
|
-
data = (
|
|
154
|
-
if (
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
bankData = undefined;
|
|
164
|
-
if (!(!wallet_id || !countryIso2)) return [3, 3];
|
|
165
|
-
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
166
|
-
case 2:
|
|
167
|
-
data_2 = _o.sent();
|
|
168
|
-
if (!countryIso2 && ((_f = data_2 === null || data_2 === void 0 ? void 0 : data_2.entity) === null || _f === void 0 ? void 0 : _f.country))
|
|
169
|
-
thunkApi.dispatch(handleSetCountryByIso2(data_2.entity.country));
|
|
170
|
-
if (!((_k = (_j = (_h = (_g = data_2 === null || data_2 === void 0 ? void 0 : data_2.business) === null || _g === void 0 ? void 0 : _g.entity) === null || _h === void 0 ? void 0 : _h.merchant) === null || _j === void 0 ? void 0 : _j.wallet) === null || _k === void 0 ? void 0 : _k.id))
|
|
171
|
-
throw new Error('wallet_id_missing');
|
|
172
|
-
if (data_2 === null || data_2 === void 0 ? void 0 : data_2.bank_account)
|
|
173
|
-
bankData = data_2.bank_account;
|
|
174
|
-
return [3, 5];
|
|
175
|
-
case 3:
|
|
176
|
-
if (!bank_account_id) return [3, 5];
|
|
177
|
-
return [4, API.entityService.retrieveBankAccount(bank_account_id)];
|
|
178
|
-
case 4:
|
|
179
|
-
bankData = _o.sent();
|
|
180
|
-
_o.label = 5;
|
|
181
|
-
case 5:
|
|
182
|
-
(_m = (_l = settings.data.appConfig).onStepCompleted) === null || _m === void 0 ? void 0 : _m.call(_l, settings.data.activeScreen.name, { otp: params.otp });
|
|
183
|
-
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
184
|
-
return [2, {
|
|
185
|
-
data: data,
|
|
186
|
-
bankData: bankData,
|
|
187
|
-
formData: params
|
|
188
|
-
}];
|
|
170
|
+
data = (_f.sent()).data;
|
|
171
|
+
if (!data.errors) {
|
|
172
|
+
publicKey = (_c = data === null || data === void 0 ? void 0 : data.config) === null || _c === void 0 ? void 0 : _c.public_key;
|
|
173
|
+
if (publicKey) {
|
|
174
|
+
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
175
|
+
}
|
|
176
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, { otp: params.otp });
|
|
177
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
178
|
+
}
|
|
179
|
+
return [2, { data: data, formData: params }];
|
|
189
180
|
}
|
|
190
181
|
});
|
|
191
182
|
}); });
|
|
192
183
|
export var retrieveBoardStatus = createAsyncThunk('bank/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
193
|
-
var bank,
|
|
194
|
-
return __generator(this, function (
|
|
195
|
-
switch (
|
|
184
|
+
var bank, board_id, data;
|
|
185
|
+
return __generator(this, function (_a) {
|
|
186
|
+
switch (_a.label) {
|
|
196
187
|
case 0:
|
|
197
188
|
bank = thunkApi.getState().bank;
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
throw new Error('Internal server error');
|
|
201
|
-
_b = recipient || {}, id = _b.id, type = _b.type;
|
|
202
|
-
return [4, Promise.all([
|
|
203
|
-
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
204
|
-
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
205
|
-
])];
|
|
189
|
+
board_id = (bank.data.verify.responseBody || {}).id;
|
|
190
|
+
return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
206
191
|
case 1:
|
|
207
|
-
data =
|
|
192
|
+
data = _a.sent();
|
|
208
193
|
thunkApi.dispatch(handlePrevScreenStep());
|
|
209
194
|
return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
|
|
210
195
|
}
|
|
211
196
|
});
|
|
212
197
|
}); });
|
|
213
|
-
export var retrieveBoardDetails = createAsyncThunk('bank/retrieveBoardDetails', function (
|
|
214
|
-
var
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
if (!(((_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.id) !== id)) return [3, 3];
|
|
226
|
-
serviceCallBack = function () { return API.individualService.retrieveIndividual(id, type); };
|
|
227
|
-
return [4, retrieveIndividualData(type, data, serviceCallBack)];
|
|
228
|
-
case 2:
|
|
229
|
-
_b = _f.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
|
|
230
|
-
individualData = individualRes;
|
|
231
|
-
boardData = boardRes;
|
|
232
|
-
_f.label = 3;
|
|
233
|
-
case 3: return [2, __assign(__assign({}, boardData), { brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, name: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.names, business: boardData === null || boardData === void 0 ? void 0 : boardData.business, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, contact: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.contact, user: individualData })];
|
|
234
|
-
}
|
|
235
|
-
});
|
|
198
|
+
export var retrieveBoardDetails = createAsyncThunk('bank/retrieveBoardDetails', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
199
|
+
var data;
|
|
200
|
+
var _a, _b;
|
|
201
|
+
return __generator(this, function (_c) {
|
|
202
|
+
switch (_c.label) {
|
|
203
|
+
case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
204
|
+
case 1:
|
|
205
|
+
data = _c.sent();
|
|
206
|
+
return [2, {
|
|
207
|
+
data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.names, business: data === null || data === void 0 ? void 0 : data.business, individuals: data === null || data === void 0 ? void 0 : data.individuals, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact })
|
|
208
|
+
}];
|
|
209
|
+
}
|
|
236
210
|
});
|
|
237
|
-
});
|
|
211
|
+
}); });
|
|
238
212
|
export var createBankAccount = createAsyncThunk('createBankAccount', function (_a, thunkApi) {
|
|
239
|
-
var formData = _a.formData, originalFormData = _a.originalFormData
|
|
213
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
240
214
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
241
|
-
var _b, settings, bank, iban, beneficiaryName, bankName, bankStatementId, confirmPolicy, _c, bank_account,
|
|
242
|
-
var _e, _f;
|
|
243
|
-
return __generator(this, function (
|
|
244
|
-
switch (
|
|
215
|
+
var _b, settings, bank, iban, beneficiaryName, bankName, bankStatementId, confirmPolicy, _c, bank_account, notification, _d, data_status, document, isIBANMasked, isIBANNonEditable, isBeneficiaryNameNonEditable, isBankNameNonEditable, isBankStatementIdNonEditable, isConfirmPolicyNonEditable, documentResponse, hasDocument, documentId, requestBody, data, documentBody;
|
|
216
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
217
|
+
return __generator(this, function (_p) {
|
|
218
|
+
switch (_p.label) {
|
|
245
219
|
case 0:
|
|
246
220
|
_b = thunkApi.getState(), settings = _b.settings, bank = _b.bank;
|
|
247
221
|
iban = formData.iban, beneficiaryName = formData.beneficiaryName, bankName = formData.bankName, bankStatementId = formData.bankStatementId, confirmPolicy = formData.confirmPolicy;
|
|
248
|
-
_c = bank.data.verify.responseBody || {}, bank_account = _c.bank_account,
|
|
222
|
+
_c = bank.data.verify.responseBody || {}, bank_account = _c.bank_account, notification = _c.notification;
|
|
249
223
|
_d = bank_account || {}, data_status = _d.data_status, document = _d.document;
|
|
250
224
|
isIBANMasked = isStringHasOneAsterisk(iban);
|
|
251
225
|
isIBANNonEditable = hasNoneEditableValue(data_status, 'iban');
|
|
@@ -254,16 +228,14 @@ export var createBankAccount = createAsyncThunk('createBankAccount', function (_
|
|
|
254
228
|
isBankStatementIdNonEditable = hasNoneEditableValue(data_status, 'bank_statement_file_id');
|
|
255
229
|
isConfirmPolicyNonEditable = hasNoneEditableValue(data_status, 'is_acknowledged');
|
|
256
230
|
documentResponse = undefined;
|
|
257
|
-
|
|
258
|
-
hasDocument = !isBankStatementIdNonEditable && (bankStatementId || []).length > 0;
|
|
231
|
+
hasDocument = (bankStatementId || []).length > 0;
|
|
259
232
|
documentId = document === null || document === void 0 ? void 0 : document.id;
|
|
260
233
|
requestBody = {
|
|
261
|
-
wallet_id:
|
|
234
|
+
wallet_id: (_j = (_h = (_g = (_f = (_e = bank.data.verify.responseBody) === null || _e === void 0 ? void 0 : _e.business) === null || _f === void 0 ? void 0 : _f.entity) === null || _g === void 0 ? void 0 : _g.merchant) === null || _h === void 0 ? void 0 : _h.wallet) === null || _j === void 0 ? void 0 : _j.id,
|
|
262
235
|
bank_account: __assign(__assign({ iban: isIBANNonEditable || isIBANMasked ? undefined : iban, beneficiary_name: isBeneficiaryNameNonEditable ? undefined : beneficiaryName, bank_name: isBankNameNonEditable ? undefined : bankName }, (!isConfirmPolicyNonEditable && {
|
|
263
|
-
acknowledged_by:
|
|
236
|
+
acknowledged_by: (_k = notification === null || notification === void 0 ? void 0 : notification.recipient) === null || _k === void 0 ? void 0 : _k.id,
|
|
264
237
|
is_acknowledged: confirmPolicy
|
|
265
|
-
})), (!documentId &&
|
|
266
|
-
hasDocument && {
|
|
238
|
+
})), (!(isBankStatementIdNonEditable || documentId || !hasDocument) && {
|
|
267
239
|
document: {
|
|
268
240
|
type: DocumentPurpose.BANK_STATEMENT,
|
|
269
241
|
files: bankStatementId || []
|
|
@@ -272,25 +244,24 @@ export var createBankAccount = createAsyncThunk('createBankAccount', function (_
|
|
|
272
244
|
step_name: BANK_STEP_NAMES.BANK_INFO,
|
|
273
245
|
encryption_contract: ['bank_account.iban', 'bank_account.beneficiary_name', 'bank_account.bank_name']
|
|
274
246
|
};
|
|
275
|
-
if (!(isDirty || (!documentId && hasDocument))) return [3, 2];
|
|
276
247
|
return [4, API.entityService.createBankAccount(requestBody)];
|
|
277
248
|
case 1:
|
|
278
|
-
data =
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
if (!(documentId && hasDocument)) return [3,
|
|
249
|
+
data = (_p.sent()).data;
|
|
250
|
+
if ((_l = data.errors) === null || _l === void 0 ? void 0 : _l.length)
|
|
251
|
+
throw new Error(data.errors[0].description);
|
|
252
|
+
if (!(!isBankStatementIdNonEditable && documentId && hasDocument)) return [3, 3];
|
|
282
253
|
documentBody = {
|
|
283
254
|
id: documentId,
|
|
284
255
|
files: bankStatementId || []
|
|
285
256
|
};
|
|
286
257
|
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
258
|
+
case 2:
|
|
259
|
+
documentResponse = _p.sent();
|
|
260
|
+
_p.label = 3;
|
|
287
261
|
case 3:
|
|
288
|
-
|
|
289
|
-
_g.label = 4;
|
|
290
|
-
case 4:
|
|
291
|
-
data = __assign(__assign({}, data), { documentResponse: documentResponse });
|
|
262
|
+
data.documentData = documentResponse;
|
|
292
263
|
thunkApi.dispatch(handleNextScreenStep());
|
|
293
|
-
(
|
|
264
|
+
(_o = (_m = settings.data.appConfig).onStepCompleted) === null || _o === void 0 ? void 0 : _o.call(_m, settings.data.activeScreen.name, requestBody);
|
|
294
265
|
return [2, { data: data, formData: originalFormData }];
|
|
295
266
|
}
|
|
296
267
|
});
|
|
@@ -317,45 +288,40 @@ export var checkIbanBank = createAsyncThunk('checkIbanBank', function (_a) {
|
|
|
317
288
|
});
|
|
318
289
|
});
|
|
319
290
|
export var updateBoardSuccess = createAsyncThunk('updateBoardBankSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
320
|
-
var _a, settings, bank, _b,
|
|
321
|
-
var _e, _f, _g, _h, _j, _k, _l
|
|
322
|
-
return __generator(this, function (
|
|
323
|
-
switch (
|
|
291
|
+
var _a, settings, bank, verify, _b, id, infoId, _c, showBoard, mode, payload, data, boardInfoData;
|
|
292
|
+
var _d, _e, _f, _g, _h, _j, _k, _l;
|
|
293
|
+
return __generator(this, function (_m) {
|
|
294
|
+
switch (_m.label) {
|
|
324
295
|
case 0:
|
|
325
296
|
_a = thunkApi.getState(), settings = _a.settings, bank = _a.bank;
|
|
326
|
-
|
|
297
|
+
verify = bank.data.verify;
|
|
298
|
+
_b = verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id;
|
|
327
299
|
_c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
|
|
328
|
-
if (!
|
|
300
|
+
if (!id)
|
|
329
301
|
return [2];
|
|
330
302
|
payload = {
|
|
331
303
|
lang: settings.data.language,
|
|
332
|
-
step_name: BANK_STEP_NAMES.BANK_SUCCESS
|
|
304
|
+
step_name: BANK_STEP_NAMES.BANK_SUCCESS,
|
|
305
|
+
id: id
|
|
333
306
|
};
|
|
334
|
-
return [4, API.boardService.updateBoardInfo(__assign({ id:
|
|
307
|
+
return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
|
|
335
308
|
case 1:
|
|
336
|
-
data =
|
|
337
|
-
sendCustomEventToGTM({
|
|
338
|
-
event: 'Send Event',
|
|
339
|
-
event_category: 'Board Flows - Wallet',
|
|
340
|
-
event_action: 'Wallet Update Success Page',
|
|
341
|
-
event_label: settings.data.businessCountry.iso2
|
|
342
|
-
});
|
|
309
|
+
data = _m.sent();
|
|
343
310
|
if (!showBoard && mode === 'content') {
|
|
344
|
-
(
|
|
345
|
-
(
|
|
346
|
-
return [2, {
|
|
311
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
|
|
312
|
+
(_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: data });
|
|
313
|
+
return [2, { response: __assign({}, data), formData: params }];
|
|
347
314
|
}
|
|
348
|
-
|
|
349
|
-
return [4, Promise.all([
|
|
350
|
-
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
351
|
-
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
352
|
-
])];
|
|
315
|
+
return [4, API.boardService.retrieveBoardInfoStatus(id)];
|
|
353
316
|
case 2:
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
317
|
+
boardInfoData = _m.sent();
|
|
318
|
+
return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
|
|
319
|
+
case 3:
|
|
320
|
+
_m.sent();
|
|
321
|
+
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, {});
|
|
322
|
+
(_l = (_k = settings.data.appConfig).onFlowCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, { data: data });
|
|
357
323
|
thunkApi.dispatch(handleNextScreenStep());
|
|
358
|
-
return [2, {
|
|
324
|
+
return [2, { response: __assign(__assign({}, data), { flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [] }), formData: params }];
|
|
359
325
|
}
|
|
360
326
|
});
|
|
361
327
|
}); });
|
|
@@ -418,17 +384,23 @@ export var bankSlice = createSlice({
|
|
|
418
384
|
state.customLoading = true;
|
|
419
385
|
})
|
|
420
386
|
.addCase(verifyLeadToken.fulfilled, function (state, action) {
|
|
387
|
+
var _a;
|
|
421
388
|
state.error = null;
|
|
422
389
|
state.customLoading = false;
|
|
423
|
-
var
|
|
424
|
-
var
|
|
390
|
+
var _b = action.payload, data = _b.data, token = _b.token, boardResponse = _b.boardResponse, individualData = _b.individualData;
|
|
391
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
392
|
+
if (description) {
|
|
393
|
+
state.error = description;
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), boardResponse), state.data.verify.responseBody), { board_id: data.id, individualData: individualData });
|
|
397
|
+
state.data.verify.token = token;
|
|
398
|
+
var _c = (boardResponse === null || boardResponse === void 0 ? void 0 : boardResponse.bank_account) || {}, bank_name = _c.bank_name, beneficiary_name = _c.beneficiary_name, iban = _c.iban, is_acknowledged = _c.is_acknowledged;
|
|
425
399
|
state.data.bankData.bankName = bank_name || '';
|
|
426
400
|
state.data.bankData.beneficiaryName = beneficiary_name || '';
|
|
427
401
|
state.data.bankData.iban = iban || '';
|
|
428
402
|
if (is_acknowledged)
|
|
429
403
|
state.data.bankData.confirmPolicy = is_acknowledged;
|
|
430
|
-
state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { bank_account: bank_account, board_id: data.id });
|
|
431
|
-
state.data.verify.token = token;
|
|
432
404
|
})
|
|
433
405
|
.addCase(verifyLeadToken.rejected, function (state, action) {
|
|
434
406
|
state.error = action.error.message;
|
|
@@ -456,18 +428,17 @@ export var bankSlice = createSlice({
|
|
|
456
428
|
state.error = null;
|
|
457
429
|
})
|
|
458
430
|
.addCase(verifyBankLeadOTP.fulfilled, function (state, action) {
|
|
431
|
+
var _a;
|
|
459
432
|
state.loading = false;
|
|
460
433
|
state.error = null;
|
|
461
|
-
var
|
|
434
|
+
var _b = action.payload, data = _b.data, formData = _b.formData;
|
|
435
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
436
|
+
if (description) {
|
|
437
|
+
state.error = description;
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
462
440
|
state.data.otpData = formData;
|
|
463
441
|
state.data.otpData.responseBody = data;
|
|
464
|
-
var _b = bank_account || {}, bank_name = _b.bank_name, beneficiary_name = _b.beneficiary_name, iban = _b.iban, is_acknowledged = _b.is_acknowledged;
|
|
465
|
-
state.data.bankData.bankName = bank_name || '';
|
|
466
|
-
state.data.bankData.beneficiaryName = beneficiary_name || '';
|
|
467
|
-
state.data.bankData.iban = iban || '';
|
|
468
|
-
if (is_acknowledged)
|
|
469
|
-
state.data.bankData.confirmPolicy = is_acknowledged;
|
|
470
|
-
state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { bank_account: bank_account, board_id: data.id });
|
|
471
442
|
})
|
|
472
443
|
.addCase(verifyBankLeadOTP.rejected, function (state, action) {
|
|
473
444
|
state.loading = false;
|
|
@@ -480,7 +451,7 @@ export var bankSlice = createSlice({
|
|
|
480
451
|
.addCase(retrieveBoardDetails.fulfilled, function (state, action) {
|
|
481
452
|
state.error = null;
|
|
482
453
|
state.loading = false;
|
|
483
|
-
var data = action.payload || {};
|
|
454
|
+
var data = (action.payload || {}).data;
|
|
484
455
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
485
456
|
})
|
|
486
457
|
.addCase(retrieveBoardDetails.rejected, function (state, action) {
|
|
@@ -505,8 +476,18 @@ export var bankSlice = createSlice({
|
|
|
505
476
|
var _a;
|
|
506
477
|
state.loading = false;
|
|
507
478
|
state.error = null;
|
|
508
|
-
var
|
|
509
|
-
|
|
479
|
+
var response = (action.payload || {}).response;
|
|
480
|
+
var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
481
|
+
if (description) {
|
|
482
|
+
state.error = description;
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
var flows = response.flows;
|
|
486
|
+
var _b = state.data.verify.responseBody || {}, individuals = _b.individuals, individualData = _b.individualData;
|
|
487
|
+
var data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? individuals : individualData) || {}).data_state;
|
|
488
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
|
|
489
|
+
individuals: __assign(__assign({}, individuals), { data_state: data_state })
|
|
490
|
+
}));
|
|
510
491
|
})
|
|
511
492
|
.addCase(updateBoardSuccess.pending, function (state) {
|
|
512
493
|
state.loading = true;
|
|
@@ -524,7 +505,7 @@ export var bankSlice = createSlice({
|
|
|
524
505
|
state.loading = false;
|
|
525
506
|
state.error = null;
|
|
526
507
|
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
527
|
-
state.data.bankData =
|
|
508
|
+
state.data.bankData = formData;
|
|
528
509
|
state.data.bankData.responseBody = data;
|
|
529
510
|
})
|
|
530
511
|
.addCase(createBankAccount.rejected, function (state, action) {
|