@bigbinary/neeto-payments-frontend 6.1.11 → 6.1.13
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 +473 -0
- package/dist/AccountsDashboard.js.map +1 -0
- package/dist/AdminCancelRecurringPaymentButton.js +65 -0
- package/dist/AdminCancelRecurringPaymentButton.js.map +1 -0
- package/dist/CashPaymentButton.js +58 -0
- package/dist/CashPaymentButton.js.map +1 -0
- package/dist/ConfirmCashPaymentButton.js +98 -0
- package/dist/ConfirmCashPaymentButton.js.map +1 -0
- package/dist/CopyButtonWrapper-Bp5IVO76.js +26 -0
- package/dist/CopyButtonWrapper-Bp5IVO76.js.map +1 -0
- package/dist/CustomerCancelRecurringPaymentForm.js +103 -0
- package/dist/CustomerCancelRecurringPaymentForm.js.map +1 -0
- package/dist/ExportModal-DyRGg_4o.js +120 -0
- package/dist/ExportModal-DyRGg_4o.js.map +1 -0
- package/dist/ManualUpiConnect.js +228 -0
- package/dist/ManualUpiConnect.js.map +1 -0
- package/dist/ManualUpiPayment.js +125 -0
- package/dist/ManualUpiPayment.js.map +1 -0
- package/dist/ManualUpiPaymentConfirmButton.js +155 -0
- package/dist/ManualUpiPaymentConfirmButton.js.map +1 -0
- package/dist/ManualUpiPaymentRejectButton.js +126 -0
- package/dist/ManualUpiPaymentRejectButton.js.map +1 -0
- package/dist/PaymentKindRestrictionAlert.js +31 -0
- package/dist/PaymentKindRestrictionAlert.js.map +1 -0
- package/dist/PaymentsDashboard.js +555 -0
- package/dist/PaymentsDashboard.js.map +1 -0
- package/dist/PayoutsDashboard.js +510 -0
- package/dist/PayoutsDashboard.js.map +1 -0
- package/dist/PayoutsPage.js +158 -0
- package/dist/PayoutsPage.js.map +1 -0
- package/dist/RazorpayConnect.js +115 -0
- package/dist/RazorpayConnect.js.map +1 -0
- package/dist/RazorpayLinkedAccountForm.js +201 -0
- package/dist/RazorpayLinkedAccountForm.js.map +1 -0
- package/dist/RazorpayPaymentButton.js +127 -0
- package/dist/RazorpayPaymentButton.js.map +1 -0
- package/dist/RecurringPaymentSettings.js +119 -0
- package/dist/RecurringPaymentSettings.js.map +1 -0
- package/dist/RefundsDashboard.js +484 -0
- package/dist/RefundsDashboard.js.map +1 -0
- package/dist/SplitTransfersDashboard.js +1042 -0
- package/dist/SplitTransfersDashboard.js.map +1 -0
- package/dist/StripeCheckoutSetting.js +82 -0
- package/dist/StripeCheckoutSetting.js.map +1 -0
- package/dist/StripeConnect.js +376 -0
- package/dist/StripeConnect.js.map +1 -0
- package/dist/StripeManage.js +46 -0
- package/dist/StripeManage.js.map +1 -0
- package/dist/TaxesDashboard.js +355 -0
- package/dist/TaxesDashboard.js.map +1 -0
- package/dist/buildStripeTransactionLink.js +12 -0
- package/dist/buildStripeTransactionLink.js.map +1 -0
- package/dist/cjs/AccountsDashboard.js +475 -0
- package/dist/cjs/AccountsDashboard.js.map +1 -0
- package/dist/cjs/AdminCancelRecurringPaymentButton.js +67 -0
- package/dist/cjs/AdminCancelRecurringPaymentButton.js.map +1 -0
- package/dist/cjs/CashPaymentButton.js +60 -0
- package/dist/cjs/CashPaymentButton.js.map +1 -0
- package/dist/cjs/ConfirmCashPaymentButton.js +100 -0
- package/dist/cjs/ConfirmCashPaymentButton.js.map +1 -0
- package/dist/cjs/CopyButtonWrapper-I-kdKiiB.js +29 -0
- package/dist/cjs/CopyButtonWrapper-I-kdKiiB.js.map +1 -0
- package/dist/cjs/CustomerCancelRecurringPaymentForm.js +105 -0
- package/dist/cjs/CustomerCancelRecurringPaymentForm.js.map +1 -0
- package/dist/cjs/ExportModal-DE-VcN1X.js +122 -0
- package/dist/cjs/ExportModal-DE-VcN1X.js.map +1 -0
- package/dist/cjs/ManualUpiConnect.js +249 -0
- package/dist/cjs/ManualUpiConnect.js.map +1 -0
- package/dist/cjs/ManualUpiPayment.js +146 -0
- package/dist/cjs/ManualUpiPayment.js.map +1 -0
- package/dist/cjs/ManualUpiPaymentConfirmButton.js +176 -0
- package/dist/cjs/ManualUpiPaymentConfirmButton.js.map +1 -0
- package/dist/cjs/ManualUpiPaymentRejectButton.js +128 -0
- package/dist/cjs/ManualUpiPaymentRejectButton.js.map +1 -0
- package/dist/cjs/PaymentKindRestrictionAlert.js +33 -0
- package/dist/cjs/PaymentKindRestrictionAlert.js.map +1 -0
- package/dist/cjs/PaymentsDashboard.js +557 -0
- package/dist/cjs/PaymentsDashboard.js.map +1 -0
- package/dist/cjs/PayoutsDashboard.js +512 -0
- package/dist/cjs/PayoutsDashboard.js.map +1 -0
- package/dist/cjs/PayoutsPage.js +160 -0
- package/dist/cjs/PayoutsPage.js.map +1 -0
- package/dist/cjs/RazorpayConnect.js +117 -0
- package/dist/cjs/RazorpayConnect.js.map +1 -0
- package/dist/cjs/RazorpayLinkedAccountForm.js +203 -0
- package/dist/cjs/RazorpayLinkedAccountForm.js.map +1 -0
- package/dist/cjs/RazorpayPaymentButton.js +129 -0
- package/dist/cjs/RazorpayPaymentButton.js.map +1 -0
- package/dist/cjs/RecurringPaymentSettings.js +140 -0
- package/dist/cjs/RecurringPaymentSettings.js.map +1 -0
- package/dist/cjs/RefundsDashboard.js +486 -0
- package/dist/cjs/RefundsDashboard.js.map +1 -0
- package/dist/cjs/SplitTransfersDashboard.js +1063 -0
- package/dist/cjs/SplitTransfersDashboard.js.map +1 -0
- package/dist/cjs/StripeCheckoutSetting.js +84 -0
- package/dist/cjs/StripeCheckoutSetting.js.map +1 -0
- package/dist/cjs/StripeConnect.js +397 -0
- package/dist/cjs/StripeConnect.js.map +1 -0
- package/dist/cjs/StripeManage.js +48 -0
- package/dist/cjs/StripeManage.js.map +1 -0
- package/dist/cjs/TaxesDashboard.js +376 -0
- package/dist/cjs/TaxesDashboard.js.map +1 -0
- package/dist/cjs/buildStripeTransactionLink.js +14 -0
- package/dist/cjs/buildStripeTransactionLink.js.map +1 -0
- package/dist/cjs/constants.js +38 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/dashboard-BiCB2A6S.js +96 -0
- package/dist/cjs/dashboard-BiCB2A6S.js.map +1 -0
- package/dist/cjs/exportChannel-BL2RGGhP.js +38 -0
- package/dist/cjs/exportChannel-BL2RGGhP.js.map +1 -0
- package/dist/cjs/getAddressElementOptions.js +14 -0
- package/dist/cjs/getAddressElementOptions.js.map +1 -0
- package/dist/cjs/getAmountInLargestCurrencyUnit.js +14 -0
- package/dist/cjs/getAmountInLargestCurrencyUnit.js.map +1 -0
- package/dist/cjs/getAmountInSmallestCurrencyUnit.js +14 -0
- package/dist/cjs/getAmountInSmallestCurrencyUnit.js.map +1 -0
- package/dist/cjs/getAmountWithAppliedTax.js +14 -0
- package/dist/cjs/getAmountWithAppliedTax.js.map +1 -0
- package/dist/cjs/getFormattedAmount.js +14 -0
- package/dist/cjs/getFormattedAmount.js.map +1 -0
- package/dist/cjs/getFormattedDiscountedAmount.js +14 -0
- package/dist/cjs/getFormattedDiscountedAmount.js.map +1 -0
- package/dist/cjs/getFormattedDiscountedPercentage.js +14 -0
- package/dist/cjs/getFormattedDiscountedPercentage.js.map +1 -0
- package/dist/cjs/getFormattedTaxAmount.js +14 -0
- package/dist/cjs/getFormattedTaxAmount.js.map +1 -0
- package/dist/cjs/getFormattedTipAmount.js +14 -0
- package/dist/cjs/getFormattedTipAmount.js.map +1 -0
- package/dist/cjs/getQrCodeValue.js +14 -0
- package/dist/cjs/getQrCodeValue.js.map +1 -0
- package/dist/cjs/getTaxAmount.js +14 -0
- package/dist/cjs/getTaxAmount.js.map +1 -0
- package/dist/cjs/getTipAmount.js +14 -0
- package/dist/cjs/getTipAmount.js.map +1 -0
- package/dist/cjs/hasAmountToPay.js +14 -0
- package/dist/cjs/hasAmountToPay.js.map +1 -0
- package/dist/cjs/index-D6V3Vofs.js +855 -0
- package/dist/cjs/index-D6V3Vofs.js.map +1 -0
- package/dist/cjs/index.js +121 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/queryConstants-Dc6wh21D.js +35 -0
- package/dist/cjs/queryConstants-Dc6wh21D.js.map +1 -0
- package/dist/cjs/renderFunctions-DhCwlBWw.js +48 -0
- package/dist/cjs/renderFunctions-DhCwlBWw.js.map +1 -0
- package/dist/cjs/stripe.esm-CrNYjPcC.js +132 -0
- package/dist/cjs/stripe.esm-CrNYjPcC.js.map +1 -0
- package/dist/cjs/useAccountsApi-B2MZWHMY.js +42 -0
- package/dist/cjs/useAccountsApi-B2MZWHMY.js.map +1 -0
- package/dist/cjs/useIntegrationsApi-CVlTmLKc.js +20 -0
- package/dist/cjs/useIntegrationsApi-CVlTmLKc.js.map +1 -0
- package/dist/cjs/usePaymentApi-BCE_Ql18.js +29 -0
- package/dist/cjs/usePaymentApi-BCE_Ql18.js.map +1 -0
- package/dist/cjs/usePaymentApi-Bl8jWvnG.js +44 -0
- package/dist/cjs/usePaymentApi-Bl8jWvnG.js.map +1 -0
- package/dist/cjs/usePaymentApi-CiwXBe90.js +29 -0
- package/dist/cjs/usePaymentApi-CiwXBe90.js.map +1 -0
- package/dist/cjs/usePlatformApi-CcGVG4Qi.js +55 -0
- package/dist/cjs/usePlatformApi-CcGVG4Qi.js.map +1 -0
- package/dist/cjs/useRazorpayPayment.js +88 -0
- package/dist/cjs/useRazorpayPayment.js.map +1 -0
- package/dist/cjs/useStripePromise.js +31 -0
- package/dist/cjs/useStripePromise.js.map +1 -0
- package/dist/constants.js +8 -0
- package/dist/constants.js.map +1 -0
- package/dist/dashboard-CwvqEeOl.js +90 -0
- package/dist/dashboard-CwvqEeOl.js.map +1 -0
- package/dist/exportChannel-Db0U5gc1.js +35 -0
- package/dist/exportChannel-Db0U5gc1.js.map +1 -0
- package/dist/getAddressElementOptions.js +12 -0
- package/dist/getAddressElementOptions.js.map +1 -0
- package/dist/getAmountInLargestCurrencyUnit.js +12 -0
- package/dist/getAmountInLargestCurrencyUnit.js.map +1 -0
- package/dist/getAmountInSmallestCurrencyUnit.js +12 -0
- package/dist/getAmountInSmallestCurrencyUnit.js.map +1 -0
- package/dist/getAmountWithAppliedTax.js +12 -0
- package/dist/getAmountWithAppliedTax.js.map +1 -0
- package/dist/getFormattedAmount.js +12 -0
- package/dist/getFormattedAmount.js.map +1 -0
- package/dist/getFormattedDiscountedAmount.js +12 -0
- package/dist/getFormattedDiscountedAmount.js.map +1 -0
- package/dist/getFormattedDiscountedPercentage.js +12 -0
- package/dist/getFormattedDiscountedPercentage.js.map +1 -0
- package/dist/getFormattedTaxAmount.js +12 -0
- package/dist/getFormattedTaxAmount.js.map +1 -0
- package/dist/getFormattedTipAmount.js +12 -0
- package/dist/getFormattedTipAmount.js.map +1 -0
- package/dist/getQrCodeValue.js +12 -0
- package/dist/getQrCodeValue.js.map +1 -0
- package/dist/getTaxAmount.js +12 -0
- package/dist/getTaxAmount.js.map +1 -0
- package/dist/getTipAmount.js +12 -0
- package/dist/getTipAmount.js.map +1 -0
- package/dist/hasAmountToPay.js +12 -0
- package/dist/hasAmountToPay.js.map +1 -0
- package/dist/index-CNouM9_z.js +804 -0
- package/dist/index-CNouM9_z.js.map +1 -0
- package/dist/index.js +78 -0
- package/dist/index.js.map +1 -0
- package/dist/queryConstants-C7AqdemO.js +33 -0
- package/dist/queryConstants-C7AqdemO.js.map +1 -0
- package/dist/renderFunctions-Bx5nzyE_.js +44 -0
- package/dist/renderFunctions-Bx5nzyE_.js.map +1 -0
- package/dist/stripe.esm-DuZ_gsAa.js +130 -0
- package/dist/stripe.esm-DuZ_gsAa.js.map +1 -0
- package/dist/useAccountsApi-C9_eNmEZ.js +38 -0
- package/dist/useAccountsApi-C9_eNmEZ.js.map +1 -0
- package/dist/useIntegrationsApi-D9eA_FrB.js +18 -0
- package/dist/useIntegrationsApi-D9eA_FrB.js.map +1 -0
- package/dist/usePaymentApi-B98qoM7U.js +26 -0
- package/dist/usePaymentApi-B98qoM7U.js.map +1 -0
- package/dist/usePaymentApi-DMHHdCK1.js +41 -0
- package/dist/usePaymentApi-DMHHdCK1.js.map +1 -0
- package/dist/usePaymentApi-DSlW_EBq.js +27 -0
- package/dist/usePaymentApi-DSlW_EBq.js.map +1 -0
- package/dist/usePlatformApi-sJUY6wju.js +50 -0
- package/dist/usePlatformApi-sJUY6wju.js.map +1 -0
- package/dist/useRazorpayPayment.js +86 -0
- package/dist/useRazorpayPayment.js.map +1 -0
- package/dist/useStripePromise.js +29 -0
- package/dist/useStripePromise.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var neetocist = require('neetocist');
|
|
4
|
+
var Container = require('@bigbinary/neeto-molecules/Container');
|
|
5
|
+
var Header = require('@bigbinary/neeto-molecules/Header');
|
|
6
|
+
var reactI18next = require('react-i18next');
|
|
7
|
+
var reactRouterDom = require('react-router-dom');
|
|
8
|
+
var react = require('react');
|
|
9
|
+
var DOMPurify = require('dompurify');
|
|
10
|
+
var utils = require('neetocommons/utils');
|
|
11
|
+
var misc = require('@bigbinary/neeto-icons/misc');
|
|
12
|
+
var CardLayout = require('@bigbinary/neeto-molecules/CardLayout');
|
|
13
|
+
var neetoui = require('@bigbinary/neetoui');
|
|
14
|
+
var useIntegrationsApi = require('./useIntegrationsApi-CVlTmLKc.js');
|
|
15
|
+
var constants = require('./index-D6V3Vofs.js');
|
|
16
|
+
var i18next = require('i18next');
|
|
17
|
+
var yup = require('yup');
|
|
18
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
19
|
+
var formik = require('@bigbinary/neetoui/formik');
|
|
20
|
+
var useAccountsApi = require('./useAccountsApi-B2MZWHMY.js');
|
|
21
|
+
var reactQuery = require('@tanstack/react-query');
|
|
22
|
+
var axios = require('axios');
|
|
23
|
+
var queryConstants = require('./queryConstants-Dc6wh21D.js');
|
|
24
|
+
var reactUtils = require('neetocommons/react-utils');
|
|
25
|
+
require('neetocommons/constants');
|
|
26
|
+
require('decimal.js');
|
|
27
|
+
require('ramda');
|
|
28
|
+
|
|
29
|
+
function _interopNamespaceDefault(e) {
|
|
30
|
+
var n = Object.create(null);
|
|
31
|
+
if (e) {
|
|
32
|
+
Object.keys(e).forEach(function (k) {
|
|
33
|
+
if (k !== 'default') {
|
|
34
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
35
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () { return e[k]; }
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
n.default = e;
|
|
43
|
+
return Object.freeze(n);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
var yup__namespace = /*#__PURE__*/_interopNamespaceDefault(yup);
|
|
47
|
+
|
|
48
|
+
const INTEGRATION_METHOD = {
|
|
49
|
+
useExistingAccount: "use_existing_account",
|
|
50
|
+
createNewAccount: "create_new_account"
|
|
51
|
+
};
|
|
52
|
+
const INITIAL_VALUES = {
|
|
53
|
+
country: "",
|
|
54
|
+
return_url: ""
|
|
55
|
+
};
|
|
56
|
+
const VALIDATION_SCHEMA = yup__namespace.object().shape({
|
|
57
|
+
country: yup__namespace.object().required(i18next.t("neetoPayments.validations.countryRequired"))
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const sanitize = DOMPurify.sanitize;
|
|
61
|
+
const Account = ({
|
|
62
|
+
processingPageRoute,
|
|
63
|
+
countryPageRoute,
|
|
64
|
+
holdableId,
|
|
65
|
+
productNameLabel,
|
|
66
|
+
getStripeAccount,
|
|
67
|
+
manageRoute
|
|
68
|
+
}) => {
|
|
69
|
+
const {
|
|
70
|
+
t
|
|
71
|
+
} = reactI18next.useTranslation();
|
|
72
|
+
const [selectedOption, setSelectedOption] = react.useState(INTEGRATION_METHOD.createNewAccount);
|
|
73
|
+
const history = reactRouterDom.useHistory();
|
|
74
|
+
const {
|
|
75
|
+
data: {
|
|
76
|
+
stripeStandardAccounts,
|
|
77
|
+
stripeStandardAccount
|
|
78
|
+
} = {}
|
|
79
|
+
} = useIntegrationsApi.useFetchPaymentIntegrations();
|
|
80
|
+
const stripeAccount = getStripeAccount(stripeStandardAccounts) || stripeStandardAccount;
|
|
81
|
+
const handleSubmit = () => {
|
|
82
|
+
if (selectedOption !== INTEGRATION_METHOD.useExistingAccount) {
|
|
83
|
+
return history.push(countryPageRoute);
|
|
84
|
+
}
|
|
85
|
+
const params = {
|
|
86
|
+
return_url: `${window.location.origin}${processingPageRoute}`
|
|
87
|
+
};
|
|
88
|
+
if (holdableId) {
|
|
89
|
+
params.holdable_id = holdableId;
|
|
90
|
+
}
|
|
91
|
+
const stripeConnectUrl = utils.buildUrl(constants.STRIPE_CONNECT_ENDPOINT, params);
|
|
92
|
+
return window.location.href = sanitize(stripeConnectUrl);
|
|
93
|
+
};
|
|
94
|
+
react.useEffect(() => {
|
|
95
|
+
if (stripeAccount?.isConnected) {
|
|
96
|
+
history.push(manageRoute);
|
|
97
|
+
}
|
|
98
|
+
}, [stripeAccount?.isConnected]);
|
|
99
|
+
return /*#__PURE__*/jsxRuntime.jsx(CardLayout, {
|
|
100
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(misc.Stripe, {
|
|
101
|
+
size: 48
|
|
102
|
+
}),
|
|
103
|
+
title: t("neetoPayments.stripeConnect.title"),
|
|
104
|
+
actionBlock: /*#__PURE__*/jsxRuntime.jsx(neetoui.Button, {
|
|
105
|
+
label: t("neetoPayments.common.continue"),
|
|
106
|
+
onClick: handleSubmit
|
|
107
|
+
}),
|
|
108
|
+
description: t("neetoPayments.stripeConnect.unlinkedDescription", {
|
|
109
|
+
productNameLabel
|
|
110
|
+
}),
|
|
111
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(neetoui.Radio, {
|
|
112
|
+
value: selectedOption,
|
|
113
|
+
onChange: ({
|
|
114
|
+
target: {
|
|
115
|
+
value
|
|
116
|
+
}
|
|
117
|
+
}) => setSelectedOption(value),
|
|
118
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(neetoui.Radio.Item, {
|
|
119
|
+
label: t("neetoPayments.stripeConnect.createNewAccount"),
|
|
120
|
+
name: "accountMethod",
|
|
121
|
+
value: INTEGRATION_METHOD.createNewAccount
|
|
122
|
+
}), /*#__PURE__*/jsxRuntime.jsx(neetoui.Radio.Item, {
|
|
123
|
+
label: t("neetoPayments.stripeConnect.useExistingAccount"),
|
|
124
|
+
name: "accountMethod",
|
|
125
|
+
value: INTEGRATION_METHOD.useExistingAccount
|
|
126
|
+
})]
|
|
127
|
+
})
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const fetchCountries = () => axios.get(`${constants.BASE_URL}/api/v1/stripe/countries`);
|
|
132
|
+
const countriesApi = {
|
|
133
|
+
fetchCountries
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const useFetchStripeCountries = () => reactQuery.useQuery({
|
|
137
|
+
queryKey: [queryConstants.QUERY_KEYS.STRIPE_COUNTRIES],
|
|
138
|
+
queryFn: countriesApi.fetchCountries
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
const buildRefreshUrl = (accountId, returnUrl) => `${window.location.origin}/payments/api/v1/stripe/callbacks/${accountId}/refresh?return_url=${returnUrl}`;
|
|
142
|
+
const buildCountryOptions = countries => Object.entries(countries)?.map(country => ({
|
|
143
|
+
label: neetocist.humanize(country[0]),
|
|
144
|
+
value: country[1]
|
|
145
|
+
}));
|
|
146
|
+
|
|
147
|
+
const Country = ({
|
|
148
|
+
processingPageRoute,
|
|
149
|
+
productNameLabel,
|
|
150
|
+
getStripeAccount,
|
|
151
|
+
holdableId = ""
|
|
152
|
+
}) => {
|
|
153
|
+
const [isPolling, setIsPolling] = react.useState(false);
|
|
154
|
+
const {
|
|
155
|
+
t
|
|
156
|
+
} = reactI18next.useTranslation();
|
|
157
|
+
const history = reactRouterDom.useHistory();
|
|
158
|
+
const refetchInterval = query => {
|
|
159
|
+
const {
|
|
160
|
+
jobStatus,
|
|
161
|
+
onboarding
|
|
162
|
+
} = query.state.data || {};
|
|
163
|
+
if (jobStatus === "complete") {
|
|
164
|
+
window.open(onboarding?.url, "_self");
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
return constants.POLLING_INTERVAL;
|
|
168
|
+
};
|
|
169
|
+
const {
|
|
170
|
+
isPending: isCreating,
|
|
171
|
+
data: {
|
|
172
|
+
jobId
|
|
173
|
+
} = {},
|
|
174
|
+
mutate: createStripeAccount
|
|
175
|
+
} = useAccountsApi.useCreateStripeAccount({
|
|
176
|
+
onSuccess: () => setIsPolling(true)
|
|
177
|
+
});
|
|
178
|
+
const {
|
|
179
|
+
data: {
|
|
180
|
+
stripeStandardAccounts,
|
|
181
|
+
stripeStandardAccount
|
|
182
|
+
} = {}
|
|
183
|
+
} = useIntegrationsApi.useFetchPaymentIntegrations();
|
|
184
|
+
const stripeAccount = getStripeAccount(stripeStandardAccounts) || stripeStandardAccount;
|
|
185
|
+
const {
|
|
186
|
+
isLoading,
|
|
187
|
+
data: {
|
|
188
|
+
countries = {}
|
|
189
|
+
} = {}
|
|
190
|
+
} = useFetchStripeCountries();
|
|
191
|
+
useAccountsApi.usePollingStripeAccountCreationStatus(jobId, {
|
|
192
|
+
refetchInterval,
|
|
193
|
+
enabled: neetocist.isPresent(jobId)
|
|
194
|
+
});
|
|
195
|
+
const handleSubmit = values => {
|
|
196
|
+
if (neetocist.isPresent(stripeAccount)) {
|
|
197
|
+
return window.location.href = buildRefreshUrl(stripeAccount?.id, `${window.location.origin}${processingPageRoute}`);
|
|
198
|
+
}
|
|
199
|
+
const payload = {
|
|
200
|
+
returnUrl: `${window.location.origin}${processingPageRoute}`,
|
|
201
|
+
country: values.country.value
|
|
202
|
+
};
|
|
203
|
+
if (holdableId) {
|
|
204
|
+
payload.holdableId = holdableId;
|
|
205
|
+
}
|
|
206
|
+
return createStripeAccount(payload);
|
|
207
|
+
};
|
|
208
|
+
if (isLoading) {
|
|
209
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
210
|
+
className: "flex items-center justify-center grow w-full",
|
|
211
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Spinner, {})
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik.Form, {
|
|
215
|
+
className: "w-full",
|
|
216
|
+
formikProps: {
|
|
217
|
+
enableReinitialize: true,
|
|
218
|
+
initialValues: INITIAL_VALUES,
|
|
219
|
+
validationSchema: VALIDATION_SCHEMA,
|
|
220
|
+
onSubmit: handleSubmit
|
|
221
|
+
},
|
|
222
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CardLayout, {
|
|
223
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(misc.Stripe, {
|
|
224
|
+
size: 48
|
|
225
|
+
}),
|
|
226
|
+
title: t("neetoPayments.stripeConnect.title"),
|
|
227
|
+
actionBlock: /*#__PURE__*/jsxRuntime.jsx(formik.ActionBlock, {
|
|
228
|
+
cancelButtonProps: {
|
|
229
|
+
onClick: () => history.goBack()
|
|
230
|
+
},
|
|
231
|
+
isSubmitting: isCreating || isPolling,
|
|
232
|
+
submitButtonProps: {
|
|
233
|
+
label: t("neetoPayments.common.connect")
|
|
234
|
+
}
|
|
235
|
+
}),
|
|
236
|
+
description: t("neetoPayments.stripeConnect.unlinkedDescription", {
|
|
237
|
+
productNameLabel
|
|
238
|
+
}),
|
|
239
|
+
children: /*#__PURE__*/jsxRuntime.jsx(formik.Select, {
|
|
240
|
+
required: true,
|
|
241
|
+
helpText: t("neetoPayments.stripeConnect.countryHelpText"),
|
|
242
|
+
label: t("neetoPayments.common.country"),
|
|
243
|
+
name: "country",
|
|
244
|
+
options: buildCountryOptions(countries),
|
|
245
|
+
placeholder: t("neetoPayments.stripeConnect.countryPlaceholder")
|
|
246
|
+
})
|
|
247
|
+
})
|
|
248
|
+
});
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const Processing = ({
|
|
252
|
+
baseRoute,
|
|
253
|
+
getStripeAccount,
|
|
254
|
+
productNameLabel,
|
|
255
|
+
manageRoute
|
|
256
|
+
}) => {
|
|
257
|
+
const queryClient = reactQuery.useQueryClient();
|
|
258
|
+
const [isPolling, setIsPolling] = react.useState(false);
|
|
259
|
+
const {
|
|
260
|
+
t
|
|
261
|
+
} = reactI18next.useTranslation();
|
|
262
|
+
const history = reactRouterDom.useHistory();
|
|
263
|
+
const {
|
|
264
|
+
error,
|
|
265
|
+
errorDescription = ""
|
|
266
|
+
} = reactUtils.useQueryParams();
|
|
267
|
+
const refetchInterval = query => {
|
|
268
|
+
const {
|
|
269
|
+
stripeStandardAccounts,
|
|
270
|
+
stripeStandardAccount
|
|
271
|
+
} = query.state.data || {};
|
|
272
|
+
const stripeAccount = getStripeAccount(stripeStandardAccounts) || stripeStandardAccount;
|
|
273
|
+
if (!stripeAccount?.isConnected && isPolling) {
|
|
274
|
+
return constants.POLLING_INTERVAL;
|
|
275
|
+
}
|
|
276
|
+
if (stripeAccount?.isConnected) {
|
|
277
|
+
setIsPolling(false);
|
|
278
|
+
history.push(manageRoute);
|
|
279
|
+
}
|
|
280
|
+
return false;
|
|
281
|
+
};
|
|
282
|
+
const {
|
|
283
|
+
data: {
|
|
284
|
+
stripeStandardAccounts,
|
|
285
|
+
stripeStandardAccount
|
|
286
|
+
} = {}
|
|
287
|
+
} = useIntegrationsApi.useFetchPaymentIntegrations({
|
|
288
|
+
refetchInterval,
|
|
289
|
+
enabled: neetocist.isNotPresent(error)
|
|
290
|
+
});
|
|
291
|
+
const errorMessage = error === constants.ERROR_TYPE.processing_error ? errorDescription : neetocist.humanize(errorDescription);
|
|
292
|
+
const stripeAccount = getStripeAccount(stripeStandardAccounts) || stripeStandardAccount;
|
|
293
|
+
const isAccountProcessingFailed = neetocist.isPresent(error) && neetocist.isPresent(errorDescription) || !isPolling && !stripeAccount?.isConnected;
|
|
294
|
+
const handleRetry = () => {
|
|
295
|
+
queryClient.invalidateQueries({
|
|
296
|
+
queryKey: [queryConstants.QUERY_KEYS.PAYMENT_INTEGRATION_LIST]
|
|
297
|
+
});
|
|
298
|
+
history.push(baseRoute);
|
|
299
|
+
};
|
|
300
|
+
react.useEffect(() => {
|
|
301
|
+
if (stripeAccount?.isConnected) {
|
|
302
|
+
history.push(manageRoute);
|
|
303
|
+
}
|
|
304
|
+
if (neetocist.isNotPresent(error)) {
|
|
305
|
+
setIsPolling(true);
|
|
306
|
+
}
|
|
307
|
+
const pollingTimeoutId = setTimeout(() => {
|
|
308
|
+
setIsPolling(false);
|
|
309
|
+
}, constants.MAX_POLLING_TIME);
|
|
310
|
+
return () => {
|
|
311
|
+
clearTimeout(pollingTimeoutId);
|
|
312
|
+
};
|
|
313
|
+
}, []);
|
|
314
|
+
return /*#__PURE__*/jsxRuntime.jsxs(CardLayout, {
|
|
315
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(misc.Stripe, {
|
|
316
|
+
size: 48
|
|
317
|
+
}),
|
|
318
|
+
title: t("neetoPayments.stripeConnect.title"),
|
|
319
|
+
actionBlock: isAccountProcessingFailed && /*#__PURE__*/jsxRuntime.jsx(neetoui.Button, {
|
|
320
|
+
label: t("neetoPayments.common.tryAgain"),
|
|
321
|
+
onClick: handleRetry
|
|
322
|
+
}),
|
|
323
|
+
description: isAccountProcessingFailed ? t("neetoPayments.common.processingFailed") : t("neetoPayments.stripeConnect.linkedDescription", {
|
|
324
|
+
productNameLabel
|
|
325
|
+
}),
|
|
326
|
+
children: [isPolling && /*#__PURE__*/jsxRuntime.jsx(neetoui.Callout, {
|
|
327
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
328
|
+
className: "flex space-x-4",
|
|
329
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(neetoui.Spinner, {}), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
|
|
330
|
+
style: "body1",
|
|
331
|
+
children: t("neetoPayments.stripeConnect.verifyingMessage")
|
|
332
|
+
})]
|
|
333
|
+
})
|
|
334
|
+
}), isAccountProcessingFailed && /*#__PURE__*/jsxRuntime.jsx(neetoui.Callout, {
|
|
335
|
+
style: "danger",
|
|
336
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
|
|
337
|
+
style: "body1",
|
|
338
|
+
children: neetocist.isPresent(errorDescription) ? errorMessage : t("neetoPayments.stripeConnect.failedProcessing")
|
|
339
|
+
})
|
|
340
|
+
})]
|
|
341
|
+
});
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
const StripeConnect = ({
|
|
345
|
+
baseRoute,
|
|
346
|
+
manageRoute,
|
|
347
|
+
breadcrumbs,
|
|
348
|
+
holdableId,
|
|
349
|
+
productNameLabel,
|
|
350
|
+
getStripeAccount = neetocist.noop
|
|
351
|
+
}) => {
|
|
352
|
+
const {
|
|
353
|
+
t
|
|
354
|
+
} = reactI18next.useTranslation();
|
|
355
|
+
const countryPageRoute = `${baseRoute}/countries`;
|
|
356
|
+
const processingPageRoute = `${baseRoute}/processing`;
|
|
357
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Container, {
|
|
358
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Header, {
|
|
359
|
+
breadcrumbs,
|
|
360
|
+
title: t("neetoPayments.common.connect")
|
|
361
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
362
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
|
|
363
|
+
exact: true,
|
|
364
|
+
path: baseRoute,
|
|
365
|
+
render: () => /*#__PURE__*/jsxRuntime.jsx(Account, {
|
|
366
|
+
countryPageRoute,
|
|
367
|
+
getStripeAccount,
|
|
368
|
+
holdableId,
|
|
369
|
+
manageRoute,
|
|
370
|
+
processingPageRoute,
|
|
371
|
+
productNameLabel
|
|
372
|
+
})
|
|
373
|
+
}), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
|
|
374
|
+
exact: true,
|
|
375
|
+
path: countryPageRoute,
|
|
376
|
+
component: () => /*#__PURE__*/jsxRuntime.jsx(Country, {
|
|
377
|
+
getStripeAccount,
|
|
378
|
+
holdableId,
|
|
379
|
+
processingPageRoute,
|
|
380
|
+
productNameLabel
|
|
381
|
+
})
|
|
382
|
+
}), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
|
|
383
|
+
exact: true,
|
|
384
|
+
path: processingPageRoute,
|
|
385
|
+
component: () => /*#__PURE__*/jsxRuntime.jsx(Processing, {
|
|
386
|
+
baseRoute,
|
|
387
|
+
getStripeAccount,
|
|
388
|
+
manageRoute,
|
|
389
|
+
productNameLabel
|
|
390
|
+
})
|
|
391
|
+
})]
|
|
392
|
+
})]
|
|
393
|
+
});
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
module.exports = StripeConnect;
|
|
397
|
+
//# sourceMappingURL=StripeConnect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StripeConnect.js","sources":["../../app/javascript/src/components/StripeConnect/constants.js","../../app/javascript/src/components/StripeConnect/Account.jsx","../../app/javascript/src/apis/countries.js","../../app/javascript/src/hooks/reactQuery/useCountriesApi.js","../../app/javascript/src/components/StripeConnect/utils.js","../../app/javascript/src/components/StripeConnect/Country.jsx","../../app/javascript/src/components/StripeConnect/Processing.jsx","../../app/javascript/src/components/StripeConnect/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const VALID_ERROR_CODES = [\n \"account_already_exists\",\n \"account_not_activated\",\n];\n\nexport const INTEGRATION_METHOD = {\n useExistingAccount: \"use_existing_account\",\n createNewAccount: \"create_new_account\",\n};\n\nexport const INITIAL_VALUES = { country: \"\", return_url: \"\" };\n\nexport const VALIDATION_SCHEMA = yup.object().shape({\n country: yup\n .object()\n .required(t(\"neetoPayments.validations.countryRequired\")),\n});\n","import { useEffect, useState } from \"react\";\n\nimport DOMPurify from \"dompurify\";\nimport { buildUrl } from \"neetocommons/utils\";\nimport { Stripe } from \"neetoicons/misc\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport { Radio, Button } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport { useFetchPaymentIntegrations } from \"hooks/reactQuery/useIntegrationsApi\";\nimport { STRIPE_CONNECT_ENDPOINT } from \"src/constants\";\n\nimport { INTEGRATION_METHOD } from \"./constants\";\n\nconst sanitize = DOMPurify.sanitize;\n\nconst Account = ({\n processingPageRoute,\n countryPageRoute,\n holdableId,\n productNameLabel,\n getStripeAccount,\n manageRoute,\n}) => {\n const { t } = useTranslation();\n const [selectedOption, setSelectedOption] = useState(\n INTEGRATION_METHOD.createNewAccount\n );\n\n const history = useHistory();\n\n const { data: { stripeStandardAccounts, stripeStandardAccount } = {} } =\n useFetchPaymentIntegrations();\n\n const stripeAccount =\n getStripeAccount(stripeStandardAccounts) || stripeStandardAccount;\n\n const handleSubmit = () => {\n if (selectedOption !== INTEGRATION_METHOD.useExistingAccount) {\n return history.push(countryPageRoute);\n }\n\n const params = {\n return_url: `${window.location.origin}${processingPageRoute}`,\n };\n\n if (holdableId) {\n params.holdable_id = holdableId;\n }\n\n const stripeConnectUrl = buildUrl(STRIPE_CONNECT_ENDPOINT, params);\n\n return (window.location.href = sanitize(stripeConnectUrl));\n };\n\n useEffect(() => {\n if (stripeAccount?.isConnected) {\n history.push(manageRoute);\n }\n }, [stripeAccount?.isConnected]);\n\n return (\n <CardLayout\n icon={<Stripe size={48} />}\n title={t(\"neetoPayments.stripeConnect.title\")}\n actionBlock={\n <Button\n label={t(\"neetoPayments.common.continue\")}\n onClick={handleSubmit}\n />\n }\n description={t(\"neetoPayments.stripeConnect.unlinkedDescription\", {\n productNameLabel,\n })}\n >\n <Radio\n value={selectedOption}\n onChange={({ target: { value } }) => setSelectedOption(value)}\n >\n <Radio.Item\n label={t(\"neetoPayments.stripeConnect.createNewAccount\")}\n name=\"accountMethod\"\n value={INTEGRATION_METHOD.createNewAccount}\n />\n <Radio.Item\n label={t(\"neetoPayments.stripeConnect.useExistingAccount\")}\n name=\"accountMethod\"\n value={INTEGRATION_METHOD.useExistingAccount}\n />\n </Radio>\n </CardLayout>\n );\n};\n\nexport default Account;\n","import axios from \"axios\";\n\nimport { BASE_URL } from \"src/constants\";\n\nconst fetchCountries = () => axios.get(`${BASE_URL}/api/v1/stripe/countries`);\n\nconst countriesApi = { fetchCountries };\n\nexport default countriesApi;\n","import { useQuery } from \"@tanstack/react-query\";\n\nimport countriesApi from \"apis/countries\";\nimport { QUERY_KEYS } from \"src/common/queryConstants\";\n\nexport const useFetchStripeCountries = () =>\n useQuery({\n queryKey: [QUERY_KEYS.STRIPE_COUNTRIES],\n queryFn: countriesApi.fetchCountries,\n });\n","import { humanize } from \"neetocist\";\n\nexport const buildRefreshUrl = (accountId, returnUrl) =>\n `${window.location.origin}/payments/api/v1/stripe/callbacks/${accountId}/refresh?return_url=${returnUrl}`;\n\nexport const buildCountryOptions = countries =>\n Object.entries(countries)?.map(country => ({\n label: humanize(country[0]),\n value: country[1],\n }));\n","import { useState } from \"react\";\n\nimport { isPresent } from \"neetocist\";\nimport { Stripe } from \"neetoicons/misc\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport { Spinner } from \"neetoui\";\nimport { Select, Form, ActionBlock } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n usePollingStripeAccountCreationStatus,\n useCreateStripeAccount,\n} from \"hooks/reactQuery/stripe/useAccountsApi\";\nimport { useFetchStripeCountries } from \"hooks/reactQuery/useCountriesApi\";\nimport { useFetchPaymentIntegrations } from \"hooks/reactQuery/useIntegrationsApi\";\nimport { POLLING_INTERVAL } from \"src/constants\";\n\nimport { INITIAL_VALUES, VALIDATION_SCHEMA } from \"./constants\";\nimport { buildCountryOptions, buildRefreshUrl } from \"./utils\";\n\nconst Country = ({\n processingPageRoute,\n productNameLabel,\n getStripeAccount,\n holdableId = \"\",\n}) => {\n const [isPolling, setIsPolling] = useState(false);\n\n const { t } = useTranslation();\n const history = useHistory();\n\n const refetchInterval = query => {\n const { jobStatus, onboarding } = query.state.data || {};\n if (jobStatus === \"complete\") {\n window.open(onboarding?.url, \"_self\");\n\n return false;\n }\n\n return POLLING_INTERVAL;\n };\n\n const {\n isPending: isCreating,\n data: { jobId } = {},\n mutate: createStripeAccount,\n } = useCreateStripeAccount({ onSuccess: () => setIsPolling(true) });\n\n const { data: { stripeStandardAccounts, stripeStandardAccount } = {} } =\n useFetchPaymentIntegrations();\n\n const stripeAccount =\n getStripeAccount(stripeStandardAccounts) || stripeStandardAccount;\n\n const { isLoading, data: { countries = {} } = {} } =\n useFetchStripeCountries();\n\n usePollingStripeAccountCreationStatus(jobId, {\n refetchInterval,\n enabled: isPresent(jobId),\n });\n\n const handleSubmit = values => {\n if (isPresent(stripeAccount)) {\n return (window.location.href = buildRefreshUrl(\n stripeAccount?.id,\n `${window.location.origin}${processingPageRoute}`\n ));\n }\n\n const payload = {\n returnUrl: `${window.location.origin}${processingPageRoute}`,\n country: values.country.value,\n };\n\n if (holdableId) {\n payload.holdableId = holdableId;\n }\n\n return createStripeAccount(payload);\n };\n\n if (isLoading) {\n return (\n <div className=\"flex items-center justify-center grow w-full\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <Form\n className=\"w-full\"\n formikProps={{\n enableReinitialize: true,\n initialValues: INITIAL_VALUES,\n validationSchema: VALIDATION_SCHEMA,\n onSubmit: handleSubmit,\n }}\n >\n <CardLayout\n icon={<Stripe size={48} />}\n title={t(\"neetoPayments.stripeConnect.title\")}\n actionBlock={\n <ActionBlock\n cancelButtonProps={{ onClick: () => history.goBack() }}\n isSubmitting={isCreating || isPolling}\n submitButtonProps={{ label: t(\"neetoPayments.common.connect\") }}\n />\n }\n description={t(\"neetoPayments.stripeConnect.unlinkedDescription\", {\n productNameLabel,\n })}\n >\n <Select\n required\n helpText={t(\"neetoPayments.stripeConnect.countryHelpText\")}\n label={t(\"neetoPayments.common.country\")}\n name=\"country\"\n options={buildCountryOptions(countries)}\n placeholder={t(\"neetoPayments.stripeConnect.countryPlaceholder\")}\n />\n </CardLayout>\n </Form>\n );\n};\n\nexport default Country;\n","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 { Stripe } from \"neetoicons/misc\";\nimport CardLayout from \"neetomolecules/CardLayout\";\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 { POLLING_INTERVAL, ERROR_TYPE, MAX_POLLING_TIME } from \"src/constants\";\n\nconst Processing = ({\n baseRoute,\n getStripeAccount,\n productNameLabel,\n manageRoute,\n}) => {\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 { stripeStandardAccounts, stripeStandardAccount } =\n query.state.data || {};\n\n const stripeAccount =\n getStripeAccount(stripeStandardAccounts) || stripeStandardAccount;\n\n if (!stripeAccount?.isConnected && isPolling) {\n return POLLING_INTERVAL;\n }\n\n if (stripeAccount?.isConnected) {\n setIsPolling(false);\n history.push(manageRoute);\n }\n\n return false;\n };\n\n const { data: { stripeStandardAccounts, stripeStandardAccount } = {} } =\n 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 stripeAccount =\n getStripeAccount(stripeStandardAccounts) || stripeStandardAccount;\n\n const isAccountProcessingFailed =\n (isPresent(error) && isPresent(errorDescription)) ||\n (!isPolling && !stripeAccount?.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 (stripeAccount?.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 <CardLayout\n icon={<Stripe size={48} />}\n title={t(\"neetoPayments.stripeConnect.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 : t(\"neetoPayments.stripeConnect.linkedDescription\", {\n productNameLabel,\n })\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 );\n};\n\nexport default Processing;\n","import { noop } from \"neetocist\";\nimport Container from \"neetomolecules/Container\";\nimport Header from \"neetomolecules/Header\";\nimport { useTranslation } from \"react-i18next\";\nimport { Route, Switch } from \"react-router-dom\";\n\nimport Account from \"./Account\";\nimport Country from \"./Country\";\nimport Processing from \"./Processing\";\n\nconst StripeConnect = ({\n baseRoute,\n manageRoute,\n breadcrumbs,\n holdableId,\n productNameLabel,\n getStripeAccount = noop,\n}) => {\n const { t } = useTranslation();\n const countryPageRoute = `${baseRoute}/countries`;\n const processingPageRoute = `${baseRoute}/processing`;\n\n return (\n <Container>\n <Header {...{ breadcrumbs }} title={t(\"neetoPayments.common.connect\")} />\n <Switch>\n <Route\n exact\n path={baseRoute}\n render={() => (\n <Account\n {...{\n countryPageRoute,\n getStripeAccount,\n holdableId,\n manageRoute,\n processingPageRoute,\n productNameLabel,\n }}\n />\n )}\n />\n <Route\n exact\n path={countryPageRoute}\n component={() => (\n <Country\n {...{\n getStripeAccount,\n holdableId,\n processingPageRoute,\n productNameLabel,\n }}\n />\n )}\n />\n <Route\n exact\n path={processingPageRoute}\n component={() => (\n <Processing\n {...{\n baseRoute,\n getStripeAccount,\n manageRoute,\n productNameLabel,\n }}\n />\n )}\n />\n </Switch>\n </Container>\n );\n};\n\nexport default StripeConnect;\n"],"names":["INTEGRATION_METHOD","useExistingAccount","createNewAccount","INITIAL_VALUES","country","return_url","VALIDATION_SCHEMA","yup","object","shape","required","t","sanitize","DOMPurify","Account","processingPageRoute","countryPageRoute","holdableId","productNameLabel","getStripeAccount","manageRoute","useTranslation","selectedOption","setSelectedOption","useState","history","useHistory","data","stripeStandardAccounts","stripeStandardAccount","useFetchPaymentIntegrations","stripeAccount","handleSubmit","push","params","window","location","origin","holdable_id","stripeConnectUrl","buildUrl","STRIPE_CONNECT_ENDPOINT","href","useEffect","isConnected","_jsx","CardLayout","icon","Stripe","size","title","actionBlock","Button","label","onClick","description","children","_jsxs","Radio","value","onChange","target","Item","name","fetchCountries","axios","get","BASE_URL","countriesApi","useFetchStripeCountries","useQuery","queryKey","QUERY_KEYS","STRIPE_COUNTRIES","queryFn","buildRefreshUrl","accountId","returnUrl","buildCountryOptions","countries","Object","entries","map","humanize","Country","isPolling","setIsPolling","refetchInterval","query","jobStatus","onboarding","state","open","url","POLLING_INTERVAL","isPending","isCreating","jobId","mutate","createStripeAccount","useCreateStripeAccount","onSuccess","isLoading","usePollingStripeAccountCreationStatus","enabled","isPresent","values","id","payload","className","Spinner","Form","formikProps","enableReinitialize","initialValues","validationSchema","onSubmit","ActionBlock","cancelButtonProps","goBack","isSubmitting","submitButtonProps","Select","helpText","options","placeholder","Processing","baseRoute","queryClient","useQueryClient","error","errorDescription","useQueryParams","isNotPresent","errorMessage","ERROR_TYPE","processing_error","isAccountProcessingFailed","handleRetry","invalidateQueries","PAYMENT_INTEGRATION_LIST","pollingTimeoutId","setTimeout","MAX_POLLING_TIME","clearTimeout","Callout","Typography","style","StripeConnect","breadcrumbs","noop","Container","Header","Switch","Route","exact","path","render","component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQO,MAAMA,kBAAkB,GAAG;AAChCC,EAAAA,kBAAkB,EAAE,sBAAsB;AAC1CC,EAAAA,gBAAgB,EAAE;AACpB,CAAC;AAEM,MAAMC,cAAc,GAAG;AAAEC,EAAAA,OAAO,EAAE,EAAE;AAAEC,EAAAA,UAAU,EAAE;AAAG,CAAC;AAEtD,MAAMC,iBAAiB,GAAGC,cAAG,CAACC,MAAM,EAAE,CAACC,KAAK,CAAC;AAClDL,EAAAA,OAAO,EAAEG,cAAG,CACTC,MAAM,EAAE,CACRE,QAAQ,CAACC,SAAC,CAAC,2CAA2C,CAAC;AAC5D,CAAC,CAAC;;ACJF,MAAMC,QAAQ,GAAGC,SAAS,CAACD,QAAQ;AAEnC,MAAME,OAAO,GAAGA,CAAC;EACfC,mBAAmB;EACnBC,gBAAgB;EAChBC,UAAU;EACVC,gBAAgB;EAChBC,gBAAgB;AAChBC,EAAAA;AACF,CAAC,KAAK;EACJ,MAAM;AAAET,IAAAA;GAAG,GAAGU,2BAAc,EAAE;EAC9B,MAAM,CAACC,cAAc,EAAEC,iBAAiB,CAAC,GAAGC,cAAQ,CAClDxB,kBAAkB,CAACE,gBACrB,CAAC;AAED,EAAA,MAAMuB,OAAO,GAAGC,yBAAU,EAAE;EAE5B,MAAM;AAAEC,IAAAA,IAAI,EAAE;MAAEC,sBAAsB;AAAEC,MAAAA;AAAsB,KAAC,GAAG;GAAI,GACpEC,8CAA2B,EAAE;AAE/B,EAAA,MAAMC,aAAa,GACjBZ,gBAAgB,CAACS,sBAAsB,CAAC,IAAIC,qBAAqB;EAEnE,MAAMG,YAAY,G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C6G,oBAAK,EAAA;QACJC,KAAK,EAAA,IAAA;AACLC,QAAAA,IAAI,EAAE5I,gBAAiB;AACvB8I,QAAAA,SAAS,EAAEA,mBACTjH,cAAA,CAACuC,OAAO,EAAA;UAEJjE,gBAAgB;UAChBF,UAAU;UACVF,mBAAmB;AACnBG,UAAAA;SAEH;AACD,OACH,CAAC,eACF2B,cAAA,CAAC6G,oBAAK,EAAA;QACJC,KAAK,EAAA,IAAA;AACLC,QAAAA,IAAI,EAAE7I,mBAAoB;AAC1B+I,QAAAA,SAAS,EAAEA,mBACTjH,cAAA,CAACiF,UAAU,EAAA;UAEPC,SAAS;UACT5G,gBAAgB;UAChBC,WAAW;AACXF,UAAAA;SAEH;AACD,OACH,CAAC;AAAA,KACI,CAAC;AAAA,GACA,CAAC;AAEhB;;;;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
4
|
+
var reactUtils = require('neetocommons/react-utils');
|
|
5
|
+
var CardLayout = require('@bigbinary/neeto-molecules/CardLayout');
|
|
6
|
+
var neetoui = require('@bigbinary/neetoui');
|
|
7
|
+
var StripeCheckoutSetting = require('./StripeCheckoutSetting.js');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
+
require('react-i18next');
|
|
10
|
+
require('@tanstack/react-query');
|
|
11
|
+
require('ramda');
|
|
12
|
+
require('axios');
|
|
13
|
+
require('./index-D6V3Vofs.js');
|
|
14
|
+
require('i18next');
|
|
15
|
+
require('neetocommons/constants');
|
|
16
|
+
require('decimal.js');
|
|
17
|
+
require('neetocist');
|
|
18
|
+
require('neetocommons/utils');
|
|
19
|
+
require('./queryConstants-Dc6wh21D.js');
|
|
20
|
+
|
|
21
|
+
const StripeManage = reactUtils.withT(({
|
|
22
|
+
t,
|
|
23
|
+
stripeAccount
|
|
24
|
+
}) => /*#__PURE__*/jsxRuntime.jsx(CardLayout, {
|
|
25
|
+
actionBlock: /*#__PURE__*/jsxRuntime.jsx(neetoui.Button, {
|
|
26
|
+
"data-testid": "stripe-manage-view-stripe-dashboard",
|
|
27
|
+
href: "https://dashboard.stripe.com",
|
|
28
|
+
icon: neetoIcons.ExternalLink,
|
|
29
|
+
label: t("neetoPayments.stripeManage.viewStripeDashboard"),
|
|
30
|
+
style: "secondary",
|
|
31
|
+
target: "_blank"
|
|
32
|
+
}),
|
|
33
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
34
|
+
className: "space-y-6",
|
|
35
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36
|
+
className: "flex justify-between w-full",
|
|
37
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
|
|
38
|
+
style: "h3",
|
|
39
|
+
children: t("neetoPayments.stripeManage.checkoutSettings.title")
|
|
40
|
+
})
|
|
41
|
+
}), /*#__PURE__*/jsxRuntime.jsx(StripeCheckoutSetting, {
|
|
42
|
+
stripeAccount
|
|
43
|
+
})]
|
|
44
|
+
})
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
module.exports = StripeManage;
|
|
48
|
+
//# sourceMappingURL=StripeManage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StripeManage.js","sources":["../../app/javascript/src/components/StripeManage.jsx"],"sourcesContent":["import { ExternalLink } from \"neetoicons\";\n\nimport { withT } from \"neetocommons/react-utils\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport { Typography, Button } from \"neetoui\";\n\nimport StripeCheckoutSetting from \"./StripeCheckoutSetting\";\n\nconst StripeManage = withT(({ t, stripeAccount }) => (\n <CardLayout\n actionBlock={\n <Button\n data-testid=\"stripe-manage-view-stripe-dashboard\"\n href=\"https://dashboard.stripe.com\"\n icon={ExternalLink}\n label={t(\"neetoPayments.stripeManage.viewStripeDashboard\")}\n style=\"secondary\"\n target=\"_blank\"\n />\n }\n >\n <div className=\"space-y-6\">\n <div className=\"flex justify-between w-full\">\n <Typography style=\"h3\">\n {t(\"neetoPayments.stripeManage.checkoutSettings.title\")}\n </Typography>\n </div>\n <StripeCheckoutSetting {...{ stripeAccount }} />\n </div>\n </CardLayout>\n));\n\nexport default StripeManage;\n"],"names":["StripeManage","withT","t","stripeAccount","_jsx","CardLayout","actionBlock","Button","href","icon","ExternalLink","label","style","target","children","_jsxs","className","Typography","StripeCheckoutSetting"],"mappings":";;;;;;;;;;;;;;;;;;;;AAQA,MAAMA,YAAY,GAAGC,gBAAK,CAAC,CAAC;EAAEC,CAAC;AAAEC,EAAAA;AAAc,CAAC,kBAC9CC,cAAA,CAACC,UAAU,EAAA;EACTC,WAAW,eACTF,cAAA,CAACG,cAAM,EAAA;AACL,IAAA,aAAA,EAAY,qCAAqC;AACjDC,IAAAA,IAAI,EAAC,8BAA8B;AACnCC,IAAAA,IAAI,EAAEC,uBAAa;AACnBC,IAAAA,KAAK,EAAET,CAAC,CAAC,gDAAgD,CAAE;AAC3DU,IAAAA,KAAK,EAAC,WAAW;AACjBC,IAAAA,MAAM,EAAC;AAAQ,GAChB,CACF;AAAAC,EAAAA,QAAA,eAEDC,eAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,WAAW;AAAAF,IAAAA,QAAA,gBACxBV,cAAA,CAAA,KAAA,EAAA;AAAKY,MAAAA,SAAS,EAAC,6BAA6B;MAAAF,QAAA,eAC1CV,cAAA,CAACa,kBAAU,EAAA;AAACL,QAAAA,KAAK,EAAC,IAAI;QAAAE,QAAA,EACnBZ,CAAC,CAAC,mDAAmD;OAC5C;AAAC,KACV,CAAC,eACNE,cAAA,CAACc,qBAAqB,EAAA;AAAOf,MAAAA;AAAa,KAAK,CAAC;GAC7C;AAAC,CACI,CACb;;;;"}
|