@tap-payments/auth-jsconnect 2.12.6-development → 2.12.6
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/README.md +60 -10
- package/build/assets/locales/en.json +1 -0
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +3 -1
- package/build/constants/app.d.ts +2 -0
- package/build/constants/app.js +2 -0
- package/build/features/app/bank/bankStore.js +6 -4
- package/build/features/app/brand/brandStore.js +6 -4
- package/build/features/app/entity/entityStore.js +6 -4
- package/build/features/app/individual/individualStore.js +3 -2
- package/build/features/app/tax/taxStore.js +6 -4
- package/build/features/kyc/screens/Terms/Terms.js +6 -5
- package/build/utils/common.js +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -20,12 +20,17 @@ yarn add @tap-payments/auth-jsconnect
|
|
|
20
20
|
|
|
21
21
|
## Features
|
|
22
22
|
|
|
23
|
-
- [Connect](#Connect)
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
26
|
-
- [Individual](#Individual)
|
|
27
|
-
- [
|
|
28
|
-
- [
|
|
23
|
+
- [Connect](#Connect) - Create a new account with Tap Payments
|
|
24
|
+
- [ConnectExpress](#ConnectExpress) - Simplified connect flow
|
|
25
|
+
- [Business](#Business) - Business entity onboarding and verification
|
|
26
|
+
- [Individual](#Individual) - Individual entity onboarding and verification
|
|
27
|
+
- [Entity](#Entity) - Entity management and verification
|
|
28
|
+
- [Password](#Password) - Password management and recovery
|
|
29
|
+
- [Bank](#Bank) - Bank account management
|
|
30
|
+
- [Tax](#Tax) - Tax information management
|
|
31
|
+
- [Terminal](#Terminal) - Terminal kit for point-of-sale operations
|
|
32
|
+
- [Auth](#Auth) - Authentication module
|
|
33
|
+
- [KYC](#KYC) - Know Your Customer verification
|
|
29
34
|
|
|
30
35
|
## Examples
|
|
31
36
|
|
|
@@ -135,17 +140,48 @@ const App = () => {
|
|
|
135
140
|
```
|
|
136
141
|
|
|
137
142
|
## Connect
|
|
138
|
-
- Help
|
|
143
|
+
- Help merchants create an account with Tap Payments
|
|
139
144
|
|
|
140
|
-
##
|
|
145
|
+
## ConnectExpress
|
|
146
|
+
- Streamlined onboarding flow with simplified user experience
|
|
141
147
|
|
|
142
|
-
##
|
|
148
|
+
## Business
|
|
149
|
+
- Business entity registration and verification
|
|
150
|
+
- License number validation
|
|
151
|
+
- Support for creating new sessions after expiry
|
|
143
152
|
|
|
144
153
|
## Individual
|
|
154
|
+
- Individual entity registration and verification
|
|
155
|
+
- Arabic name validation (English names only accepted)
|
|
156
|
+
- Support for creating new sessions after expiry
|
|
157
|
+
|
|
158
|
+
## Entity
|
|
159
|
+
- Entity information management
|
|
160
|
+
- Frontend-editable fields even when non-editable from backend
|
|
161
|
+
- Entity verification workflows
|
|
162
|
+
|
|
163
|
+
## Password
|
|
164
|
+
- Password management and recovery
|
|
165
|
+
- Session expiry handling with new session creation support
|
|
145
166
|
|
|
146
167
|
## Bank
|
|
168
|
+
- Bank account information management and verification
|
|
147
169
|
|
|
148
170
|
## Tax
|
|
171
|
+
- Tax identification and information management
|
|
172
|
+
- Support for creating new sessions after expiry
|
|
173
|
+
- UNN Collection logic improvements
|
|
174
|
+
|
|
175
|
+
## Terminal
|
|
176
|
+
- Point-of-sale terminal operations
|
|
177
|
+
- Session expiry management with new session creation support
|
|
178
|
+
- Hotfix for improved session handling
|
|
179
|
+
|
|
180
|
+
## Auth
|
|
181
|
+
- Core authentication module for the library
|
|
182
|
+
|
|
183
|
+
## KYC
|
|
184
|
+
- Know Your Customer verification processes
|
|
149
185
|
|
|
150
186
|
```
|
|
151
187
|
|
|
@@ -164,4 +200,18 @@ const App = () => {
|
|
|
164
200
|
| onFlowCompleted `required` - `function` | callback function will called after completing the flow |
|
|
165
201
|
| onReady `required` - `function` | callback function will call after loading library configuration |
|
|
166
202
|
| onStepError `required` - `function` | callback function will call in case if any error happened in the screen |
|
|
167
|
-
|
|
|
203
|
+
| onStepCompleted `optional` - `function` | callback function will call after completing each step |
|
|
204
|
+
| onStepStarted `required` - `function` | callback function will call in the beginning of each step |
|
|
205
|
+
|
|
206
|
+
## Branch Information
|
|
207
|
+
|
|
208
|
+
This repository maintains multiple branches for different environments and stages:
|
|
209
|
+
|
|
210
|
+
| Branch | Purpose | Environment |
|
|
211
|
+
| ------------- | ------------------------------ | ----------- |
|
|
212
|
+
| `main` | Production releases | Production |
|
|
213
|
+
| `beta` | Beta features and testing | Beta |
|
|
214
|
+
| `sandbox` | Sandbox environment testing | Sandbox |
|
|
215
|
+
| `development` | Development features and fixes | Development |
|
|
216
|
+
|
|
217
|
+
**Workflow**: `development` → `sandbox` → `beta` → `main` (production)
|
|
@@ -393,6 +393,7 @@
|
|
|
393
393
|
"kyc_token_invalid": "May you please verify link of which you are trying to open.",
|
|
394
394
|
"kyc_users_description": "Please select an authorized registered ID to approve with {{provider}}",
|
|
395
395
|
"kyc_verification": "Know Your Customer (KYC)",
|
|
396
|
+
"kyc_privacy_policy": "Privacy Policy",
|
|
396
397
|
"language": "العربية",
|
|
397
398
|
"license_info": "License information",
|
|
398
399
|
"license_name_hint": "Enter legal name",
|
|
@@ -33,7 +33,7 @@ var StyledTooltip = styled(function (_a) {
|
|
|
33
33
|
var _b;
|
|
34
34
|
var theme = _a.theme;
|
|
35
35
|
return (_b = {},
|
|
36
|
-
_b["& .".concat(tooltipClasses.tooltip)] = __assign(__assign({ color: alpha(theme.palette.text.primary, 0.5), width: 'fit-content', maxHeight: 'fit-content' }, theme.typography.body2), { fontWeight: theme.typography.fontWeightLight, backgroundColor: theme.palette.secondary.light, border: "1px solid ".concat(alpha(theme.palette.divider, 0.8)) }),
|
|
36
|
+
_b["& .".concat(tooltipClasses.tooltip)] = __assign(__assign({ color: alpha(theme.palette.text.primary, 0.5), width: 'fit-content', maxHeight: 'fit-content' }, theme.typography.body2), { fontWeight: theme.typography.fontWeightLight, backgroundColor: theme.palette.secondary.light, border: "1px solid ".concat(alpha(theme.palette.divider, 0.8)), zIndex: 2147483647 }),
|
|
37
37
|
_b);
|
|
38
38
|
});
|
|
39
39
|
var TextStyled = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
|
package/build/constants/api.d.ts
CHANGED
package/build/constants/api.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
var SANDBOX_BASE_URL = 'https://connect-mw.sandbox.tap.company/middleware';
|
|
2
2
|
var PRODUCTION_BASE_URL = 'https://connect-mw.tap.company/middleware';
|
|
3
3
|
var PRODUCTION_BASE_URL_SA = 'https://connect-mw.tap.com.sa/middleware';
|
|
4
|
-
var PRODUCTION_BASE_URL_SA_DR = 'https://connect-mw.tap.com.sa/middleware';
|
|
4
|
+
var PRODUCTION_BASE_URL_SA_DR = 'https://connect-mw-tmp.tap.com.sa/middleware';
|
|
5
5
|
var DEV_BASE_URL = 'https://connect-mw.dev.tap.company/middleware';
|
|
6
|
+
var BETA_BASE_URL = 'https://connect-mw.beta.tap.company/middleware';
|
|
6
7
|
var API_BUSINESS_COUNTRIES = 'https://godata.sandbox.tap.company/api/v1/business/country/list';
|
|
7
8
|
var API_COUNTRIES = 'https://utilities.tap.company/api/v1/country/list';
|
|
8
9
|
var CURRENCY_PATH = 'https://utilities.tap.company/api/v1/currency/iso';
|
|
@@ -73,6 +74,7 @@ export var ENDPOINT_PATHS = {
|
|
|
73
74
|
PRODUCTION_BASE_URL_SA: PRODUCTION_BASE_URL_SA,
|
|
74
75
|
PRODUCTION_BASE_URL_SA_DR: PRODUCTION_BASE_URL_SA_DR,
|
|
75
76
|
DEV_BASE_URL: DEV_BASE_URL,
|
|
77
|
+
BETA_BASE_URL: BETA_BASE_URL,
|
|
76
78
|
BUSINESS_COUNTRIES: API_BUSINESS_COUNTRIES,
|
|
77
79
|
COUNTRIES: API_COUNTRIES,
|
|
78
80
|
IP: IP_PATH,
|
package/build/constants/app.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ScreenStepNavigation, BusinessType, POSInfo, TerminalInfo } from '../@types';
|
|
2
2
|
export declare const CONNECT_DEV_URL = "https://connect.dev.tap.company";
|
|
3
|
+
export declare const CONNECT_SANDBOX_URL = "https://connect.sandbox.tap.company";
|
|
4
|
+
export declare const CONNECT_BETA_URL = "https://connect.beta.tap.company";
|
|
3
5
|
export declare const CONNECT_PROD_URL = "https://connect.tap.company";
|
|
4
6
|
export declare const CLIENT_ORIGIN: string;
|
|
5
7
|
export declare const TAP_WEBSITE = "https://www.tap.company/";
|
package/build/constants/app.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BusinessType } from '../@types';
|
|
2
2
|
import { CONNECT_FLOWS } from './flows';
|
|
3
3
|
export var CONNECT_DEV_URL = 'https://connect.dev.tap.company';
|
|
4
|
+
export var CONNECT_SANDBOX_URL = 'https://connect.sandbox.tap.company';
|
|
5
|
+
export var CONNECT_BETA_URL = 'https://connect.beta.tap.company';
|
|
4
6
|
export var CONNECT_PROD_URL = 'https://connect.tap.company';
|
|
5
7
|
export var CLIENT_ORIGIN = window.location.origin;
|
|
6
8
|
export var TAP_WEBSITE = 'https://www.tap.company/';
|
|
@@ -266,14 +266,16 @@ export var retrieveBoardStatus = createAsyncThunk('bank/retrieveBoardStatus', fu
|
|
|
266
266
|
}
|
|
267
267
|
});
|
|
268
268
|
}); });
|
|
269
|
-
export var retrieveBoardDetails = createAsyncThunk('bank/retrieveBoardDetails', function (_a) {
|
|
269
|
+
export var retrieveBoardDetails = createAsyncThunk('bank/retrieveBoardDetails', function (_a, thunkApi) {
|
|
270
270
|
var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
|
|
271
271
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
272
|
-
var data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
|
|
272
|
+
var responseBody, data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
|
|
273
273
|
var _c, _d, _e;
|
|
274
274
|
return __generator(this, function (_f) {
|
|
275
275
|
switch (_f.label) {
|
|
276
|
-
case 0:
|
|
276
|
+
case 0:
|
|
277
|
+
responseBody = thunkApi.getState().bank.data.verify.responseBody;
|
|
278
|
+
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
277
279
|
case 1:
|
|
278
280
|
data = _f.sent();
|
|
279
281
|
individualData = data === null || data === void 0 ? void 0 : data.user;
|
|
@@ -286,7 +288,7 @@ export var retrieveBoardDetails = createAsyncThunk('bank/retrieveBoardDetails',
|
|
|
286
288
|
individualData = individualRes;
|
|
287
289
|
boardData = boardRes;
|
|
288
290
|
_f.label = 3;
|
|
289
|
-
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, board_status: boardData === null || boardData === void 0 ? void 0 : boardData.status })];
|
|
291
|
+
case 3: return [2, __assign(__assign({}, boardData), { brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, bank_account: __assign(__assign({}, responseBody === null || responseBody === void 0 ? void 0 : responseBody.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, board_status: boardData === null || boardData === void 0 ? void 0 : boardData.status })];
|
|
290
292
|
}
|
|
291
293
|
});
|
|
292
294
|
});
|
|
@@ -296,14 +296,16 @@ export var retrieveBoardStatus = createAsyncThunk('brand/retrieveBoardStatus', f
|
|
|
296
296
|
}
|
|
297
297
|
});
|
|
298
298
|
}); });
|
|
299
|
-
export var retrieveBoardDetails = createAsyncThunk('brand/retrieveBoardDetails', function (_a) {
|
|
299
|
+
export var retrieveBoardDetails = createAsyncThunk('brand/retrieveBoardDetails', function (_a, thunkApi) {
|
|
300
300
|
var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
|
|
301
301
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
302
|
-
var data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
|
|
302
|
+
var responseBody, data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
|
|
303
303
|
var _c, _d, _e;
|
|
304
304
|
return __generator(this, function (_f) {
|
|
305
305
|
switch (_f.label) {
|
|
306
|
-
case 0:
|
|
306
|
+
case 0:
|
|
307
|
+
responseBody = thunkApi.getState().brand.data.verify.responseBody;
|
|
308
|
+
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
307
309
|
case 1:
|
|
308
310
|
data = _f.sent();
|
|
309
311
|
individualData = data === null || data === void 0 ? void 0 : data.user;
|
|
@@ -316,7 +318,7 @@ export var retrieveBoardDetails = createAsyncThunk('brand/retrieveBoardDetails',
|
|
|
316
318
|
individualData = individualRes;
|
|
317
319
|
boardData = boardRes;
|
|
318
320
|
_f.label = 3;
|
|
319
|
-
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, 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, board_status: boardData === null || boardData === void 0 ? void 0 : boardData.status })];
|
|
321
|
+
case 3: return [2, __assign(__assign({}, boardData), { brand: __assign(__assign({}, responseBody === null || responseBody === void 0 ? void 0 : responseBody.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, 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, board_status: boardData === null || boardData === void 0 ? void 0 : boardData.status })];
|
|
320
322
|
}
|
|
321
323
|
});
|
|
322
324
|
});
|
|
@@ -277,14 +277,16 @@ export var retrieveBoardStatus = createAsyncThunk('entity/retrieveBoardStatus',
|
|
|
277
277
|
}
|
|
278
278
|
});
|
|
279
279
|
}); });
|
|
280
|
-
export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', function (_a) {
|
|
280
|
+
export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', function (_a, thunkApi) {
|
|
281
281
|
var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
|
|
282
282
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
283
|
-
var data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
|
|
283
|
+
var responseBody, data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
|
|
284
284
|
var _c, _d, _e;
|
|
285
285
|
return __generator(this, function (_f) {
|
|
286
286
|
switch (_f.label) {
|
|
287
|
-
case 0:
|
|
287
|
+
case 0:
|
|
288
|
+
responseBody = thunkApi.getState().entity.data.verify.responseBody;
|
|
289
|
+
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
288
290
|
case 1:
|
|
289
291
|
data = _f.sent();
|
|
290
292
|
individualData = data === null || data === void 0 ? void 0 : data.user;
|
|
@@ -297,7 +299,7 @@ export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', f
|
|
|
297
299
|
individualData = individualRes;
|
|
298
300
|
boardData = boardRes;
|
|
299
301
|
_f.label = 3;
|
|
300
|
-
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, 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, board_status: boardData === null || boardData === void 0 ? void 0 : boardData.status })];
|
|
302
|
+
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: __assign(__assign({}, responseBody === null || responseBody === void 0 ? void 0 : responseBody.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, 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, board_status: boardData === null || boardData === void 0 ? void 0 : boardData.status })];
|
|
301
303
|
}
|
|
302
304
|
});
|
|
303
305
|
});
|
|
@@ -424,7 +424,7 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetai
|
|
|
424
424
|
case 1:
|
|
425
425
|
_c = _g.sent(), user = _c.user, data = __rest(_c, ["user"]);
|
|
426
426
|
if (!((individualData === null || individualData === void 0 ? void 0 : individualData.id) === (user === null || user === void 0 ? void 0 : user.id))) return [3, 2];
|
|
427
|
-
individualData = user;
|
|
427
|
+
individualData = __assign(__assign({}, individualData), user);
|
|
428
428
|
return [3, 4];
|
|
429
429
|
case 2:
|
|
430
430
|
if (!(!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && id && type)) return [3, 4];
|
|
@@ -818,7 +818,7 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
|
|
|
818
818
|
documentsList.push({ type: DocumentPurpose.CUSTOMER_SIGNATURE, images: signatureFileId });
|
|
819
819
|
if (!(documentsList.length > 0)) return [3, 6];
|
|
820
820
|
documentBody = {
|
|
821
|
-
individual_type_id: ((ids === null || ids === void 0 ? void 0 : ids.length) ? ids
|
|
821
|
+
individual_type_id: ((ids === null || ids === void 0 ? void 0 : ids.length) ? ids[0] : id) || '',
|
|
822
822
|
country: businessCountry.iso2,
|
|
823
823
|
documents: documentsList
|
|
824
824
|
};
|
|
@@ -1274,6 +1274,7 @@ export var individualSlice = createSlice({
|
|
|
1274
1274
|
state.data.individualData.isAuthorized = is_authorized;
|
|
1275
1275
|
})
|
|
1276
1276
|
.addCase(retrieveIndividualInfo.rejected, function (state, action) {
|
|
1277
|
+
state.addOrRequestDetailLoading = false;
|
|
1277
1278
|
state.error = action.error.message;
|
|
1278
1279
|
})
|
|
1279
1280
|
.addCase(getIndividualList.pending, function (state) {
|
|
@@ -152,14 +152,16 @@ export var retrieveBoardStatus = createAsyncThunk('tax/retrieveBoardStatus', fun
|
|
|
152
152
|
}
|
|
153
153
|
});
|
|
154
154
|
}); });
|
|
155
|
-
export var retrieveBoardDetails = createAsyncThunk('tax/retrieveBrandInfo', function (_a) {
|
|
155
|
+
export var retrieveBoardDetails = createAsyncThunk('tax/retrieveBrandInfo', function (_a, thunkApi) {
|
|
156
156
|
var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
|
|
157
157
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
158
|
-
var data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
|
|
158
|
+
var responseBody, data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
|
|
159
159
|
var _c, _d, _e, _f;
|
|
160
160
|
return __generator(this, function (_g) {
|
|
161
161
|
switch (_g.label) {
|
|
162
|
-
case 0:
|
|
162
|
+
case 0:
|
|
163
|
+
responseBody = thunkApi.getState().tax.data.verify.responseBody;
|
|
164
|
+
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
163
165
|
case 1:
|
|
164
166
|
data = _g.sent();
|
|
165
167
|
individualData = data === null || data === void 0 ? void 0 : data.user;
|
|
@@ -172,7 +174,7 @@ export var retrieveBoardDetails = createAsyncThunk('tax/retrieveBrandInfo', func
|
|
|
172
174
|
individualData = individualRes;
|
|
173
175
|
boardData = boardRes;
|
|
174
176
|
_g.label = 3;
|
|
175
|
-
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, vatID: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _e === void 0 ? void 0 : _e.vat_id, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, contact: (_f = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _f === void 0 ? void 0 : _f.contact, user: individualData, board_status: boardData === null || boardData === void 0 ? void 0 : boardData.status })];
|
|
177
|
+
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: __assign(__assign({}, responseBody === null || responseBody === void 0 ? void 0 : responseBody.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, vatID: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _e === void 0 ? void 0 : _e.vat_id, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, contact: (_f = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _f === void 0 ? void 0 : _f.contact, user: individualData, board_status: boardData === null || boardData === void 0 ? void 0 : boardData.status })];
|
|
176
178
|
}
|
|
177
179
|
});
|
|
178
180
|
});
|
|
@@ -42,14 +42,15 @@ var redirect = function (link) {
|
|
|
42
42
|
window.open(link, '_blank');
|
|
43
43
|
};
|
|
44
44
|
export var Terms = function () {
|
|
45
|
-
var _a, _b, _c;
|
|
45
|
+
var _a, _b, _c, _d, _e;
|
|
46
46
|
var st = useSanitizedTranslation();
|
|
47
47
|
var isAr = useLanguage().isAr;
|
|
48
48
|
var dispatch = useAppDispatch();
|
|
49
49
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
50
|
+
var _f = useAppSelector(kycSelector), loading = _f.loading, error = _f.error, data = _f.data;
|
|
51
|
+
var hasUsers = (_b = (_a = data.responseData) === null || _a === void 0 ? void 0 : _a.userList) === null || _b === void 0 ? void 0 : _b.length;
|
|
52
|
+
var hasOneUserOnly = ((_d = (_c = data.responseData) === null || _c === void 0 ? void 0 : _c.userList) === null || _d === void 0 ? void 0 : _d.length) === 1;
|
|
53
|
+
var user = hasOneUserOnly ? (_e = data.responseData) === null || _e === void 0 ? void 0 : _e.userList[0] : undefined;
|
|
53
54
|
var idNumber = user ? maskIDNumber(user.identification.id) : '';
|
|
54
55
|
var countryCode = settingsData.businessCountry.iso2.toLowerCase();
|
|
55
56
|
var termsAndConditionsLink = getWebsiteLink(isAr, countryCode, EXTERNAL_LINKS.TERMS_CONDITIONS);
|
|
@@ -82,6 +83,6 @@ export var Terms = function () {
|
|
|
82
83
|
return st('continue');
|
|
83
84
|
return isSACountry ? st('approve_with_nafath_app') : st('approve_with_paci_app');
|
|
84
85
|
};
|
|
85
|
-
return (_jsxs(ScreenContainer, { children: [_jsx(Header, { idNumber: idNumber }), _jsx(BoxStyled, __assign({ onClick: function () { return redirect(termsAndConditionsLink); } }, { children: st('kyc_terms_conditions') })), _jsx(BoxStyled, __assign({ onClick: function () { return redirect(termsAndConditionsLink); } }, { children: st('kyc_refund_policy') })), _jsx(BoxStyled, __assign({ onClick: function () { return redirect(termsAndConditionsLink); } }, { children: st('kyc_dispute_policy') })), _jsx(BoxStyled, __assign({ onClick: function () { return redirect(privacyPolicyLink); }, sx: { mb: error ? 3 : 0 } }, { children: st('kyc_privacy_policy') })), _jsx(Button, __assign({ disabled: isOtherThanKWOrSACountry, sx: { mt: 3 }, disableBack: true, isAr: isAr, loading: loading, error: st(error || ''), onClick: onNext }, { children: getNextButtonTitle() }))] }));
|
|
86
|
+
return (_jsxs(ScreenContainer, { children: [_jsx(Header, { idNumber: idNumber }), _jsx(BoxStyled, __assign({ onClick: function () { return redirect(termsAndConditionsLink); } }, { children: st('kyc_terms_conditions') })), _jsx(BoxStyled, __assign({ onClick: function () { return redirect(termsAndConditionsLink); } }, { children: st('kyc_refund_policy') })), _jsx(BoxStyled, __assign({ onClick: function () { return redirect(termsAndConditionsLink); } }, { children: st('kyc_dispute_policy') })), _jsx(BoxStyled, __assign({ onClick: function () { return redirect(privacyPolicyLink); }, sx: { mb: error ? 3 : 0 } }, { children: st('kyc_privacy_policy') })), _jsx(Button, __assign({ disabled: isOtherThanKWOrSACountry ? true : !hasUsers, sx: { mt: 3 }, disableBack: true, isAr: isAr, loading: loading, error: st(error || ''), onClick: onNext }, { children: getNextButtonTitle() }))] }));
|
|
86
87
|
};
|
|
87
88
|
export default memo(Terms);
|
package/build/utils/common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { axiosInstance } from '../api';
|
|
2
|
-
import { ENDPOINT_PATHS,
|
|
2
|
+
import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_PROD_URL } from '../constants';
|
|
3
3
|
import { objectHasValues } from './object';
|
|
4
4
|
import { isDisasterRecoveryEnv, isSA } from './string';
|
|
5
5
|
export var sleep = function (milliseconds) {
|
|
@@ -17,7 +17,7 @@ export var setBaseUrl = function (publicKey, region) {
|
|
|
17
17
|
var isProd = publicKey.includes('pk_live');
|
|
18
18
|
var _a = region.split('-'), country = _a[0], envType = _a[1];
|
|
19
19
|
if (!isProd) {
|
|
20
|
-
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.
|
|
20
|
+
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
if (isSA(country)) {
|
|
@@ -44,7 +44,7 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
|
|
|
44
44
|
window.history.replaceState({}, '', newUrl);
|
|
45
45
|
};
|
|
46
46
|
export var openConnect = function (pk, countryCode) {
|
|
47
|
-
var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL :
|
|
47
|
+
var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_SANDBOX_URL);
|
|
48
48
|
if (countryCode) {
|
|
49
49
|
newUrl.pathname = "/".concat(countryCode.toLowerCase());
|
|
50
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
-
"version": "2.12.6
|
|
3
|
+
"version": "2.12.6",
|
|
4
4
|
"description": "connect library, auth",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"copy:files": "copyfiles -u 1 src/**/*.css build/",
|
|
22
22
|
"tsc:alias": "tsc-alias -p tsconfig.json",
|
|
23
23
|
"ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
|
|
24
|
-
"push": "npm publish --access public
|
|
24
|
+
"push": "npm publish --access public"
|
|
25
25
|
},
|
|
26
26
|
"keywords": [],
|
|
27
27
|
"author": {
|