@tap-payments/auth-jsconnect 2.3.98-test → 2.4.0-test
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/features/app/brand/brandStore.js +0 -12
- package/build/features/app/business/businessStore.js +25 -4
- package/build/features/app/entity/entityStore.js +5 -5
- package/build/features/app/individual/individualStore.js +2 -2
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +1 -1
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +3 -3
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +1 -2
- package/build/features/brand/screens/BrandActivities/TAC.js +3 -3
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +3 -3
- package/build/features/business/screens/Customers/RefundPolicy.js +15 -4
- package/build/features/business/screens/Customers/TransactionPolicy.js +19 -9
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +2 -2
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +2 -2
- package/build/utils/string.d.ts +1 -0
- package/build/utils/string.js +5 -0
- package/package.json +1 -1
|
@@ -532,11 +532,7 @@ export var brandSlice = createSlice({
|
|
|
532
532
|
(_d = brand === null || brand === void 0 ? void 0 : brand.terms) === null || _d === void 0 ? void 0 : _d.forEach(function (element) {
|
|
533
533
|
if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {
|
|
534
534
|
state.data.brandActivities.termAndConditionChecked = element.agree;
|
|
535
|
-
}
|
|
536
|
-
if ((element === null || element === void 0 ? void 0 : element.term) === 'chargeback') {
|
|
537
535
|
state.data.brandActivities.transactionPolicy = element.agree;
|
|
538
|
-
}
|
|
539
|
-
if ((element === null || element === void 0 ? void 0 : element.term) === 'refund') {
|
|
540
536
|
state.data.brandActivities.refundPolicy = element.agree;
|
|
541
537
|
}
|
|
542
538
|
});
|
|
@@ -590,11 +586,7 @@ export var brandSlice = createSlice({
|
|
|
590
586
|
(_d = brand === null || brand === void 0 ? void 0 : brand.terms) === null || _d === void 0 ? void 0 : _d.forEach(function (element) {
|
|
591
587
|
if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {
|
|
592
588
|
state.data.brandActivities.termAndConditionChecked = element.agree;
|
|
593
|
-
}
|
|
594
|
-
if ((element === null || element === void 0 ? void 0 : element.term) === 'chargeback') {
|
|
595
589
|
state.data.brandActivities.transactionPolicy = element.agree;
|
|
596
|
-
}
|
|
597
|
-
if ((element === null || element === void 0 ? void 0 : element.term) === 'refund') {
|
|
598
590
|
state.data.brandActivities.refundPolicy = element.agree;
|
|
599
591
|
}
|
|
600
592
|
});
|
|
@@ -642,11 +634,7 @@ export var brandSlice = createSlice({
|
|
|
642
634
|
terms === null || terms === void 0 ? void 0 : terms.forEach(function (element) {
|
|
643
635
|
if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {
|
|
644
636
|
state.data.brandActivities.termAndConditionChecked = element.agree;
|
|
645
|
-
}
|
|
646
|
-
if ((element === null || element === void 0 ? void 0 : element.term) === 'chargeback') {
|
|
647
637
|
state.data.brandActivities.transactionPolicy = element.agree;
|
|
648
|
-
}
|
|
649
|
-
if ((element === null || element === void 0 ? void 0 : element.term) === 'refund') {
|
|
650
638
|
state.data.brandActivities.refundPolicy = element.agree;
|
|
651
639
|
}
|
|
652
640
|
});
|
|
@@ -103,7 +103,7 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
|
|
|
103
103
|
hasBusinessCRInfoCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_INFO) && hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_INFO_CONFIRM);
|
|
104
104
|
hasBusinessCRActivitiesCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_ACTIVITIES);
|
|
105
105
|
hasBusinessCustomersCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CUSTOMERS);
|
|
106
|
-
if (!(!entity_activities && hasBusinessCRInfoCompleted && !hasBusinessCompleted)) return [3, 4];
|
|
106
|
+
if (!(!entity_activities && (hasBusinessCRInfoCompleted || hasBusinessCRActivitiesCompleted) && !hasBusinessCompleted)) return [3, 4];
|
|
107
107
|
return [4, API.dataService.getActivities()];
|
|
108
108
|
case 3:
|
|
109
109
|
activityList = (_b.sent()).list;
|
|
@@ -237,7 +237,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
|
|
|
237
237
|
_j.label = 6;
|
|
238
238
|
case 6:
|
|
239
239
|
entity_activities = leadData.entity_activities;
|
|
240
|
-
if (!(!entity_activities && hasBusinessCRInfoCompleted && !hasBusinessCompleted)) return [3, 8];
|
|
240
|
+
if (!(!entity_activities && (hasBusinessCRInfoCompleted || hasBusinessCRActivitiesCompleted) && !hasBusinessCompleted)) return [3, 8];
|
|
241
241
|
return [4, API.dataService.getActivities()];
|
|
242
242
|
case 7:
|
|
243
243
|
activityList = (_j.sent()).list;
|
|
@@ -795,7 +795,7 @@ export var businessSlice = createSlice({
|
|
|
795
795
|
state.customLoading = false;
|
|
796
796
|
var _c = action.payload, data = _c.data, boardId = _c.boardId, brandData = _c.brandData, leadData = _c.leadData, token = _c.token, isRequireOTP = _c.isRequireOTP;
|
|
797
797
|
var responseBody = state.data.verify.responseBody;
|
|
798
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), leadData), responseBody), { board_id: boardId, lead_id: data === null || data === void 0 ? void 0 : data.id });
|
|
798
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign(__assign({}, data), leadData), responseBody), { board_id: boardId, lead_id: data === null || data === void 0 ? void 0 : data.id }), (brandData && { brand: brandData }));
|
|
799
799
|
if (token)
|
|
800
800
|
state.data.verify.token = token;
|
|
801
801
|
state.data.otpData.isNID = false;
|
|
@@ -812,6 +812,13 @@ export var businessSlice = createSlice({
|
|
|
812
812
|
var activities = (brandData || {}).activities;
|
|
813
813
|
return activities === null || activities === void 0 ? void 0 : activities.find(function (value) { return activity.id === value.id; });
|
|
814
814
|
});
|
|
815
|
+
var terms = (brandData || {}).terms;
|
|
816
|
+
terms === null || terms === void 0 ? void 0 : terms.forEach(function (element) {
|
|
817
|
+
if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {
|
|
818
|
+
state.data.customersData.transactionPolicy = element.agree;
|
|
819
|
+
state.data.customersData.refundPolicy = element.agree;
|
|
820
|
+
}
|
|
821
|
+
});
|
|
815
822
|
state.data.activitiesData.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [];
|
|
816
823
|
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities });
|
|
817
824
|
})
|
|
@@ -847,7 +854,7 @@ export var businessSlice = createSlice({
|
|
|
847
854
|
var _c = action.payload, data = _c.data, formData = _c.formData, brand = _c.brand, leadData = _c.leadData;
|
|
848
855
|
state.data.otpData = formData;
|
|
849
856
|
state.data.otpData.responseBody = data;
|
|
850
|
-
state.data.verify.responseBody = __assign(__assign(__assign({}, leadData), state.data.verify.responseBody), { flows: (leadData === null || leadData === void 0 ? void 0 : leadData.flows) || [] });
|
|
857
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, leadData), state.data.verify.responseBody), (brand && { brand: brand })), { flows: (leadData === null || leadData === void 0 ? void 0 : leadData.flows) || [] });
|
|
851
858
|
var _d = leadData || {}, entity = _d.entity, entity_activities = _d.entity_activities, business_name = _d.business_name;
|
|
852
859
|
if (business_name === null || business_name === void 0 ? void 0 : business_name.en)
|
|
853
860
|
state.data.businessTypeData.entityLegalName = business_name === null || business_name === void 0 ? void 0 : business_name.en;
|
|
@@ -859,6 +866,13 @@ export var businessSlice = createSlice({
|
|
|
859
866
|
var activities = (brand || {}).activities;
|
|
860
867
|
return activities === null || activities === void 0 ? void 0 : activities.find(function (value) { return value.id === activity.id; });
|
|
861
868
|
});
|
|
869
|
+
var terms = (brand || {}).terms;
|
|
870
|
+
terms === null || terms === void 0 ? void 0 : terms.forEach(function (element) {
|
|
871
|
+
if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {
|
|
872
|
+
state.data.customersData.transactionPolicy = element.agree;
|
|
873
|
+
state.data.customersData.refundPolicy = element.agree;
|
|
874
|
+
}
|
|
875
|
+
});
|
|
862
876
|
state.data.activitiesData.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [];
|
|
863
877
|
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities });
|
|
864
878
|
})
|
|
@@ -1057,6 +1071,13 @@ export var businessSlice = createSlice({
|
|
|
1057
1071
|
}
|
|
1058
1072
|
var activities = entity_activities || [];
|
|
1059
1073
|
state.data.businessTypeData.responseBody = __assign(__assign(__assign(__assign(__assign({}, data), state.data.businessTypeData.responseBody), { activities: activities }), accountData), documentData);
|
|
1074
|
+
var terms = (brand || {}).terms;
|
|
1075
|
+
terms === null || terms === void 0 ? void 0 : terms.forEach(function (element) {
|
|
1076
|
+
if ((element === null || element === void 0 ? void 0 : element.term) === 'general') {
|
|
1077
|
+
state.data.customersData.transactionPolicy = element.agree;
|
|
1078
|
+
state.data.customersData.refundPolicy = element.agree;
|
|
1079
|
+
}
|
|
1080
|
+
});
|
|
1060
1081
|
state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), { entity: entity }), (brand && { brand: brand }));
|
|
1061
1082
|
})
|
|
1062
1083
|
.addCase(updateLeadBusinessType.rejected, function (state, action) {
|
|
@@ -63,7 +63,7 @@ import { BusinessType, DocumentPurpose, FlowsTypes, LicenseType } from '../../..
|
|
|
63
63
|
import { handleNextScreenStep, handlePrevScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
64
64
|
import { ENTITY_STEP_NAMES } from '../../../constants';
|
|
65
65
|
import moment from 'moment';
|
|
66
|
-
import { convertNumbers2English, getRecentDocumentBasedOnPurpose, hasVerifiedValue, hasNoneEditableValue, sleep } from '../../../utils';
|
|
66
|
+
import { convertNumbers2English, getRecentDocumentBasedOnPurpose, hasVerifiedValue, hasNoneEditableValue, sleep, formatNumberAsCurrency } from '../../../utils';
|
|
67
67
|
export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function (_a, thunkApi) {
|
|
68
68
|
var token = _a.token, isInternally = _a.isInternally;
|
|
69
69
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -523,11 +523,11 @@ export var entitySlice = createSlice({
|
|
|
523
523
|
if ((activities === null || activities === void 0 ? void 0 : activities.length) > 0)
|
|
524
524
|
state.data.entityCapitalData.activities = activities;
|
|
525
525
|
if (paid)
|
|
526
|
-
state.data.entityCapitalData.capitalPaid = paid;
|
|
526
|
+
state.data.entityCapitalData.capitalPaid = formatNumberAsCurrency(paid);
|
|
527
527
|
if (shares === null || shares === void 0 ? void 0 : shares.count)
|
|
528
528
|
state.data.entityCapitalData.capitalShareCount = shares === null || shares === void 0 ? void 0 : shares.count;
|
|
529
529
|
if (shares === null || shares === void 0 ? void 0 : shares.value)
|
|
530
|
-
state.data.entityCapitalData.capitalShareValue = shares === null || shares === void 0 ? void 0 : shares.value;
|
|
530
|
+
state.data.entityCapitalData.capitalShareValue = formatNumberAsCurrency(shares === null || shares === void 0 ? void 0 : shares.value);
|
|
531
531
|
state.data.entityNameData.responseBody = __assign(__assign({}, state.data.entityNameData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id });
|
|
532
532
|
}
|
|
533
533
|
})
|
|
@@ -604,11 +604,11 @@ export var entitySlice = createSlice({
|
|
|
604
604
|
if ((activities === null || activities === void 0 ? void 0 : activities.length) > 0)
|
|
605
605
|
state.data.entityCapitalData.activities = activities;
|
|
606
606
|
if (paid)
|
|
607
|
-
state.data.entityCapitalData.capitalPaid = paid;
|
|
607
|
+
state.data.entityCapitalData.capitalPaid = formatNumberAsCurrency(paid);
|
|
608
608
|
if (shares === null || shares === void 0 ? void 0 : shares.count)
|
|
609
609
|
state.data.entityCapitalData.capitalShareCount = shares === null || shares === void 0 ? void 0 : shares.count;
|
|
610
610
|
if (shares === null || shares === void 0 ? void 0 : shares.value)
|
|
611
|
-
state.data.entityCapitalData.capitalShareValue = shares === null || shares === void 0 ? void 0 : shares.value;
|
|
611
|
+
state.data.entityCapitalData.capitalShareValue = formatNumberAsCurrency(shares === null || shares === void 0 ? void 0 : shares.value);
|
|
612
612
|
state.data.entityNameData = __assign(__assign({}, state.data.entityNameData), { responseBody: __assign(__assign({}, state.data.entityNameData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id }) });
|
|
613
613
|
})
|
|
614
614
|
.addCase(verifyEntityLeadOTP.rejected, function (state, action) {
|
|
@@ -71,7 +71,7 @@ import API from '../../../api';
|
|
|
71
71
|
import { FlowsTypes, IndividualGender, IndividualType, DocumentPurpose } from '../../../@types';
|
|
72
72
|
import { handleNextScreenStep, handlePrevScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
73
73
|
import { defaultCountry, IDENTIFICATION_TYPE, INDIVIDUAl_STEP_NAMES } from '../../../constants';
|
|
74
|
-
import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose } from '../../../utils';
|
|
74
|
+
import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose, formatNumberAsCurrency } from '../../../utils';
|
|
75
75
|
export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a, thunkApi) {
|
|
76
76
|
var token = _a.token, isInternally = _a.isInternally, isUpdatePhoneInfo = _a.isUpdatePhoneInfo;
|
|
77
77
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1019,7 +1019,7 @@ export var individualSlice = createSlice({
|
|
|
1019
1019
|
state.data.individualData.shareCount = shareCount;
|
|
1020
1020
|
}
|
|
1021
1021
|
if (shareValue) {
|
|
1022
|
-
state.data.individualData.shareValue = shareValue;
|
|
1022
|
+
state.data.individualData.shareValue = formatNumberAsCurrency(shareValue);
|
|
1023
1023
|
}
|
|
1024
1024
|
var selectedSourceIncome = (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.find(function (source) { var _a; return (source === null || source === void 0 ? void 0 : source.id) === ((_a = source_income === null || source_income === void 0 ? void 0 : source_income[0]) === null || _a === void 0 ? void 0 : _a.id); })) || (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList[0]);
|
|
1025
1025
|
if (!!selectedSourceIncome)
|
|
@@ -87,6 +87,6 @@ var BrandActivities = function (_a) {
|
|
|
87
87
|
var isCustomerBaseListActive = listActive === ListType.CustomerBaseList;
|
|
88
88
|
var isExpectedCustomerListActive = listActive === ListType.ExpectedCustomerList;
|
|
89
89
|
var isExpectedSalesListActive = listActive === ListType.ExpectedSalesList;
|
|
90
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ActivitiesList, { readOnly: readOnly['activities'] || noneEditable['activities'], show: !isCustomerBaseListActive && !isExpectedCustomerListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.ActivitiesList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(CustomerBase, { readOnly: readOnly['customerLocations'] || noneEditable['operations.customer_base_location'], show: !isActivitiesListActive && !isExpectedCustomerListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.CustomerBaseList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ExpectedCustomers, { readOnly: readOnly['expectedCustomer'] || noneEditable['operations.customer_base'], show: !isActivitiesListActive && !isCustomerBaseListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.ExpectedCustomerList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ExpectedSalesRange, { readOnly: readOnly['expectedSale'] || noneEditable['operations.sales_range'], show: !isActivitiesListActive && !isCustomerBaseListActive && !isExpectedCustomerListActive, onListOpen: function () { return handleMenuClick(ListType.ExpectedSalesList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(TAC, {
|
|
90
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ActivitiesList, { readOnly: readOnly['activities'] || noneEditable['activities'], show: !isCustomerBaseListActive && !isExpectedCustomerListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.ActivitiesList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(CustomerBase, { readOnly: readOnly['customerLocations'] || noneEditable['operations.customer_base_location'], show: !isActivitiesListActive && !isExpectedCustomerListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.CustomerBaseList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ExpectedCustomers, { readOnly: readOnly['expectedCustomer'] || noneEditable['operations.customer_base'], show: !isActivitiesListActive && !isCustomerBaseListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.ExpectedCustomerList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ExpectedSalesRange, { readOnly: readOnly['expectedSale'] || noneEditable['operations.sales_range'], show: !isActivitiesListActive && !isCustomerBaseListActive && !isExpectedCustomerListActive, onListOpen: function () { return handleMenuClick(ListType.ExpectedSalesList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(TAC, { readOnly: readOnly['termAndConditionChecked'] || noneEditable['terms'] }), _jsx(RefundPolicy, { readOnly: readOnly['refundPolicy'] || noneEditable['terms'] }), _jsx(TransactionPolicy, { readOnly: readOnly['transactionPolicy'] || noneEditable['terms'] }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') }))] }))] })) })) }));
|
|
91
91
|
};
|
|
92
92
|
export default BrandActivities;
|
|
@@ -76,11 +76,11 @@ var RefundPolicy = function (_a) {
|
|
|
76
76
|
var refundChecked = refundControl.field.value;
|
|
77
77
|
var warningMessage = (_d = refundControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
|
|
78
78
|
var countryCode = settingsData.businessCountry.iso2.toLowerCase();
|
|
79
|
-
var
|
|
79
|
+
var isChecked = React.useMemo(function () {
|
|
80
80
|
var _a, _b;
|
|
81
81
|
return !!((_b = (_a = terms === null || terms === void 0 ? void 0 : terms.find) === null || _a === void 0 ? void 0 : _a.call(terms, function (_a) {
|
|
82
82
|
var term = _a.term;
|
|
83
|
-
return term === '
|
|
83
|
+
return term === 'general';
|
|
84
84
|
})) === null || _b === void 0 ? void 0 : _b.agree);
|
|
85
85
|
}, [terms]);
|
|
86
86
|
var handleRefundCheckedChange = function (event, checked) {
|
|
@@ -88,6 +88,6 @@ var RefundPolicy = function (_a) {
|
|
|
88
88
|
return;
|
|
89
89
|
refundControl.field.onChange(checked);
|
|
90
90
|
};
|
|
91
|
-
return (_jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, {
|
|
91
|
+
return (_jsx(Collapse, __assign({ in: !isChecked }, { children: _jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: refundChecked, onChange: handleRefundCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_refund_policy'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.REFUND_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.REFUND_EN, target: '_blank', underline: 'always' }, { children: t('refund_policy_compliance') }))] })] })), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }) })));
|
|
92
92
|
};
|
|
93
93
|
export default RefundPolicy;
|
|
@@ -12,8 +12,7 @@ export declare const TACContainerStyled: import("@emotion/styled").StyledCompone
|
|
|
12
12
|
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
13
13
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "component" | "ref" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & TACContainerStyledProps, {}, {}>;
|
|
14
14
|
interface TACProps {
|
|
15
|
-
show: boolean;
|
|
16
15
|
readOnly?: boolean;
|
|
17
16
|
}
|
|
18
|
-
declare const _default: React.MemoExoticComponent<({
|
|
17
|
+
declare const _default: React.MemoExoticComponent<({ readOnly }: TACProps) => JSX.Element>;
|
|
19
18
|
export default _default;
|
|
@@ -65,7 +65,7 @@ var CollapseStyled = styled(Collapse)(function () { return ({
|
|
|
65
65
|
}); });
|
|
66
66
|
var TAC = function (_a) {
|
|
67
67
|
var _b, _c, _d;
|
|
68
|
-
var
|
|
68
|
+
var readOnly = _a.readOnly;
|
|
69
69
|
var t = useTranslation().t;
|
|
70
70
|
var isAr = useLanguage().isAr;
|
|
71
71
|
var control = useFormContext().control;
|
|
@@ -76,7 +76,7 @@ var TAC = function (_a) {
|
|
|
76
76
|
var tacChecked = tacControl.field.value;
|
|
77
77
|
var warningMessage = (_d = tacControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
|
|
78
78
|
var countryCode = settingsData.businessCountry.iso2.toLowerCase();
|
|
79
|
-
var
|
|
79
|
+
var isChecked = React.useMemo(function () {
|
|
80
80
|
var _a, _b;
|
|
81
81
|
return !!((_b = (_a = terms === null || terms === void 0 ? void 0 : terms.find) === null || _a === void 0 ? void 0 : _a.call(terms, function (_a) {
|
|
82
82
|
var term = _a.term;
|
|
@@ -88,6 +88,6 @@ var TAC = function (_a) {
|
|
|
88
88
|
return;
|
|
89
89
|
tacControl.field.onChange(checked);
|
|
90
90
|
};
|
|
91
|
-
return (_jsx(Collapse, __assign({ in:
|
|
91
|
+
return (_jsx(Collapse, __assign({ in: !isChecked }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.75 } }, { children: [_jsxs(TACContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] })), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })) })));
|
|
92
92
|
};
|
|
93
93
|
export default React.memo(TAC);
|
|
@@ -39,11 +39,11 @@ var TransactionPolicy = function (_a) {
|
|
|
39
39
|
var transactionChecked = transactionControl.field.value;
|
|
40
40
|
var warningMessage = (_d = transactionControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
|
|
41
41
|
var countryCode = settingsData.businessCountry.iso2.toLowerCase();
|
|
42
|
-
var
|
|
42
|
+
var isChecked = React.useMemo(function () {
|
|
43
43
|
var _a, _b;
|
|
44
44
|
return !!((_b = (_a = terms === null || terms === void 0 ? void 0 : terms.find) === null || _a === void 0 ? void 0 : _a.call(terms, function (_a) {
|
|
45
45
|
var term = _a.term;
|
|
46
|
-
return term === '
|
|
46
|
+
return term === 'general';
|
|
47
47
|
})) === null || _b === void 0 ? void 0 : _b.agree);
|
|
48
48
|
}, [terms]);
|
|
49
49
|
var handleTransactionCheckedChange = function (event, checked) {
|
|
@@ -51,6 +51,6 @@ var TransactionPolicy = function (_a) {
|
|
|
51
51
|
return;
|
|
52
52
|
transactionControl.field.onChange(checked);
|
|
53
53
|
};
|
|
54
|
-
return (_jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, {
|
|
54
|
+
return (_jsx(Collapse, __assign({ in: !isChecked }, { children: _jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: transactionChecked, onChange: handleTransactionCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_chargeback_policy'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TRANSACTION_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TRANSACTION_EN, target: '_blank', underline: 'always' }, { children: t('chargeback_policy') }))] })] })), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }) })));
|
|
55
55
|
};
|
|
56
56
|
export default TransactionPolicy;
|
|
@@ -10,6 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
13
14
|
import Box from '@mui/material/Box';
|
|
14
15
|
import { styled, alpha } from '@mui/material/styles';
|
|
15
16
|
import CheckBox from '../../../../components/CheckBox';
|
|
@@ -21,9 +22,10 @@ import Text from '../../../../components/Text';
|
|
|
21
22
|
import Link from '@mui/material/Link';
|
|
22
23
|
import Warning from '../../../../components/Warning';
|
|
23
24
|
import { EXTERNAL_LINKS, TAP_WEBSITE } from '../../../../constants';
|
|
24
|
-
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
25
|
import { settingsSelector } from '../../../../app/settings';
|
|
26
26
|
import { useAppSelector } from '../../../../hooks';
|
|
27
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
28
|
+
import { businessSelector } from '../../../app/business/businessStore';
|
|
27
29
|
export var ContainerStyled = styled(Box)(function (_a) {
|
|
28
30
|
var theme = _a.theme;
|
|
29
31
|
return ({
|
|
@@ -65,18 +67,27 @@ export var LinkStyled = styled(Link)(function (_a) {
|
|
|
65
67
|
});
|
|
66
68
|
});
|
|
67
69
|
var RefundPolicy = function () {
|
|
68
|
-
var _a;
|
|
70
|
+
var _a, _b, _c;
|
|
69
71
|
var t = useTranslation().t;
|
|
70
72
|
var isAr = useLanguage().isAr;
|
|
71
73
|
var control = useFormContext().control;
|
|
72
74
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
75
|
+
var data = useAppSelector(businessSelector).data;
|
|
76
|
+
var terms = (_b = (_a = data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.brand) === null || _b === void 0 ? void 0 : _b.terms;
|
|
73
77
|
var refundControl = useController({ control: control, name: 'refundPolicy' });
|
|
74
78
|
var refundChecked = refundControl.field.value;
|
|
75
|
-
var warningMessage = (
|
|
79
|
+
var warningMessage = (_c = refundControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
|
|
76
80
|
var countryCode = settingsData.businessCountry.iso2.toLowerCase();
|
|
77
81
|
var handleRefundCheckedChange = function (event, checked) {
|
|
78
82
|
refundControl.field.onChange(checked);
|
|
79
83
|
};
|
|
80
|
-
|
|
84
|
+
var isChecked = React.useMemo(function () {
|
|
85
|
+
var _a, _b;
|
|
86
|
+
return !!((_b = (_a = terms === null || terms === void 0 ? void 0 : terms.find) === null || _a === void 0 ? void 0 : _a.call(terms, function (_a) {
|
|
87
|
+
var term = _a.term;
|
|
88
|
+
return term === 'general';
|
|
89
|
+
})) === null || _b === void 0 ? void 0 : _b.agree);
|
|
90
|
+
}, [terms]);
|
|
91
|
+
return (_jsx(Collapse, __assign({ in: !isChecked }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.75 } }, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: refundChecked, onChange: handleRefundCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_refund_policy'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.REFUND_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.REFUND_EN, target: '_blank', underline: 'always' }, { children: t('refund_policy_compliance') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })) })));
|
|
81
92
|
};
|
|
82
93
|
export default RefundPolicy;
|
|
@@ -10,33 +10,43 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
13
14
|
import { styled } from '@mui/material/styles';
|
|
14
|
-
import Collapse from '../../../../components/Collapse';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
|
-
import { useLanguage } from '../../../../hooks';
|
|
17
16
|
import { useController, useFormContext } from 'react-hook-form';
|
|
18
|
-
import
|
|
17
|
+
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
18
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
19
19
|
import { EXTERNAL_LINKS, TAP_WEBSITE } from '../../../../constants';
|
|
20
|
-
import
|
|
20
|
+
import Collapse from '../../../../components/Collapse';
|
|
21
|
+
import Warning from '../../../../components/Warning';
|
|
21
22
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
23
|
+
import { businessSelector } from '../../../app/business/businessStore';
|
|
24
|
+
import { ContainerStyled, CheckboxStyled, TextStyled, LinkStyled } from './RefundPolicy';
|
|
24
25
|
var CollapseStyled = styled(Collapse)(function () { return ({
|
|
25
26
|
width: '100%'
|
|
26
27
|
}); });
|
|
27
28
|
var TransactionPolicy = function () {
|
|
28
|
-
var _a;
|
|
29
|
+
var _a, _b, _c;
|
|
29
30
|
var t = useTranslation().t;
|
|
30
31
|
var isAr = useLanguage().isAr;
|
|
31
32
|
var control = useFormContext().control;
|
|
32
33
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
34
|
+
var data = useAppSelector(businessSelector).data;
|
|
35
|
+
var terms = (_b = (_a = data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.brand) === null || _b === void 0 ? void 0 : _b.terms;
|
|
33
36
|
var transactionControl = useController({ control: control, name: 'transactionPolicy' });
|
|
34
37
|
var transactionChecked = transactionControl.field.value;
|
|
35
|
-
var warningMessage = (
|
|
38
|
+
var warningMessage = (_c = transactionControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
|
|
36
39
|
var countryCode = settingsData.businessCountry.iso2.toLowerCase();
|
|
37
40
|
var handleTransactionCheckedChange = function (event, checked) {
|
|
38
41
|
transactionControl.field.onChange(checked);
|
|
39
42
|
};
|
|
40
|
-
|
|
43
|
+
var isChecked = React.useMemo(function () {
|
|
44
|
+
var _a, _b;
|
|
45
|
+
return !!((_b = (_a = terms === null || terms === void 0 ? void 0 : terms.find) === null || _a === void 0 ? void 0 : _a.call(terms, function (_a) {
|
|
46
|
+
var term = _a.term;
|
|
47
|
+
return term === 'general';
|
|
48
|
+
})) === null || _b === void 0 ? void 0 : _b.agree);
|
|
49
|
+
}, [terms]);
|
|
50
|
+
return (_jsx(Collapse, __assign({ in: !isChecked }, { children: _jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: transactionChecked, onChange: handleTransactionCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_chargeback_policy'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TRANSACTION_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TRANSACTION_EN, target: '_blank', underline: 'always' }, { children: t('chargeback_policy') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }) })));
|
|
41
51
|
};
|
|
42
52
|
export default TransactionPolicy;
|
|
@@ -16,7 +16,7 @@ import { useController, useFormContext } from 'react-hook-form';
|
|
|
16
16
|
import Collapse from '@mui/material/Collapse';
|
|
17
17
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
18
18
|
import { settingsSelector } from '../../../../app/settings';
|
|
19
|
-
import { findCurrencyByIso2, removeAllCharsFromNumber } from '../../../../utils';
|
|
19
|
+
import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
|
|
20
20
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
21
|
import Input from '../../../shared/Input';
|
|
22
22
|
import { clearError, entitySelector } from '../../../app/entity/entityStore';
|
|
@@ -36,7 +36,7 @@ var CapitalPaid = function (_a) {
|
|
|
36
36
|
var target = _a.target;
|
|
37
37
|
if (error)
|
|
38
38
|
dispatch(clearError());
|
|
39
|
-
var value = removeAllCharsFromNumber(target.value);
|
|
39
|
+
var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
|
|
40
40
|
capitalPaidControl.field.onChange(value);
|
|
41
41
|
};
|
|
42
42
|
var capitalPaidControl = useController({ control: control, name: 'capitalPaid' });
|
|
@@ -18,7 +18,7 @@ import { ScreenContainer } from '../../../shared/Containers';
|
|
|
18
18
|
import Input from '../../../shared/Input';
|
|
19
19
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
20
20
|
import { clearError, entitySelector } from '../../../app/entity/entityStore';
|
|
21
|
-
import { findCurrencyByIso2, removeAllCharsFromNumber } from '../../../../utils';
|
|
21
|
+
import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
|
|
22
22
|
import { settingsSelector } from '../../../../app/settings';
|
|
23
23
|
var CapitalShareValue = function (_a) {
|
|
24
24
|
var _b, _c, _d;
|
|
@@ -37,7 +37,7 @@ var CapitalShareValue = function (_a) {
|
|
|
37
37
|
var target = _a.target;
|
|
38
38
|
if (error)
|
|
39
39
|
dispatch(clearError());
|
|
40
|
-
var value = removeAllCharsFromNumber(target.value);
|
|
40
|
+
var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
|
|
41
41
|
capitalShareValueControl.field.onChange(value);
|
|
42
42
|
};
|
|
43
43
|
var capitalShareValueControl = useController({ control: control, name: 'capitalShareValue' });
|
|
@@ -14,7 +14,7 @@ import * as React from 'react';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
16
|
import Collapse from '@mui/material/Collapse';
|
|
17
|
-
import { findCurrencyByIso2, removeAllCharsFromNumber } from '../../../../utils';
|
|
17
|
+
import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
|
|
18
18
|
import { settingsSelector } from '../../../../app/settings';
|
|
19
19
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
20
20
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -33,7 +33,7 @@ var ShareValue = function (_a) {
|
|
|
33
33
|
var target = _a.target;
|
|
34
34
|
if (bckError)
|
|
35
35
|
dispatch(clearError());
|
|
36
|
-
var value = removeAllCharsFromNumber(target.value);
|
|
36
|
+
var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
|
|
37
37
|
shareValueControl.field.onChange(value);
|
|
38
38
|
};
|
|
39
39
|
var shareValueControl = useController({ control: control, name: 'shareValue' });
|
package/build/utils/string.d.ts
CHANGED
|
@@ -71,3 +71,4 @@ export declare const getUserNameObject: (name: string) => {
|
|
|
71
71
|
export declare const getFileType: (type: string) => "" | "image/jpeg" | "image/png" | "image/jpg" | "application/pdf";
|
|
72
72
|
export declare const isStringHasOneAsterisk: (value: string) => boolean;
|
|
73
73
|
export declare const isOtherLicense: (item?: License) => boolean;
|
|
74
|
+
export declare const formatNumberAsCurrency: (number: string) => string;
|
package/build/utils/string.js
CHANGED
|
@@ -308,3 +308,8 @@ export var isOtherLicense = function (item) {
|
|
|
308
308
|
var number = (_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.number;
|
|
309
309
|
return number === 'other_fl' || number === 'other_cr' || number === 'other_entity';
|
|
310
310
|
};
|
|
311
|
+
export var formatNumberAsCurrency = function (number) {
|
|
312
|
+
if (!number)
|
|
313
|
+
return '';
|
|
314
|
+
return parseInt(number).toLocaleString();
|
|
315
|
+
};
|