@tap-payments/auth-jsconnect 2.12.4-development → 2.12.5
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/api/availabilityServices.d.ts +3 -3
- package/build/api/document.d.ts +1 -1
- package/build/api/entity.d.ts +2 -2
- package/build/api/file.d.ts +2 -2
- package/build/api/index.d.ts +13 -13
- package/build/api/lead.d.ts +5 -5
- 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 +2 -1
- package/build/features/app/tax/taxStore.js +6 -4
- package/build/features/entity/screens/EntityName/EntityName.js +12 -11
- package/build/features/entity/screens/EntityName/validation.js +3 -3
- package/build/features/kyc/screens/Terms/Terms.js +6 -5
- package/build/utils/common.js +3 -3
- package/build/utils/rsa.d.ts +2 -2
- package/build/utils/rsa.js +1 -1
- package/build/utils/string.d.ts +20 -20
- package/package.json +5 -5
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)
|
|
@@ -14,8 +14,8 @@ export declare type CheckIBanBody = {
|
|
|
14
14
|
encryption_contract?: Array<string>;
|
|
15
15
|
};
|
|
16
16
|
declare const availabilityServices: {
|
|
17
|
-
checkEmail: (data: CheckEmailBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
18
|
-
checkBrand: (data: CheckBrandBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
19
|
-
checkIbanBank: (data: CheckIBanBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
17
|
+
checkEmail: (data: CheckEmailBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
18
|
+
checkBrand: (data: CheckBrandBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
19
|
+
checkIbanBank: (data: CheckIBanBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
20
20
|
};
|
|
21
21
|
export default availabilityServices;
|
package/build/api/document.d.ts
CHANGED
|
@@ -20,6 +20,6 @@ export interface DocumentBody {
|
|
|
20
20
|
declare const documentService: {
|
|
21
21
|
updateDocumentInfo: (data: DocumentUpdateBody) => Promise<any>;
|
|
22
22
|
addFilesToExistingDocument: ({ id, ...data }: DocumentBody) => Promise<any>;
|
|
23
|
-
removeFilesFromDocument: ({ id, ...data }: DocumentBody) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
23
|
+
removeFilesFromDocument: ({ id, ...data }: DocumentBody) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
24
24
|
};
|
|
25
25
|
export { documentService };
|
package/build/api/entity.d.ts
CHANGED
|
@@ -142,11 +142,11 @@ export declare type CreateEntityBody = {
|
|
|
142
142
|
};
|
|
143
143
|
};
|
|
144
144
|
declare const entityService: {
|
|
145
|
-
createEntityInfo: ({ id, ...data }: EntityInfoBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
145
|
+
createEntityInfo: ({ id, ...data }: EntityInfoBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
146
146
|
updateEntityInfo: ({ id, ...data }: EntityInfoBody) => Promise<any>;
|
|
147
147
|
createBankAccount: (data: EntityBankUpdateBody) => Promise<any>;
|
|
148
148
|
retrieveBankAccount: (id: string) => Promise<any>;
|
|
149
|
-
retrieveEntityInfo: (entity_id: string, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
149
|
+
retrieveEntityInfo: (entity_id: string, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
150
150
|
updateIndividualInfo: ({ id, ...data }: EntityInfoBody) => Promise<any>;
|
|
151
151
|
retrieveEntity: (entity_id: string) => Promise<any>;
|
|
152
152
|
updateEntity: ({ id, ...data }: UpdateEntityBody) => Promise<any>;
|
package/build/api/file.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export declare type UploadFileBody = {
|
|
|
7
7
|
type?: string;
|
|
8
8
|
};
|
|
9
9
|
declare const fileService: {
|
|
10
|
-
uploadFile: (data: UploadFileBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
10
|
+
uploadFile: (data: UploadFileBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
11
11
|
uploadFileInfo: (data: UploadFileBody, config?: AxiosRequestConfig) => Promise<any>;
|
|
12
|
-
downloadFile: (id: string, name: string, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
12
|
+
downloadFile: (id: string, name: string, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
13
13
|
};
|
|
14
14
|
export { fileService };
|
package/build/api/index.d.ts
CHANGED
|
@@ -47,26 +47,26 @@ declare const API: {
|
|
|
47
47
|
generateConfigToken: (body: ConfigBody) => Promise<any>;
|
|
48
48
|
};
|
|
49
49
|
leadService: {
|
|
50
|
-
createLead: (data: CreateLeadBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
50
|
+
createLead: (data: CreateLeadBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
51
51
|
updateLead: ({ id, ...data }: UpdateLeadBody) => Promise<any>;
|
|
52
|
-
retrieveLead: (leadId: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
52
|
+
retrieveLead: (leadId: string) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
53
53
|
getLeadById: (leadId: string) => Promise<any>;
|
|
54
|
-
verifyLeadToken: (data: LeadVerifyBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
54
|
+
verifyLeadToken: (data: LeadVerifyBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
55
55
|
verifyToken: (data: LeadVerifyBody) => Promise<any>;
|
|
56
|
-
verifyLeadOTP: (data: LeadOTPVerifyBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
56
|
+
verifyLeadOTP: (data: LeadOTPVerifyBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
57
57
|
verifyTokenOTP: (data: LeadOTPVerifyBody) => Promise<any>;
|
|
58
|
-
retrieveEntityList: (leadId: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
58
|
+
retrieveEntityList: (leadId: string) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
59
59
|
retrieveLeadIdentity: (leadId: string) => Promise<any>;
|
|
60
60
|
updateLeadExpress: ({ id, ...data }: UpdateLeadBody) => Promise<any>;
|
|
61
61
|
verifyExpressLeadToken: (data: ExpressLeadVerifyBody) => Promise<any>;
|
|
62
62
|
createVerifyTokenByBoardId: (data: import("./lead").CreateVerifyTokenBody) => Promise<any>;
|
|
63
63
|
};
|
|
64
64
|
entityService: {
|
|
65
|
-
createEntityInfo: ({ id, ...data }: EntityInfoBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
65
|
+
createEntityInfo: ({ id, ...data }: EntityInfoBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
66
66
|
updateEntityInfo: ({ id, ...data }: EntityInfoBody) => Promise<any>;
|
|
67
67
|
createBankAccount: (data: EntityBankUpdateBody) => Promise<any>;
|
|
68
68
|
retrieveBankAccount: (id: string) => Promise<any>;
|
|
69
|
-
retrieveEntityInfo: (entity_id: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
69
|
+
retrieveEntityInfo: (entity_id: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
70
70
|
updateIndividualInfo: ({ id, ...data }: EntityInfoBody) => Promise<any>;
|
|
71
71
|
retrieveEntity: (entity_id: string) => Promise<any>;
|
|
72
72
|
updateEntity: ({ id, ...data }: UpdateEntityBody) => Promise<any>;
|
|
@@ -82,9 +82,9 @@ declare const API: {
|
|
|
82
82
|
createEntity: (data: CreateEntityBody) => Promise<any>;
|
|
83
83
|
};
|
|
84
84
|
availabilityServices: {
|
|
85
|
-
checkEmail: (data: CheckEmailBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
86
|
-
checkBrand: (data: CheckBrandBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
87
|
-
checkIbanBank: (data: import("./availabilityServices").CheckIBanBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
85
|
+
checkEmail: (data: CheckEmailBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
86
|
+
checkBrand: (data: CheckBrandBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
87
|
+
checkIbanBank: (data: import("./availabilityServices").CheckIBanBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
88
88
|
};
|
|
89
89
|
firebaseService: {
|
|
90
90
|
getLocale: (disableLocale?: boolean | undefined) => Promise<any>;
|
|
@@ -154,14 +154,14 @@ declare const API: {
|
|
|
154
154
|
removeBrandActivity: ({ id, ...data }: RemoveBrandActivity) => Promise<any>;
|
|
155
155
|
};
|
|
156
156
|
fileService: {
|
|
157
|
-
uploadFile: (data: UploadFileBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
157
|
+
uploadFile: (data: UploadFileBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
158
158
|
uploadFileInfo: (data: UploadFileBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
159
|
-
downloadFile: (id: string, name: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
159
|
+
downloadFile: (id: string, name: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
160
160
|
};
|
|
161
161
|
documentService: {
|
|
162
162
|
updateDocumentInfo: (data: DocumentUpdateBody) => Promise<any>;
|
|
163
163
|
addFilesToExistingDocument: ({ id, ...data }: DocumentBody) => Promise<any>;
|
|
164
|
-
removeFilesFromDocument: ({ id, ...data }: DocumentBody) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
164
|
+
removeFilesFromDocument: ({ id, ...data }: DocumentBody) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
165
165
|
};
|
|
166
166
|
initService: {
|
|
167
167
|
getInitialData: (body: InitBody) => Promise<any>;
|
package/build/api/lead.d.ts
CHANGED
|
@@ -117,15 +117,15 @@ export declare type LeadIdentityUpdateBody = {
|
|
|
117
117
|
encryption_contract: Array<string>;
|
|
118
118
|
};
|
|
119
119
|
declare const leadService: {
|
|
120
|
-
createLead: (data: CreateLeadBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
120
|
+
createLead: (data: CreateLeadBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
121
121
|
updateLead: ({ id, ...data }: UpdateLeadBody) => Promise<any>;
|
|
122
|
-
retrieveLead: (leadId: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
122
|
+
retrieveLead: (leadId: string) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
123
123
|
getLeadById: (leadId: string) => Promise<any>;
|
|
124
|
-
verifyLeadToken: (data: LeadVerifyBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
124
|
+
verifyLeadToken: (data: LeadVerifyBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
125
125
|
verifyToken: (data: LeadVerifyBody) => Promise<any>;
|
|
126
|
-
verifyLeadOTP: (data: LeadOTPVerifyBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
126
|
+
verifyLeadOTP: (data: LeadOTPVerifyBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
127
127
|
verifyTokenOTP: (data: LeadOTPVerifyBody) => Promise<any>;
|
|
128
|
-
retrieveEntityList: (leadId: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
128
|
+
retrieveEntityList: (leadId: string) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
129
129
|
retrieveLeadIdentity: (leadId: string) => Promise<any>;
|
|
130
130
|
updateLeadExpress: ({ id, ...data }: UpdateLeadBody) => Promise<any>;
|
|
131
131
|
verifyExpressLeadToken: (data: ExpressLeadVerifyBody) => Promise<any>;
|
|
@@ -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];
|
|
@@ -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
|
});
|
|
@@ -38,22 +38,22 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
38
38
|
flexDirection: 'column'
|
|
39
39
|
}); });
|
|
40
40
|
var EntityName = function (_a) {
|
|
41
|
-
var _b, _c;
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
41
|
+
var _b, _c, _d;
|
|
42
|
+
var _e = React.useState(false), issueAnchorEl = _e[0], setIssueAnchorEl = _e[1];
|
|
43
|
+
var _f = React.useState(false), expiryAnchorEl = _f[0], setExpiryAnchorEl = _f[1];
|
|
44
|
+
var _g = React.useState(false), entityTypeAnchorEl = _g[0], setEntityTypeAnchorEl = _g[1];
|
|
45
|
+
var _h = useAppSelector(entitySelector), data = _h.data, loading = _h.loading, error = _h.error, uploading = _h.uploading, uploadingArticle = _h.uploadingArticle;
|
|
46
46
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
47
47
|
var isAr = useLanguage().isAr;
|
|
48
48
|
var t = useTranslation().t;
|
|
49
49
|
var dispatch = useAppDispatch();
|
|
50
|
-
var
|
|
50
|
+
var _j = data.entityNameData, legalName = _j.legalName, licenseNumber = _j.licenseNumber, licenseType = _j.licenseType, entityType = _j.entityType, issuingDate = _j.issuingDate, expiryDate = _j.expiryDate, unifiedNumber = _j.unifiedNumber, certificateId = _j.certificateId, articleId = _j.articleId;
|
|
51
51
|
var country_code = settingsData.businessCountry.iso2;
|
|
52
52
|
var isSACountry = React.useMemo(function () { return isSA(country_code); }, [country_code]);
|
|
53
53
|
var isKWCountry = React.useMemo(function () { return isKW(country_code); }, [country_code]);
|
|
54
54
|
var isCR = licenseType === BusinessType.CR;
|
|
55
|
-
var
|
|
56
|
-
var
|
|
55
|
+
var _k = data.verify.responseBody || {}, entity = _k.entity, flows = _k.flows, entityTypes = _k.entityTypes;
|
|
56
|
+
var _l = entity || {}, AOA_file = _l.AOA_file, id = _l.id, documents = _l.documents, data_status = _l.data_status, data_verification = _l.data_verification, legal_name = _l.legal_name, type = _l.type, license = _l.license;
|
|
57
57
|
var noneEditable = useDataNoneEditable(data_status, [
|
|
58
58
|
'legal_name.en',
|
|
59
59
|
'legal_name.ar',
|
|
@@ -88,6 +88,7 @@ var EntityName = function (_a) {
|
|
|
88
88
|
mode: 'onChange'
|
|
89
89
|
});
|
|
90
90
|
var watch = methods.watch;
|
|
91
|
+
var isEntityTypeFL = ((_b = watch('entityType')) === null || _b === void 0 ? void 0 : _b.toLocaleLowerCase()) === BusinessType.FL;
|
|
91
92
|
useSetFromDefaultValues(methods, data.entityNameData, true);
|
|
92
93
|
var defaultCertificateFiles = React.useMemo(function () { return getFileDetailsFromDocument(documents, DocumentPurpose.CR); }, [documents]);
|
|
93
94
|
var defaultArticleFile = React.useMemo(function () { return AOA_file && __assign(__assign({}, AOA_file), { docId: id }); }, [AOA_file]);
|
|
@@ -100,7 +101,7 @@ var EntityName = function (_a) {
|
|
|
100
101
|
entityType: type || (entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes[0]),
|
|
101
102
|
issuingDate: issueDateRes,
|
|
102
103
|
expiryDate: expDateRes,
|
|
103
|
-
unifiedNumber: (
|
|
104
|
+
unifiedNumber: (_c = license === null || license === void 0 ? void 0 : license.additional_info) === null || _c === void 0 ? void 0 : _c.unified_number,
|
|
104
105
|
articleId: defaultArticleFile === null || defaultArticleFile === void 0 ? void 0 : defaultArticleFile.id
|
|
105
106
|
}).isDirty;
|
|
106
107
|
var originalReadOnly = useFormReadOnly(methods, { certificateId: defaultCertificateFiles, articleId: defaultArticleFile });
|
|
@@ -119,7 +120,7 @@ var EntityName = function (_a) {
|
|
|
119
120
|
var isLegalNameVerified = dataVerified['legal_name.en'] && dataVerified['legal_name.ar'] && ((legal_name === null || legal_name === void 0 ? void 0 : legal_name.en) === watch('legalName') || (legal_name === null || legal_name === void 0 ? void 0 : legal_name.ar) === watch('legalName'));
|
|
120
121
|
var isEntityTypeVerified = dataVerified['type'] && type === watch('entityType');
|
|
121
122
|
var isLicenseNumberVerified = dataVerified['license.number'] && (license === null || license === void 0 ? void 0 : license.number) === watch('licenseNumber');
|
|
122
|
-
var isUnifiedNumberVerified = dataVerified['license.additional_info'] && ((
|
|
123
|
+
var isUnifiedNumberVerified = dataVerified['license.additional_info'] && ((_d = license === null || license === void 0 ? void 0 : license.additional_info) === null || _d === void 0 ? void 0 : _d.unified_number) === watch('unifiedNumber');
|
|
123
124
|
var isIssuingDateVerified = dataVerified['license.issuing_date'] && issueDateRes === watch('issuingDate');
|
|
124
125
|
var isExpiryDateVerified = dataVerified['license.expiry_date'] && expDateRes === watch('expiryDate');
|
|
125
126
|
var isArticleIdVerified = dataVerified['AOA_file_id'];
|
|
@@ -156,7 +157,7 @@ var EntityName = function (_a) {
|
|
|
156
157
|
var disabled = !methods.formState.isValid || uploading || uploadingArticle;
|
|
157
158
|
var showLicenseNumber = isKWCountry ? isCR : true;
|
|
158
159
|
var showExpiryDate = isSACountry ? !isCR : true;
|
|
159
|
-
var showUnifiedNumber = isSACountry ?
|
|
160
|
+
var showUnifiedNumber = isSACountry ? !isEntityTypeFL : false;
|
|
160
161
|
var disableBack = settingsData.appConfig.mode === 'content';
|
|
161
162
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(LegalName, { readOnly: readOnly['legalName'] || (noneEditable['legal_name.en'] && noneEditable['legal_name.ar']), isVerified: isLegalNameVerified }) })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl }, { children: _jsx(EntityTypeList, { readOnly: readOnly['entityType'] || noneEditable['type'], onListOpen: function () { return handleEntityOpenClose(true); }, onListClose: function () { return handleEntityOpenClose(false); }, isVerified: isEntityTypeVerified }) })), _jsxs(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: [_jsx(UnifiedNumber, { show: showUnifiedNumber, readOnly: readOnly['unifiedNumber'] || noneEditable['license.additional_info'], isVerified: isUnifiedNumberVerified }), _jsx(LicenseNumber, { show: showLicenseNumber, readOnly: readOnly['licenseNumber'] || noneEditable['license.number'], isVerified: isLicenseNumberVerified })] })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !entityTypeAnchorEl }, { children: _jsx(IssuingDate, { onDateClicked: handleIssueDateOpenClose, readOnly: readOnly['issuingDate'] || noneEditable['license.issuing_date'], isVerified: isIssuingDateVerified }) })), _jsx(Collapse, __assign({ in: !issueAnchorEl && !entityTypeAnchorEl && showExpiryDate }, { children: _jsx(ExpiryDate, { onDateClicked: handleExpiryDateOpenClose, readOnly: readOnly['expiryDate'] || noneEditable['license.expiry_date'], isVerified: isExpiryDateVerified }) })), _jsxs(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: [_jsx(LicenseCertificate, { defaultFiles: defaultCertificateFiles, show: isSACountry ? false : !isKWCountry || isCR, readOnly: readOnly['certificateId'] || noneEditable['documents'] }), _jsx(Article, { defaultFile: defaultArticleFile, show: !isSACountry, readOnly: readOnly['articleId'] || noneEditable['AOA_file_id'], isVerified: isArticleIdVerified })] })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(Button, __assign({ disableBack: disableBack, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
162
163
|
};
|
|
@@ -21,9 +21,9 @@ export var EntityNameValidationSchema = function (noneEditable) {
|
|
|
21
21
|
licenseNumber: yup.string().optional(),
|
|
22
22
|
unifiedNumber: noneEditable['license.additional_info']
|
|
23
23
|
? yup.string().optional()
|
|
24
|
-
: yup.string().when('
|
|
25
|
-
var
|
|
26
|
-
if (
|
|
24
|
+
: yup.string().when('entityType', function (entityType) {
|
|
25
|
+
var isFL = (entityType === null || entityType === void 0 ? void 0 : entityType.toLocaleLowerCase()) === BusinessType.FL;
|
|
26
|
+
if (isFL) {
|
|
27
27
|
return yup.string().optional();
|
|
28
28
|
}
|
|
29
29
|
return yup
|
|
@@ -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/build/utils/rsa.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const encryptObject: (data: unknown) =>
|
|
2
|
-
export declare const encryptString: (string: string) =>
|
|
1
|
+
export declare const encryptObject: (data: unknown) => string | false;
|
|
2
|
+
export declare const encryptString: (string: string) => string;
|
package/build/utils/rsa.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RSA_FRONTEND_MW_PUBLIC_KEY } from '../constants';
|
|
2
|
-
|
|
2
|
+
import { JSEncrypt } from 'jsencrypt';
|
|
3
3
|
var rsa = new JSEncrypt();
|
|
4
4
|
rsa.setPublicKey(RSA_FRONTEND_MW_PUBLIC_KEY);
|
|
5
5
|
export var encryptObject = function (data) {
|
package/build/utils/string.d.ts
CHANGED
|
@@ -19,27 +19,27 @@ export declare const getFlowUrl: (path: string, lang: string) => string;
|
|
|
19
19
|
export declare const getResetFlowUrl: (path: string, lang: string, operationType: string, id: string, infoId: string, userId: string, userType: string) => string;
|
|
20
20
|
export declare const capitalizeTheFirstLetterOfEachWord: (words: string) => string;
|
|
21
21
|
export declare const getRequestHeaders: (deviceInfo: DeviceInfo) => {
|
|
22
|
-
al:
|
|
23
|
-
at:
|
|
24
|
-
aid:
|
|
25
|
-
an:
|
|
26
|
-
av:
|
|
27
|
-
acv:
|
|
28
|
-
asv:
|
|
29
|
-
rn:
|
|
30
|
-
rt:
|
|
31
|
-
rb:
|
|
32
|
-
rm:
|
|
33
|
-
ro:
|
|
34
|
-
rov:
|
|
35
|
-
bn:
|
|
36
|
-
bb:
|
|
37
|
-
bv:
|
|
38
|
-
bua:
|
|
22
|
+
al: string;
|
|
23
|
+
at: string;
|
|
24
|
+
aid: string;
|
|
25
|
+
an: string;
|
|
26
|
+
av: string;
|
|
27
|
+
acv: string;
|
|
28
|
+
asv: string;
|
|
29
|
+
rn: string;
|
|
30
|
+
rt: string;
|
|
31
|
+
rb: string;
|
|
32
|
+
rm: string;
|
|
33
|
+
ro: string;
|
|
34
|
+
rov: string;
|
|
35
|
+
bn: string;
|
|
36
|
+
bb: string;
|
|
37
|
+
bv: string;
|
|
38
|
+
bua: string;
|
|
39
39
|
bi: string;
|
|
40
|
-
ci:
|
|
41
|
-
cm:
|
|
42
|
-
l:
|
|
40
|
+
ci: string;
|
|
41
|
+
cm: string;
|
|
42
|
+
l: string;
|
|
43
43
|
};
|
|
44
44
|
export declare const removeRequestHeaders: () => void;
|
|
45
45
|
export declare const getBaseUrl: () => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.5",
|
|
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": {
|
|
@@ -82,18 +82,18 @@
|
|
|
82
82
|
"@mui/icons-material": "^5.8.4",
|
|
83
83
|
"@mui/material": "^5.8.7",
|
|
84
84
|
"@reduxjs/toolkit": "^1.8.3",
|
|
85
|
-
"axios": "^1.
|
|
85
|
+
"axios": "^1.15.0",
|
|
86
86
|
"device-detector-js": "^3.0.3",
|
|
87
87
|
"i18next": "^21.8.14",
|
|
88
88
|
"i18next-browser-languagedetector": "^6.1.4",
|
|
89
89
|
"i18next-http-backend": "^1.4.1",
|
|
90
|
-
"jsencrypt": "^
|
|
90
|
+
"jsencrypt": "^3.5.4",
|
|
91
91
|
"lodash-es": "^4.17.21",
|
|
92
92
|
"lottie-web": "^5.9.6",
|
|
93
93
|
"moment": "^2.29.4",
|
|
94
94
|
"react": "^18.2.0",
|
|
95
95
|
"react-calendar": "~3.7.0",
|
|
96
|
-
"react-device-detect": "^2.2.
|
|
96
|
+
"react-device-detect": "^2.2.3",
|
|
97
97
|
"react-dom": "^18.2.0",
|
|
98
98
|
"react-dropzone": "^14.2.2",
|
|
99
99
|
"react-gtm-module": "^2.0.11",
|