@bigbinary/neeto-payments-frontend 6.1.12 → 6.1.14
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/dist/AccountsDashboard.js +308 -333
- package/dist/AccountsDashboard.js.map +1 -1
- package/dist/AdminCancelRecurringPaymentButton.js +43 -54
- package/dist/AdminCancelRecurringPaymentButton.js.map +1 -1
- package/dist/CashPaymentButton.js +32 -34
- package/dist/CashPaymentButton.js.map +1 -1
- package/dist/ConfirmCashPaymentButton.js +77 -71
- package/dist/ConfirmCashPaymentButton.js.map +1 -1
- package/dist/{CopyButtonWrapper-rv-OaINx.js → CopyButtonWrapper-Bp5IVO76.js} +16 -14
- package/dist/CopyButtonWrapper-Bp5IVO76.js.map +1 -0
- package/dist/CustomerCancelRecurringPaymentForm.js +76 -75
- package/dist/CustomerCancelRecurringPaymentForm.js.map +1 -1
- package/dist/ExportModal-CoRuQVas.js +120 -0
- package/dist/ExportModal-CoRuQVas.js.map +1 -0
- package/dist/ManualUpiConnect.js +159 -178
- package/dist/ManualUpiConnect.js.map +1 -1
- package/dist/ManualUpiPayment.js +85 -89
- package/dist/ManualUpiPayment.js.map +1 -1
- package/dist/ManualUpiPaymentConfirmButton.js +119 -115
- package/dist/ManualUpiPaymentConfirmButton.js.map +1 -1
- package/dist/ManualUpiPaymentRejectButton.js +98 -92
- package/dist/ManualUpiPaymentRejectButton.js.map +1 -1
- package/dist/PaymentKindRestrictionAlert.js +14 -19
- package/dist/PaymentKindRestrictionAlert.js.map +1 -1
- package/dist/PaymentsDashboard.js +318 -349
- package/dist/PaymentsDashboard.js.map +1 -1
- package/dist/PayoutsDashboard.js +327 -350
- package/dist/PayoutsDashboard.js.map +1 -1
- package/dist/PayoutsPage.js +114 -92
- package/dist/PayoutsPage.js.map +1 -1
- package/dist/RazorpayConnect.js +71 -62
- package/dist/RazorpayConnect.js.map +1 -1
- package/dist/RazorpayLinkedAccountForm.js +145 -156
- package/dist/RazorpayLinkedAccountForm.js.map +1 -1
- package/dist/RazorpayPaymentButton.js +72 -100
- package/dist/RazorpayPaymentButton.js.map +1 -1
- package/dist/RecurringPaymentSettings.js +85 -85
- package/dist/RecurringPaymentSettings.js.map +1 -1
- package/dist/RefundsDashboard.js +363 -386
- package/dist/RefundsDashboard.js.map +1 -1
- package/dist/SplitTransfersDashboard.js +868 -829
- package/dist/SplitTransfersDashboard.js.map +1 -1
- package/dist/StripeCheckoutSetting.js +63 -75
- package/dist/StripeCheckoutSetting.js.map +1 -1
- package/dist/StripeConnect.js +257 -259
- package/dist/StripeConnect.js.map +1 -1
- package/dist/StripeManage.js +28 -25
- package/dist/StripeManage.js.map +1 -1
- package/dist/TaxesDashboard.js +284 -292
- package/dist/TaxesDashboard.js.map +1 -1
- package/dist/buildStripeTransactionLink.js +1 -1
- package/dist/cjs/AccountsDashboard.js +308 -333
- package/dist/cjs/AccountsDashboard.js.map +1 -1
- package/dist/cjs/AdminCancelRecurringPaymentButton.js +43 -54
- package/dist/cjs/AdminCancelRecurringPaymentButton.js.map +1 -1
- package/dist/cjs/CashPaymentButton.js +32 -34
- package/dist/cjs/CashPaymentButton.js.map +1 -1
- package/dist/cjs/ConfirmCashPaymentButton.js +77 -71
- package/dist/cjs/ConfirmCashPaymentButton.js.map +1 -1
- package/dist/cjs/{CopyButtonWrapper-BkpN0Wmd.js → CopyButtonWrapper-I-kdKiiB.js} +16 -14
- package/dist/cjs/CopyButtonWrapper-I-kdKiiB.js.map +1 -0
- package/dist/cjs/CustomerCancelRecurringPaymentForm.js +76 -75
- package/dist/cjs/CustomerCancelRecurringPaymentForm.js.map +1 -1
- package/dist/cjs/ExportModal-ClKqp-oy.js +122 -0
- package/dist/cjs/ExportModal-ClKqp-oy.js.map +1 -0
- package/dist/cjs/ManualUpiConnect.js +159 -178
- package/dist/cjs/ManualUpiConnect.js.map +1 -1
- package/dist/cjs/ManualUpiPayment.js +85 -89
- package/dist/cjs/ManualUpiPayment.js.map +1 -1
- package/dist/cjs/ManualUpiPaymentConfirmButton.js +118 -114
- package/dist/cjs/ManualUpiPaymentConfirmButton.js.map +1 -1
- package/dist/cjs/ManualUpiPaymentRejectButton.js +98 -92
- package/dist/cjs/ManualUpiPaymentRejectButton.js.map +1 -1
- package/dist/cjs/PaymentKindRestrictionAlert.js +14 -19
- package/dist/cjs/PaymentKindRestrictionAlert.js.map +1 -1
- package/dist/cjs/PaymentsDashboard.js +318 -349
- package/dist/cjs/PaymentsDashboard.js.map +1 -1
- package/dist/cjs/PayoutsDashboard.js +327 -350
- package/dist/cjs/PayoutsDashboard.js.map +1 -1
- package/dist/cjs/PayoutsPage.js +114 -92
- package/dist/cjs/PayoutsPage.js.map +1 -1
- package/dist/cjs/RazorpayConnect.js +71 -62
- package/dist/cjs/RazorpayConnect.js.map +1 -1
- package/dist/cjs/RazorpayLinkedAccountForm.js +145 -156
- package/dist/cjs/RazorpayLinkedAccountForm.js.map +1 -1
- package/dist/cjs/RazorpayPaymentButton.js +72 -100
- package/dist/cjs/RazorpayPaymentButton.js.map +1 -1
- package/dist/cjs/RecurringPaymentSettings.js +85 -85
- package/dist/cjs/RecurringPaymentSettings.js.map +1 -1
- package/dist/cjs/RefundsDashboard.js +363 -386
- package/dist/cjs/RefundsDashboard.js.map +1 -1
- package/dist/cjs/SplitTransfersDashboard.js +867 -828
- package/dist/cjs/SplitTransfersDashboard.js.map +1 -1
- package/dist/cjs/StripeCheckoutSetting.js +63 -75
- package/dist/cjs/StripeCheckoutSetting.js.map +1 -1
- package/dist/cjs/StripeConnect.js +257 -259
- package/dist/cjs/StripeConnect.js.map +1 -1
- package/dist/cjs/StripeManage.js +28 -25
- package/dist/cjs/StripeManage.js.map +1 -1
- package/dist/cjs/TaxesDashboard.js +284 -292
- package/dist/cjs/TaxesDashboard.js.map +1 -1
- package/dist/cjs/buildStripeTransactionLink.js +1 -1
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/dashboard-B1R6fLcS.js +96 -0
- package/dist/cjs/dashboard-B1R6fLcS.js.map +1 -0
- package/dist/cjs/{exportChannel-D1Wls92m.js → exportChannel-BL2RGGhP.js} +16 -18
- package/dist/cjs/{exportChannel-D1Wls92m.js.map → exportChannel-BL2RGGhP.js.map} +1 -1
- package/dist/cjs/getAddressElementOptions.js +1 -1
- package/dist/cjs/getAmountInLargestCurrencyUnit.js +1 -1
- package/dist/cjs/getAmountInSmallestCurrencyUnit.js +1 -1
- package/dist/cjs/getAmountWithAppliedTax.js +1 -1
- package/dist/cjs/getFormattedAmount.js +1 -1
- package/dist/cjs/getFormattedDiscountedAmount.js +1 -1
- package/dist/cjs/getFormattedDiscountedPercentage.js +1 -1
- package/dist/cjs/getFormattedTaxAmount.js +1 -1
- package/dist/cjs/getFormattedTipAmount.js +1 -1
- package/dist/cjs/getQrCodeValue.js +1 -1
- package/dist/cjs/getTaxAmount.js +1 -1
- package/dist/cjs/getTipAmount.js +1 -1
- package/dist/cjs/hasAmountToPay.js +1 -1
- package/dist/cjs/index-C3LUTqjR.js +855 -0
- package/dist/cjs/{index-CZ_VFGNj.js.map → index-C3LUTqjR.js.map} +1 -1
- package/dist/cjs/index.js +14 -20
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/{queryConstants-Cka1X6GX.js → queryConstants-Dc6wh21D.js} +2 -2
- package/dist/cjs/{queryConstants-Cka1X6GX.js.map → queryConstants-Dc6wh21D.js.map} +1 -1
- package/dist/cjs/renderFunctions-ghFUoYiM.js +48 -0
- package/dist/cjs/renderFunctions-ghFUoYiM.js.map +1 -0
- package/dist/cjs/useAccountsApi-Dw9yNiOj.js +42 -0
- package/dist/cjs/useAccountsApi-Dw9yNiOj.js.map +1 -0
- package/dist/cjs/useIntegrationsApi-B8JBENJ0.js +20 -0
- package/dist/cjs/{useIntegrationsApi-BO9PhVVO.js.map → useIntegrationsApi-B8JBENJ0.js.map} +1 -1
- package/dist/cjs/usePaymentApi-C034qyn4.js +29 -0
- package/dist/cjs/usePaymentApi-C034qyn4.js.map +1 -0
- package/dist/cjs/usePaymentApi-Dvv-jkNC.js +44 -0
- package/dist/cjs/usePaymentApi-Dvv-jkNC.js.map +1 -0
- package/dist/cjs/usePaymentApi-HlugiqX9.js +29 -0
- package/dist/cjs/{usePaymentApi-BE8xfY-U.js.map → usePaymentApi-HlugiqX9.js.map} +1 -1
- package/dist/cjs/usePlatformApi-DpOqBsBn.js +55 -0
- package/dist/cjs/{usePlatformApi-C7lXP6ev.js.map → usePlatformApi-DpOqBsBn.js.map} +1 -1
- package/dist/cjs/useRazorpayPayment.js +48 -73
- package/dist/cjs/useRazorpayPayment.js.map +1 -1
- package/dist/cjs/useStripePromise.js +22 -48
- package/dist/cjs/useStripePromise.js.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/dashboard-CKB3Vyop.js +90 -0
- package/dist/dashboard-CKB3Vyop.js.map +1 -0
- package/dist/{exportChannel-DAxJ44QB.js → exportChannel-Db0U5gc1.js} +16 -18
- package/dist/{exportChannel-DAxJ44QB.js.map → exportChannel-Db0U5gc1.js.map} +1 -1
- package/dist/getAddressElementOptions.js +1 -1
- package/dist/getAmountInLargestCurrencyUnit.js +1 -1
- package/dist/getAmountInSmallestCurrencyUnit.js +1 -1
- package/dist/getAmountWithAppliedTax.js +1 -1
- package/dist/getFormattedAmount.js +1 -1
- package/dist/getFormattedDiscountedAmount.js +1 -1
- package/dist/getFormattedDiscountedPercentage.js +1 -1
- package/dist/getFormattedTaxAmount.js +1 -1
- package/dist/getFormattedTipAmount.js +1 -1
- package/dist/getQrCodeValue.js +1 -1
- package/dist/getTaxAmount.js +1 -1
- package/dist/getTipAmount.js +1 -1
- package/dist/hasAmountToPay.js +1 -1
- package/dist/index-BTVToZp9.js +804 -0
- package/dist/{index-C7irWceQ.js.map → index-BTVToZp9.js.map} +1 -1
- package/dist/index.js +14 -20
- package/dist/index.js.map +1 -1
- package/dist/{queryConstants-DFKKEEo0.js → queryConstants-C7AqdemO.js} +2 -2
- package/dist/{queryConstants-DFKKEEo0.js.map → queryConstants-C7AqdemO.js.map} +1 -1
- package/dist/renderFunctions-BB3hiqhN.js +44 -0
- package/dist/renderFunctions-BB3hiqhN.js.map +1 -0
- package/dist/useAccountsApi-C4KOwjWh.js +38 -0
- package/dist/useAccountsApi-C4KOwjWh.js.map +1 -0
- package/dist/useIntegrationsApi-CDqBFq32.js +18 -0
- package/dist/{useIntegrationsApi-D1bkKtoy.js.map → useIntegrationsApi-CDqBFq32.js.map} +1 -1
- package/dist/usePaymentApi-B3dzQqWN.js +26 -0
- package/dist/usePaymentApi-B3dzQqWN.js.map +1 -0
- package/dist/usePaymentApi-DG2ApS6s.js +41 -0
- package/dist/usePaymentApi-DG2ApS6s.js.map +1 -0
- package/dist/usePaymentApi-_dPcALic.js +27 -0
- package/dist/{usePaymentApi-DcMNbOMk.js.map → usePaymentApi-_dPcALic.js.map} +1 -1
- package/dist/usePlatformApi-DBLpH3rH.js +50 -0
- package/dist/{usePlatformApi-Di7Dg-Gn.js.map → usePlatformApi-DBLpH3rH.js.map} +1 -1
- package/dist/useRazorpayPayment.js +48 -73
- package/dist/useRazorpayPayment.js.map +1 -1
- package/dist/useStripePromise.js +22 -48
- package/dist/useStripePromise.js.map +1 -1
- package/package.json +12 -11
- package/dist/CopyButtonWrapper-rv-OaINx.js.map +0 -1
- package/dist/ExportModal-CxKyrlwf.js +0 -120
- package/dist/ExportModal-CxKyrlwf.js.map +0 -1
- package/dist/cjs/CopyButtonWrapper-BkpN0Wmd.js.map +0 -1
- package/dist/cjs/ExportModal-DxCzPCh0.js +0 -122
- package/dist/cjs/ExportModal-DxCzPCh0.js.map +0 -1
- package/dist/cjs/dashboard-DKHencVn.js +0 -110
- package/dist/cjs/dashboard-DKHencVn.js.map +0 -1
- package/dist/cjs/index-CZ_VFGNj.js +0 -899
- package/dist/cjs/renderFunctions-CX_K4qf8.js +0 -51
- package/dist/cjs/renderFunctions-CX_K4qf8.js.map +0 -1
- package/dist/cjs/useAccountsApi-DC617yB4.js +0 -62
- package/dist/cjs/useAccountsApi-DC617yB4.js.map +0 -1
- package/dist/cjs/useIntegrationsApi-BO9PhVVO.js +0 -26
- package/dist/cjs/usePaymentApi-BE8xfY-U.js +0 -39
- package/dist/cjs/usePaymentApi-C9aQhuda.js +0 -56
- package/dist/cjs/usePaymentApi-C9aQhuda.js.map +0 -1
- package/dist/cjs/usePaymentApi-CrKom4eT.js +0 -41
- package/dist/cjs/usePaymentApi-CrKom4eT.js.map +0 -1
- package/dist/cjs/usePlatformApi-C7lXP6ev.js +0 -84
- package/dist/dashboard-ClEN2ygs.js +0 -104
- package/dist/dashboard-ClEN2ygs.js.map +0 -1
- package/dist/index-C7irWceQ.js +0 -848
- package/dist/renderFunctions-D9sAy3V_.js +0 -47
- package/dist/renderFunctions-D9sAy3V_.js.map +0 -1
- package/dist/useAccountsApi-DPem_UA-.js +0 -58
- package/dist/useAccountsApi-DPem_UA-.js.map +0 -1
- package/dist/useIntegrationsApi-D1bkKtoy.js +0 -24
- package/dist/usePaymentApi-BV0jXF-6.js +0 -38
- package/dist/usePaymentApi-BV0jXF-6.js.map +0 -1
- package/dist/usePaymentApi-DHARy-kC.js +0 -53
- package/dist/usePaymentApi-DHARy-kC.js.map +0 -1
- package/dist/usePaymentApi-DcMNbOMk.js +0 -37
- package/dist/usePlatformApi-Di7Dg-Gn.js +0 -79
package/dist/RazorpayConnect.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
1
|
import { useState, useEffect } from 'react';
|
|
3
2
|
import { useQueryClient } from '@tanstack/react-query';
|
|
4
3
|
import { isNotPresent, humanize, isPresent } from 'neetocist';
|
|
@@ -10,10 +9,10 @@ import Header from '@bigbinary/neeto-molecules/Header';
|
|
|
10
9
|
import { Button, Callout, Spinner, Typography } from '@bigbinary/neetoui';
|
|
11
10
|
import { useTranslation } from 'react-i18next';
|
|
12
11
|
import { useHistory } from 'react-router-dom';
|
|
13
|
-
import { u as useFetchPaymentIntegrations } from './useIntegrationsApi-
|
|
14
|
-
import { Q as QUERY_KEYS } from './queryConstants-
|
|
15
|
-
import { E as ERROR_TYPE, M as MAX_POLLING_TIME, t as POLLING_INTERVAL } from './index-
|
|
16
|
-
import '
|
|
12
|
+
import { u as useFetchPaymentIntegrations } from './useIntegrationsApi-CDqBFq32.js';
|
|
13
|
+
import { Q as QUERY_KEYS } from './queryConstants-C7AqdemO.js';
|
|
14
|
+
import { E as ERROR_TYPE, M as MAX_POLLING_TIME, t as POLLING_INTERVAL } from './index-BTVToZp9.js';
|
|
15
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
17
16
|
import 'axios';
|
|
18
17
|
import 'i18next';
|
|
19
18
|
import 'neetocommons/constants';
|
|
@@ -21,85 +20,95 @@ import 'decimal.js';
|
|
|
21
20
|
import 'neetocommons/utils';
|
|
22
21
|
import 'ramda';
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (!
|
|
23
|
+
const RazorpayConnect = ({
|
|
24
|
+
baseRoute,
|
|
25
|
+
manageRoute,
|
|
26
|
+
breadcrumbs
|
|
27
|
+
}) => {
|
|
28
|
+
const queryClient = useQueryClient();
|
|
29
|
+
const [isPolling, setIsPolling] = useState(false);
|
|
30
|
+
const {
|
|
31
|
+
t
|
|
32
|
+
} = useTranslation();
|
|
33
|
+
const history = useHistory();
|
|
34
|
+
const {
|
|
35
|
+
error,
|
|
36
|
+
errorDescription = ""
|
|
37
|
+
} = useQueryParams();
|
|
38
|
+
const refetchInterval = query => {
|
|
39
|
+
const {
|
|
40
|
+
razorpayAccount
|
|
41
|
+
} = query.state.data || {};
|
|
42
|
+
if (!razorpayAccount?.isConnected && isPolling) {
|
|
44
43
|
return POLLING_INTERVAL;
|
|
45
44
|
}
|
|
46
|
-
if (razorpayAccount
|
|
45
|
+
if (razorpayAccount?.isConnected) {
|
|
47
46
|
setIsPolling(false);
|
|
48
47
|
history.push(manageRoute);
|
|
49
48
|
}
|
|
50
49
|
return false;
|
|
51
50
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
const {
|
|
52
|
+
data: {
|
|
53
|
+
razorpayAccount
|
|
54
|
+
} = {}
|
|
55
|
+
} = useFetchPaymentIntegrations({
|
|
56
|
+
refetchInterval,
|
|
57
|
+
enabled: isNotPresent(error)
|
|
58
|
+
});
|
|
59
|
+
const errorMessage = error === ERROR_TYPE.processing_error ? errorDescription : humanize(errorDescription);
|
|
60
|
+
const isAccountProcessingFailed = isPresent(error) && isPresent(errorDescription) || !isPolling && !razorpayAccount?.isConnected;
|
|
61
|
+
const handleRetry = () => {
|
|
62
62
|
queryClient.invalidateQueries({
|
|
63
63
|
queryKey: [QUERY_KEYS.PAYMENT_INTEGRATION_LIST]
|
|
64
64
|
});
|
|
65
65
|
history.push(baseRoute);
|
|
66
66
|
};
|
|
67
|
-
useEffect(
|
|
68
|
-
if (razorpayAccount
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (razorpayAccount?.isConnected) {
|
|
69
69
|
history.push(manageRoute);
|
|
70
70
|
}
|
|
71
71
|
if (isNotPresent(error)) {
|
|
72
72
|
setIsPolling(true);
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
const pollingTimeoutId = setTimeout(() => {
|
|
75
75
|
setIsPolling(false);
|
|
76
76
|
}, MAX_POLLING_TIME);
|
|
77
|
-
return
|
|
77
|
+
return () => {
|
|
78
78
|
clearTimeout(pollingTimeoutId);
|
|
79
79
|
};
|
|
80
80
|
}, []);
|
|
81
|
-
return /*#__PURE__*/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
81
|
+
return /*#__PURE__*/jsxs(Container, {
|
|
82
|
+
children: [/*#__PURE__*/jsx(Header, {
|
|
83
|
+
breadcrumbs,
|
|
84
|
+
title: t("neetoPayments.common.connect")
|
|
85
|
+
}), /*#__PURE__*/jsxs(CardLayout, {
|
|
86
|
+
icon: /*#__PURE__*/jsx(Razorpay, {
|
|
87
|
+
size: 48
|
|
88
|
+
}),
|
|
89
|
+
title: t("neetoPayments.razorpayConnect.title"),
|
|
90
|
+
actionBlock: isAccountProcessingFailed && /*#__PURE__*/jsx(Button, {
|
|
91
|
+
label: t("neetoPayments.common.tryAgain"),
|
|
92
|
+
onClick: handleRetry
|
|
93
|
+
}),
|
|
94
|
+
description: isAccountProcessingFailed && t("neetoPayments.common.processingFailed"),
|
|
95
|
+
children: [isPolling && /*#__PURE__*/jsx(Callout, {
|
|
96
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
97
|
+
className: "flex space-x-4",
|
|
98
|
+
children: [/*#__PURE__*/jsx(Spinner, {}), /*#__PURE__*/jsx(Typography, {
|
|
99
|
+
style: "body1",
|
|
100
|
+
children: t("neetoPayments.stripeConnect.verifyingMessage")
|
|
101
|
+
})]
|
|
102
|
+
})
|
|
103
|
+
}), isAccountProcessingFailed && /*#__PURE__*/jsx(Callout, {
|
|
104
|
+
style: "danger",
|
|
105
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
106
|
+
style: "body1",
|
|
107
|
+
children: isPresent(errorDescription) ? errorMessage : t("neetoPayments.stripeConnect.failedProcessing")
|
|
108
|
+
})
|
|
109
|
+
})]
|
|
110
|
+
})]
|
|
111
|
+
});
|
|
103
112
|
};
|
|
104
113
|
|
|
105
114
|
export { RazorpayConnect as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RazorpayConnect.js","sources":["../app/javascript/src/components/RazorpayConnect.jsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\n\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { isPresent, humanize, isNotPresent } from \"neetocist\";\nimport { useQueryParams } from \"neetocommons/react-utils\";\nimport { Razorpay as RazorpayIcon } from \"neetoicons/misc\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport Container from \"neetomolecules/Container\";\nimport Header from \"neetomolecules/Header\";\nimport { Typography, Callout, Spinner, Button } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport { useFetchPaymentIntegrations } from \"hooks/reactQuery/useIntegrationsApi\";\nimport { QUERY_KEYS } from \"src/common/queryConstants\";\nimport { ERROR_TYPE, POLLING_INTERVAL, MAX_POLLING_TIME } from \"src/constants\";\n\nconst RazorpayConnect = ({ baseRoute, manageRoute, breadcrumbs }) => {\n const queryClient = useQueryClient();\n const [isPolling, setIsPolling] = useState(false);\n const { t } = useTranslation();\n const history = useHistory();\n const { error, errorDescription = \"\" } = useQueryParams();\n\n const refetchInterval = query => {\n const { razorpayAccount } = query.state.data || {};\n\n if (!razorpayAccount?.isConnected && isPolling) {\n return POLLING_INTERVAL;\n }\n\n if (razorpayAccount?.isConnected) {\n setIsPolling(false);\n history.push(manageRoute);\n }\n\n return false;\n };\n\n const { data: { razorpayAccount } = {} } = useFetchPaymentIntegrations({\n refetchInterval,\n enabled: isNotPresent(error),\n });\n\n const errorMessage =\n error === ERROR_TYPE.processing_error\n ? errorDescription\n : humanize(errorDescription);\n\n const isAccountProcessingFailed =\n (isPresent(error) && isPresent(errorDescription)) ||\n (!isPolling && !razorpayAccount?.isConnected);\n\n const handleRetry = () => {\n queryClient.invalidateQueries({\n queryKey: [QUERY_KEYS.PAYMENT_INTEGRATION_LIST],\n });\n history.push(baseRoute);\n };\n\n useEffect(() => {\n if (razorpayAccount?.isConnected) {\n history.push(manageRoute);\n }\n\n if (isNotPresent(error)) {\n setIsPolling(true);\n }\n\n const pollingTimeoutId = setTimeout(() => {\n setIsPolling(false);\n }, MAX_POLLING_TIME);\n\n return () => {\n clearTimeout(pollingTimeoutId);\n };\n }, []);\n\n return (\n <Container>\n <Header {...{ breadcrumbs }} title={t(\"neetoPayments.common.connect\")} />\n <CardLayout\n icon={<RazorpayIcon size={48} />}\n title={t(\"neetoPayments.razorpayConnect.title\")}\n actionBlock={\n isAccountProcessingFailed && (\n <Button\n label={t(\"neetoPayments.common.tryAgain\")}\n onClick={handleRetry}\n />\n )\n }\n description={\n isAccountProcessingFailed &&\n t(\"neetoPayments.common.processingFailed\")\n }\n >\n {isPolling && (\n <Callout>\n <div className=\"flex space-x-4\">\n <Spinner />\n <Typography style=\"body1\">\n {t(\"neetoPayments.stripeConnect.verifyingMessage\")}\n </Typography>\n </div>\n </Callout>\n )}\n {isAccountProcessingFailed && (\n <Callout style=\"danger\">\n <Typography style=\"body1\">\n {isPresent(errorDescription)\n ? errorMessage\n : t(\"neetoPayments.stripeConnect.failedProcessing\")}\n </Typography>\n </Callout>\n )}\n </CardLayout>\n </Container>\n );\n};\n\nexport default RazorpayConnect;\n"],"names":["RazorpayConnect","
|
|
1
|
+
{"version":3,"file":"RazorpayConnect.js","sources":["../app/javascript/src/components/RazorpayConnect.jsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\n\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { isPresent, humanize, isNotPresent } from \"neetocist\";\nimport { useQueryParams } from \"neetocommons/react-utils\";\nimport { Razorpay as RazorpayIcon } from \"neetoicons/misc\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport Container from \"neetomolecules/Container\";\nimport Header from \"neetomolecules/Header\";\nimport { Typography, Callout, Spinner, Button } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport { useFetchPaymentIntegrations } from \"hooks/reactQuery/useIntegrationsApi\";\nimport { QUERY_KEYS } from \"src/common/queryConstants\";\nimport { ERROR_TYPE, POLLING_INTERVAL, MAX_POLLING_TIME } from \"src/constants\";\n\nconst RazorpayConnect = ({ baseRoute, manageRoute, breadcrumbs }) => {\n const queryClient = useQueryClient();\n const [isPolling, setIsPolling] = useState(false);\n const { t } = useTranslation();\n const history = useHistory();\n const { error, errorDescription = \"\" } = useQueryParams();\n\n const refetchInterval = query => {\n const { razorpayAccount } = query.state.data || {};\n\n if (!razorpayAccount?.isConnected && isPolling) {\n return POLLING_INTERVAL;\n }\n\n if (razorpayAccount?.isConnected) {\n setIsPolling(false);\n history.push(manageRoute);\n }\n\n return false;\n };\n\n const { data: { razorpayAccount } = {} } = useFetchPaymentIntegrations({\n refetchInterval,\n enabled: isNotPresent(error),\n });\n\n const errorMessage =\n error === ERROR_TYPE.processing_error\n ? errorDescription\n : humanize(errorDescription);\n\n const isAccountProcessingFailed =\n (isPresent(error) && isPresent(errorDescription)) ||\n (!isPolling && !razorpayAccount?.isConnected);\n\n const handleRetry = () => {\n queryClient.invalidateQueries({\n queryKey: [QUERY_KEYS.PAYMENT_INTEGRATION_LIST],\n });\n history.push(baseRoute);\n };\n\n useEffect(() => {\n if (razorpayAccount?.isConnected) {\n history.push(manageRoute);\n }\n\n if (isNotPresent(error)) {\n setIsPolling(true);\n }\n\n const pollingTimeoutId = setTimeout(() => {\n setIsPolling(false);\n }, MAX_POLLING_TIME);\n\n return () => {\n clearTimeout(pollingTimeoutId);\n };\n }, []);\n\n return (\n <Container>\n <Header {...{ breadcrumbs }} title={t(\"neetoPayments.common.connect\")} />\n <CardLayout\n icon={<RazorpayIcon size={48} />}\n title={t(\"neetoPayments.razorpayConnect.title\")}\n actionBlock={\n isAccountProcessingFailed && (\n <Button\n label={t(\"neetoPayments.common.tryAgain\")}\n onClick={handleRetry}\n />\n )\n }\n description={\n isAccountProcessingFailed &&\n t(\"neetoPayments.common.processingFailed\")\n }\n >\n {isPolling && (\n <Callout>\n <div className=\"flex space-x-4\">\n <Spinner />\n <Typography style=\"body1\">\n {t(\"neetoPayments.stripeConnect.verifyingMessage\")}\n </Typography>\n </div>\n </Callout>\n )}\n {isAccountProcessingFailed && (\n <Callout style=\"danger\">\n <Typography style=\"body1\">\n {isPresent(errorDescription)\n ? errorMessage\n : t(\"neetoPayments.stripeConnect.failedProcessing\")}\n </Typography>\n </Callout>\n )}\n </CardLayout>\n </Container>\n );\n};\n\nexport default RazorpayConnect;\n"],"names":["RazorpayConnect","baseRoute","manageRoute","breadcrumbs","queryClient","useQueryClient","isPolling","setIsPolling","useState","t","useTranslation","history","useHistory","error","errorDescription","useQueryParams","refetchInterval","query","razorpayAccount","state","data","isConnected","POLLING_INTERVAL","push","useFetchPaymentIntegrations","enabled","isNotPresent","errorMessage","ERROR_TYPE","processing_error","humanize","isAccountProcessingFailed","isPresent","handleRetry","invalidateQueries","queryKey","QUERY_KEYS","PAYMENT_INTEGRATION_LIST","useEffect","pollingTimeoutId","setTimeout","MAX_POLLING_TIME","clearTimeout","_jsxs","Container","children","_jsx","Header","title","CardLayout","icon","RazorpayIcon","size","actionBlock","Button","label","onClick","description","Callout","className","Spinner","Typography","style"],"mappings":"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"}
|
|
@@ -6,44 +6,37 @@ import { useTranslation } from 'react-i18next';
|
|
|
6
6
|
import { useHistory } from 'react-router-dom';
|
|
7
7
|
import { useQuery } from '@tanstack/react-query';
|
|
8
8
|
import axios from 'axios';
|
|
9
|
-
import { B as BASE_URL } from './index-
|
|
10
|
-
import { Q as QUERY_KEYS } from './queryConstants-
|
|
9
|
+
import { B as BASE_URL } from './index-BTVToZp9.js';
|
|
10
|
+
import { Q as QUERY_KEYS } from './queryConstants-C7AqdemO.js';
|
|
11
11
|
import { humanize } from 'neetocist';
|
|
12
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
13
|
import 'i18next';
|
|
13
14
|
import 'neetocommons/constants';
|
|
14
15
|
import 'decimal.js';
|
|
15
16
|
import 'neetocommons/utils';
|
|
16
17
|
import 'ramda';
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
var businessCategoriesApi = {
|
|
19
|
+
const list$1 = () => axios.get(`${BASE_URL}/api/v1/razorpay/business_categories`);
|
|
20
|
+
const businessCategoriesApi = {
|
|
22
21
|
list: list$1
|
|
23
22
|
};
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
};
|
|
24
|
+
const useFetchBusinessCategories = () => useQuery({
|
|
25
|
+
queryKey: [QUERY_KEYS.BUSINESS_CATEGORIES_LIST],
|
|
26
|
+
queryFn: businessCategoriesApi.list
|
|
27
|
+
});
|
|
31
28
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var businessTypesApi = {
|
|
36
|
-
list: list
|
|
29
|
+
const list = () => axios.get(`${BASE_URL}/api/v1/razorpay/business_types`);
|
|
30
|
+
const businessTypesApi = {
|
|
31
|
+
list
|
|
37
32
|
};
|
|
38
33
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
});
|
|
44
|
-
};
|
|
34
|
+
const useFetchBusinessTypes = () => useQuery({
|
|
35
|
+
queryKey: [QUERY_KEYS.BUSINESS_TYPES_LIST],
|
|
36
|
+
queryFn: businessTypesApi.list
|
|
37
|
+
});
|
|
45
38
|
|
|
46
|
-
|
|
39
|
+
const INITIAL_VALUES = {
|
|
47
40
|
email: "",
|
|
48
41
|
phone_number: "",
|
|
49
42
|
legal_business_name: "",
|
|
@@ -56,73 +49,66 @@ var INITIAL_VALUES = {
|
|
|
56
49
|
}
|
|
57
50
|
};
|
|
58
51
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
};
|
|
83
|
-
var getBusinessTypesOptions = function getBusinessTypesOptions(businessTypes) {
|
|
84
|
-
return businessTypes === null || businessTypes === void 0 ? void 0 : businessTypes.map(function (_ref4) {
|
|
85
|
-
var id = _ref4.id,
|
|
86
|
-
name = _ref4.name;
|
|
87
|
-
return {
|
|
88
|
-
label: humanize(name),
|
|
89
|
-
value: id
|
|
90
|
-
};
|
|
91
|
-
});
|
|
92
|
-
};
|
|
52
|
+
const getBusinessCategoriesOptions = businessCategories => businessCategories?.map(({
|
|
53
|
+
id,
|
|
54
|
+
name
|
|
55
|
+
}) => ({
|
|
56
|
+
label: humanize(name),
|
|
57
|
+
value: id
|
|
58
|
+
}));
|
|
59
|
+
const getBusinessSubcategoriesOptions = (businessCategories, category) => businessCategories?.find(({
|
|
60
|
+
id
|
|
61
|
+
}) => id === category)?.subcategories?.map(({
|
|
62
|
+
id,
|
|
63
|
+
name
|
|
64
|
+
}) => ({
|
|
65
|
+
label: humanize(name),
|
|
66
|
+
value: id
|
|
67
|
+
}));
|
|
68
|
+
const getBusinessTypesOptions = businessTypes => businessTypes?.map(({
|
|
69
|
+
id,
|
|
70
|
+
name
|
|
71
|
+
}) => ({
|
|
72
|
+
label: humanize(name),
|
|
73
|
+
value: id
|
|
74
|
+
}));
|
|
93
75
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
t
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
76
|
+
const RazorpayLinkedAccountForm = () => {
|
|
77
|
+
const {
|
|
78
|
+
t
|
|
79
|
+
} = useTranslation();
|
|
80
|
+
const history = useHistory();
|
|
81
|
+
const {
|
|
82
|
+
isLoading: isBusinessTypesLoading,
|
|
83
|
+
data: {
|
|
84
|
+
businessTypes
|
|
85
|
+
} = {}
|
|
86
|
+
} = useFetchBusinessTypes();
|
|
87
|
+
const {
|
|
88
|
+
isLoading,
|
|
89
|
+
data: {
|
|
90
|
+
businessCategories
|
|
91
|
+
} = {}
|
|
92
|
+
} = useFetchBusinessCategories();
|
|
108
93
|
if (isLoading || isBusinessTypesLoading) {
|
|
109
|
-
return /*#__PURE__*/
|
|
110
|
-
className: "flex items-center justify-center w-full h-full"
|
|
111
|
-
|
|
94
|
+
return /*#__PURE__*/jsx("div", {
|
|
95
|
+
className: "flex items-center justify-center w-full h-full",
|
|
96
|
+
children: /*#__PURE__*/jsx(Spinner, {})
|
|
97
|
+
});
|
|
112
98
|
}
|
|
113
|
-
return /*#__PURE__*/
|
|
99
|
+
return /*#__PURE__*/jsx(Form, {
|
|
114
100
|
className: "w-full",
|
|
115
101
|
formikProps: {
|
|
116
102
|
initialValues: INITIAL_VALUES,
|
|
117
|
-
onSubmit:
|
|
103
|
+
onSubmit: () => {}
|
|
118
104
|
// validationSchema: VALIDATION_SCHEMA,
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
dirty
|
|
123
|
-
setFieldValue
|
|
124
|
-
|
|
125
|
-
actionBlock: /*#__PURE__*/
|
|
105
|
+
},
|
|
106
|
+
children: ({
|
|
107
|
+
values,
|
|
108
|
+
dirty,
|
|
109
|
+
setFieldValue
|
|
110
|
+
}) => /*#__PURE__*/jsx(CardLayout, {
|
|
111
|
+
actionBlock: /*#__PURE__*/jsx(ActionBlock, {
|
|
126
112
|
cancelButtonProps: {
|
|
127
113
|
onClick: history.goBack
|
|
128
114
|
}
|
|
@@ -132,79 +118,82 @@ var RazorpayLinkedAccountForm = function RazorpayLinkedAccountForm() {
|
|
|
132
118
|
label: t("neetoPayments.common.submit"),
|
|
133
119
|
disabled: !dirty
|
|
134
120
|
}
|
|
121
|
+
}),
|
|
122
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
123
|
+
className: "flex flex-col space-y-4",
|
|
124
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
125
|
+
required: true,
|
|
126
|
+
className: "w-full",
|
|
127
|
+
label: t("neetoPayments.linkedAccount.form.labels.email"),
|
|
128
|
+
name: "email",
|
|
129
|
+
placeholder: t("neetoPayments.linkedAccount.form.placeholders.email")
|
|
130
|
+
}), /*#__PURE__*/jsx(PhoneNumberInput, {
|
|
131
|
+
required: true,
|
|
132
|
+
showEmoji: true,
|
|
133
|
+
className: "w-full",
|
|
134
|
+
label: t("neetoPayments.linkedAccount.form.labels.phoneNumber"),
|
|
135
|
+
name: "phone_number",
|
|
136
|
+
placeholder: t("neetoPayments.linkedAccount.form.placeholders.phoneNumber")
|
|
137
|
+
}), /*#__PURE__*/jsx(Input, {
|
|
138
|
+
required: true,
|
|
139
|
+
className: "w-full",
|
|
140
|
+
label: t("neetoPayments.linkedAccount.form.labels.businessName"),
|
|
141
|
+
name: "legal_business_name",
|
|
142
|
+
placeholder: t("neetoPayments.linkedAccount.form.placeholders.businessName")
|
|
143
|
+
}), /*#__PURE__*/jsx(Select, {
|
|
144
|
+
required: true,
|
|
145
|
+
className: "w-full",
|
|
146
|
+
label: t("neetoPayments.linkedAccount.form.labels.businessType"),
|
|
147
|
+
name: "business_type",
|
|
148
|
+
options: getBusinessTypesOptions(businessTypes),
|
|
149
|
+
placeholder: t("neetoPayments.linkedAccount.form.placeholders.businessType"),
|
|
150
|
+
onChange: ({
|
|
151
|
+
value
|
|
152
|
+
}) => setFieldValue("business_type", value)
|
|
153
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
154
|
+
className: "flex space-x-4",
|
|
155
|
+
children: [/*#__PURE__*/jsx(Select, {
|
|
156
|
+
required: true,
|
|
157
|
+
className: "w-full",
|
|
158
|
+
label: t("neetoPayments.linkedAccount.form.labels.category"),
|
|
159
|
+
name: "category",
|
|
160
|
+
options: getBusinessCategoriesOptions(businessCategories),
|
|
161
|
+
placeholder: t("neetoPayments.linkedAccount.form.placeholders.category"),
|
|
162
|
+
onChange: ({
|
|
163
|
+
value
|
|
164
|
+
}) => setFieldValue("category", value)
|
|
165
|
+
}), /*#__PURE__*/jsx(Select, {
|
|
166
|
+
required: true,
|
|
167
|
+
className: "w-full",
|
|
168
|
+
disabled: !values.category,
|
|
169
|
+
label: t("neetoPayments.linkedAccount.form.labels.subcategory"),
|
|
170
|
+
name: "subcategory",
|
|
171
|
+
options: getBusinessSubcategoriesOptions(businessCategories, values.category),
|
|
172
|
+
placeholder: t("neetoPayments.linkedAccount.form.placeholders.subcategory"),
|
|
173
|
+
onChange: ({
|
|
174
|
+
value
|
|
175
|
+
}) => setFieldValue("subcategory", value)
|
|
176
|
+
})]
|
|
177
|
+
}), /*#__PURE__*/jsx(Label, {
|
|
178
|
+
children: t("neetoPayments.linkedAccount.form.labels.businessLegalInfo")
|
|
179
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
180
|
+
className: "flex space-x-4",
|
|
181
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
182
|
+
required: true,
|
|
183
|
+
className: "w-full",
|
|
184
|
+
label: t("neetoPayments.linkedAccount.form.labels.pan"),
|
|
185
|
+
name: "business_legal_info.pan",
|
|
186
|
+
placeholder: t("neetoPayments.linkedAccount.form.placeholders.pan")
|
|
187
|
+
}), /*#__PURE__*/jsx(Input, {
|
|
188
|
+
required: true,
|
|
189
|
+
className: "w-full",
|
|
190
|
+
label: t("neetoPayments.linkedAccount.form.labels.gst"),
|
|
191
|
+
name: "business_legal_info.gst",
|
|
192
|
+
placeholder: t("neetoPayments.linkedAccount.form.placeholders.gst")
|
|
193
|
+
})]
|
|
194
|
+
})]
|
|
135
195
|
})
|
|
136
|
-
}
|
|
137
|
-
className: "flex flex-col space-y-4"
|
|
138
|
-
}, /*#__PURE__*/React.createElement(Input, {
|
|
139
|
-
required: true,
|
|
140
|
-
className: "w-full",
|
|
141
|
-
label: t("neetoPayments.linkedAccount.form.labels.email"),
|
|
142
|
-
name: "email",
|
|
143
|
-
placeholder: t("neetoPayments.linkedAccount.form.placeholders.email")
|
|
144
|
-
}), /*#__PURE__*/React.createElement(PhoneNumberInput, {
|
|
145
|
-
required: true,
|
|
146
|
-
showEmoji: true,
|
|
147
|
-
className: "w-full",
|
|
148
|
-
label: t("neetoPayments.linkedAccount.form.labels.phoneNumber"),
|
|
149
|
-
name: "phone_number",
|
|
150
|
-
placeholder: t("neetoPayments.linkedAccount.form.placeholders.phoneNumber")
|
|
151
|
-
}), /*#__PURE__*/React.createElement(Input, {
|
|
152
|
-
required: true,
|
|
153
|
-
className: "w-full",
|
|
154
|
-
label: t("neetoPayments.linkedAccount.form.labels.businessName"),
|
|
155
|
-
name: "legal_business_name",
|
|
156
|
-
placeholder: t("neetoPayments.linkedAccount.form.placeholders.businessName")
|
|
157
|
-
}), /*#__PURE__*/React.createElement(Select, {
|
|
158
|
-
required: true,
|
|
159
|
-
className: "w-full",
|
|
160
|
-
label: t("neetoPayments.linkedAccount.form.labels.businessType"),
|
|
161
|
-
name: "business_type",
|
|
162
|
-
options: getBusinessTypesOptions(businessTypes),
|
|
163
|
-
placeholder: t("neetoPayments.linkedAccount.form.placeholders.businessType"),
|
|
164
|
-
onChange: function onChange(_ref2) {
|
|
165
|
-
var value = _ref2.value;
|
|
166
|
-
return setFieldValue("business_type", value);
|
|
167
|
-
}
|
|
168
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
169
|
-
className: "flex space-x-4"
|
|
170
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
171
|
-
required: true,
|
|
172
|
-
className: "w-full",
|
|
173
|
-
label: t("neetoPayments.linkedAccount.form.labels.category"),
|
|
174
|
-
name: "category",
|
|
175
|
-
options: getBusinessCategoriesOptions(businessCategories),
|
|
176
|
-
placeholder: t("neetoPayments.linkedAccount.form.placeholders.category"),
|
|
177
|
-
onChange: function onChange(_ref3) {
|
|
178
|
-
var value = _ref3.value;
|
|
179
|
-
return setFieldValue("category", value);
|
|
180
|
-
}
|
|
181
|
-
}), /*#__PURE__*/React.createElement(Select, {
|
|
182
|
-
required: true,
|
|
183
|
-
className: "w-full",
|
|
184
|
-
disabled: !values.category,
|
|
185
|
-
label: t("neetoPayments.linkedAccount.form.labels.subcategory"),
|
|
186
|
-
name: "subcategory",
|
|
187
|
-
options: getBusinessSubcategoriesOptions(businessCategories, values.category),
|
|
188
|
-
placeholder: t("neetoPayments.linkedAccount.form.placeholders.subcategory"),
|
|
189
|
-
onChange: function onChange(_ref4) {
|
|
190
|
-
var value = _ref4.value;
|
|
191
|
-
return setFieldValue("subcategory", value);
|
|
192
|
-
}
|
|
193
|
-
})), /*#__PURE__*/React.createElement(Label, null, t("neetoPayments.linkedAccount.form.labels.businessLegalInfo")), /*#__PURE__*/React.createElement("div", {
|
|
194
|
-
className: "flex space-x-4"
|
|
195
|
-
}, /*#__PURE__*/React.createElement(Input, {
|
|
196
|
-
required: true,
|
|
197
|
-
className: "w-full",
|
|
198
|
-
label: t("neetoPayments.linkedAccount.form.labels.pan"),
|
|
199
|
-
name: "business_legal_info.pan",
|
|
200
|
-
placeholder: t("neetoPayments.linkedAccount.form.placeholders.pan")
|
|
201
|
-
}), /*#__PURE__*/React.createElement(Input, {
|
|
202
|
-
required: true,
|
|
203
|
-
className: "w-full",
|
|
204
|
-
label: t("neetoPayments.linkedAccount.form.labels.gst"),
|
|
205
|
-
name: "business_legal_info.gst",
|
|
206
|
-
placeholder: t("neetoPayments.linkedAccount.form.placeholders.gst")
|
|
207
|
-
}))));
|
|
196
|
+
})
|
|
208
197
|
});
|
|
209
198
|
};
|
|
210
199
|
|