@bigbinary/neeto-payments-frontend 6.0.15 → 6.1.1

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.
Files changed (217) hide show
  1. package/package.json +5 -11
  2. package/dist/AccountsDashboard.js +0 -528
  3. package/dist/AccountsDashboard.js.map +0 -1
  4. package/dist/AdminCancelRecurringPaymentButton.js +0 -80
  5. package/dist/AdminCancelRecurringPaymentButton.js.map +0 -1
  6. package/dist/CashPaymentButton.js +0 -61
  7. package/dist/CashPaymentButton.js.map +0 -1
  8. package/dist/ConfirmCashPaymentButton.js +0 -109
  9. package/dist/ConfirmCashPaymentButton.js.map +0 -1
  10. package/dist/CopyButtonWrapper-SoJkwX-d.js +0 -27
  11. package/dist/CopyButtonWrapper-SoJkwX-d.js.map +0 -1
  12. package/dist/CustomerCancelRecurringPaymentForm.js +0 -112
  13. package/dist/CustomerCancelRecurringPaymentForm.js.map +0 -1
  14. package/dist/ExportModal-BnP3xriD.js +0 -134
  15. package/dist/ExportModal-BnP3xriD.js.map +0 -1
  16. package/dist/ManualUpiConnect.js +0 -260
  17. package/dist/ManualUpiConnect.js.map +0 -1
  18. package/dist/ManualUpiPayment.js +0 -138
  19. package/dist/ManualUpiPayment.js.map +0 -1
  20. package/dist/ManualUpiPaymentConfirmButton.js +0 -171
  21. package/dist/ManualUpiPaymentConfirmButton.js.map +0 -1
  22. package/dist/ManualUpiPaymentRejectButton.js +0 -139
  23. package/dist/ManualUpiPaymentRejectButton.js.map +0 -1
  24. package/dist/PaymentKindRestrictionAlert.js +0 -39
  25. package/dist/PaymentKindRestrictionAlert.js.map +0 -1
  26. package/dist/PaymentsDashboard.js +0 -615
  27. package/dist/PaymentsDashboard.js.map +0 -1
  28. package/dist/PayoutsDashboard.js +0 -563
  29. package/dist/PayoutsDashboard.js.map +0 -1
  30. package/dist/PayoutsPage.js +0 -163
  31. package/dist/PayoutsPage.js.map +0 -1
  32. package/dist/RazorpayConnect.js +0 -119
  33. package/dist/RazorpayConnect.js.map +0 -1
  34. package/dist/RazorpayLinkedAccountForm.js +0 -225
  35. package/dist/RazorpayLinkedAccountForm.js.map +0 -1
  36. package/dist/RazorpayPaymentButton.js +0 -148
  37. package/dist/RazorpayPaymentButton.js.map +0 -1
  38. package/dist/RecurringPaymentSettings.js +0 -133
  39. package/dist/RecurringPaymentSettings.js.map +0 -1
  40. package/dist/RefundsDashboard.js +0 -534
  41. package/dist/RefundsDashboard.js.map +0 -1
  42. package/dist/SplitTransfersDashboard.js +0 -1118
  43. package/dist/SplitTransfersDashboard.js.map +0 -1
  44. package/dist/StripeCheckoutSetting.js +0 -99
  45. package/dist/StripeCheckoutSetting.js.map +0 -1
  46. package/dist/StripeConnect.js +0 -401
  47. package/dist/StripeConnect.js.map +0 -1
  48. package/dist/StripeManage.js +0 -51
  49. package/dist/StripeManage.js.map +0 -1
  50. package/dist/TaxesDashboard.js +0 -401
  51. package/dist/TaxesDashboard.js.map +0 -1
  52. package/dist/buildStripeTransactionLink.js +0 -12
  53. package/dist/buildStripeTransactionLink.js.map +0 -1
  54. package/dist/cjs/AccountsDashboard.js +0 -530
  55. package/dist/cjs/AccountsDashboard.js.map +0 -1
  56. package/dist/cjs/AdminCancelRecurringPaymentButton.js +0 -82
  57. package/dist/cjs/AdminCancelRecurringPaymentButton.js.map +0 -1
  58. package/dist/cjs/CashPaymentButton.js +0 -63
  59. package/dist/cjs/CashPaymentButton.js.map +0 -1
  60. package/dist/cjs/ConfirmCashPaymentButton.js +0 -111
  61. package/dist/cjs/ConfirmCashPaymentButton.js.map +0 -1
  62. package/dist/cjs/CopyButtonWrapper-Ds1k64E0.js +0 -30
  63. package/dist/cjs/CopyButtonWrapper-Ds1k64E0.js.map +0 -1
  64. package/dist/cjs/CustomerCancelRecurringPaymentForm.js +0 -114
  65. package/dist/cjs/CustomerCancelRecurringPaymentForm.js.map +0 -1
  66. package/dist/cjs/ExportModal-BmHgt24q.js +0 -136
  67. package/dist/cjs/ExportModal-BmHgt24q.js.map +0 -1
  68. package/dist/cjs/ManualUpiConnect.js +0 -281
  69. package/dist/cjs/ManualUpiConnect.js.map +0 -1
  70. package/dist/cjs/ManualUpiPayment.js +0 -159
  71. package/dist/cjs/ManualUpiPayment.js.map +0 -1
  72. package/dist/cjs/ManualUpiPaymentConfirmButton.js +0 -192
  73. package/dist/cjs/ManualUpiPaymentConfirmButton.js.map +0 -1
  74. package/dist/cjs/ManualUpiPaymentRejectButton.js +0 -141
  75. package/dist/cjs/ManualUpiPaymentRejectButton.js.map +0 -1
  76. package/dist/cjs/PaymentKindRestrictionAlert.js +0 -41
  77. package/dist/cjs/PaymentKindRestrictionAlert.js.map +0 -1
  78. package/dist/cjs/PaymentsDashboard.js +0 -617
  79. package/dist/cjs/PaymentsDashboard.js.map +0 -1
  80. package/dist/cjs/PayoutsDashboard.js +0 -565
  81. package/dist/cjs/PayoutsDashboard.js.map +0 -1
  82. package/dist/cjs/PayoutsPage.js +0 -165
  83. package/dist/cjs/PayoutsPage.js.map +0 -1
  84. package/dist/cjs/RazorpayConnect.js +0 -121
  85. package/dist/cjs/RazorpayConnect.js.map +0 -1
  86. package/dist/cjs/RazorpayLinkedAccountForm.js +0 -227
  87. package/dist/cjs/RazorpayLinkedAccountForm.js.map +0 -1
  88. package/dist/cjs/RazorpayPaymentButton.js +0 -150
  89. package/dist/cjs/RazorpayPaymentButton.js.map +0 -1
  90. package/dist/cjs/RecurringPaymentSettings.js +0 -154
  91. package/dist/cjs/RecurringPaymentSettings.js.map +0 -1
  92. package/dist/cjs/RefundsDashboard.js +0 -536
  93. package/dist/cjs/RefundsDashboard.js.map +0 -1
  94. package/dist/cjs/SplitTransfersDashboard.js +0 -1139
  95. package/dist/cjs/SplitTransfersDashboard.js.map +0 -1
  96. package/dist/cjs/StripeCheckoutSetting.js +0 -101
  97. package/dist/cjs/StripeCheckoutSetting.js.map +0 -1
  98. package/dist/cjs/StripeConnect.js +0 -422
  99. package/dist/cjs/StripeConnect.js.map +0 -1
  100. package/dist/cjs/StripeManage.js +0 -53
  101. package/dist/cjs/StripeManage.js.map +0 -1
  102. package/dist/cjs/TaxesDashboard.js +0 -422
  103. package/dist/cjs/TaxesDashboard.js.map +0 -1
  104. package/dist/cjs/buildStripeTransactionLink.js +0 -14
  105. package/dist/cjs/buildStripeTransactionLink.js.map +0 -1
  106. package/dist/cjs/constants.js +0 -38
  107. package/dist/cjs/constants.js.map +0 -1
  108. package/dist/cjs/dashboard-DLj_eVV0.js +0 -112
  109. package/dist/cjs/dashboard-DLj_eVV0.js.map +0 -1
  110. package/dist/cjs/exportChannel-BB1psKzT.js +0 -40
  111. package/dist/cjs/exportChannel-BB1psKzT.js.map +0 -1
  112. package/dist/cjs/getAddressElementOptions.js +0 -14
  113. package/dist/cjs/getAddressElementOptions.js.map +0 -1
  114. package/dist/cjs/getAmountInSmallestCurrencyUnit.js +0 -14
  115. package/dist/cjs/getAmountInSmallestCurrencyUnit.js.map +0 -1
  116. package/dist/cjs/getAmountWithAppliedTax.js +0 -14
  117. package/dist/cjs/getAmountWithAppliedTax.js.map +0 -1
  118. package/dist/cjs/getFormattedAmount.js +0 -14
  119. package/dist/cjs/getFormattedAmount.js.map +0 -1
  120. package/dist/cjs/getFormattedDiscountedAmount.js +0 -14
  121. package/dist/cjs/getFormattedDiscountedAmount.js.map +0 -1
  122. package/dist/cjs/getFormattedDiscountedPercentage.js +0 -14
  123. package/dist/cjs/getFormattedDiscountedPercentage.js.map +0 -1
  124. package/dist/cjs/getFormattedTaxAmount.js +0 -14
  125. package/dist/cjs/getFormattedTaxAmount.js.map +0 -1
  126. package/dist/cjs/getFormattedTipAmount.js +0 -14
  127. package/dist/cjs/getFormattedTipAmount.js.map +0 -1
  128. package/dist/cjs/getQrCodeValue.js +0 -14
  129. package/dist/cjs/getQrCodeValue.js.map +0 -1
  130. package/dist/cjs/getTaxAmount.js +0 -14
  131. package/dist/cjs/getTaxAmount.js.map +0 -1
  132. package/dist/cjs/getTipAmount.js +0 -14
  133. package/dist/cjs/getTipAmount.js.map +0 -1
  134. package/dist/cjs/hasAmountToPay.js +0 -14
  135. package/dist/cjs/hasAmountToPay.js.map +0 -1
  136. package/dist/cjs/index-KqkPP267.js +0 -892
  137. package/dist/cjs/index-KqkPP267.js.map +0 -1
  138. package/dist/cjs/index.js +0 -150
  139. package/dist/cjs/index.js.map +0 -1
  140. package/dist/cjs/queryConstants-Cka1X6GX.js +0 -35
  141. package/dist/cjs/queryConstants-Cka1X6GX.js.map +0 -1
  142. package/dist/cjs/renderFunctions-ydTbw8WO.js +0 -56
  143. package/dist/cjs/renderFunctions-ydTbw8WO.js.map +0 -1
  144. package/dist/cjs/stripe.esm-CrNYjPcC.js +0 -132
  145. package/dist/cjs/stripe.esm-CrNYjPcC.js.map +0 -1
  146. package/dist/cjs/useAccountsApi-CJf2ILqh.js +0 -62
  147. package/dist/cjs/useAccountsApi-CJf2ILqh.js.map +0 -1
  148. package/dist/cjs/useIntegrationsApi-BLP7KuIR.js +0 -26
  149. package/dist/cjs/useIntegrationsApi-BLP7KuIR.js.map +0 -1
  150. package/dist/cjs/usePaymentApi-B_4I2IeI.js +0 -41
  151. package/dist/cjs/usePaymentApi-B_4I2IeI.js.map +0 -1
  152. package/dist/cjs/usePaymentApi-Bf9f9dFY.js +0 -56
  153. package/dist/cjs/usePaymentApi-Bf9f9dFY.js.map +0 -1
  154. package/dist/cjs/usePaymentApi-C90HGytr.js +0 -39
  155. package/dist/cjs/usePaymentApi-C90HGytr.js.map +0 -1
  156. package/dist/cjs/usePlatformApi-CPdK_K-y.js +0 -84
  157. package/dist/cjs/usePlatformApi-CPdK_K-y.js.map +0 -1
  158. package/dist/cjs/useRazorpayPayment.js +0 -113
  159. package/dist/cjs/useRazorpayPayment.js.map +0 -1
  160. package/dist/cjs/useStripePromise.js +0 -57
  161. package/dist/cjs/useStripePromise.js.map +0 -1
  162. package/dist/constants.js +0 -8
  163. package/dist/constants.js.map +0 -1
  164. package/dist/dashboard-Dn2TZTXF.js +0 -106
  165. package/dist/dashboard-Dn2TZTXF.js.map +0 -1
  166. package/dist/exportChannel-h2JJKPT1.js +0 -37
  167. package/dist/exportChannel-h2JJKPT1.js.map +0 -1
  168. package/dist/getAddressElementOptions.js +0 -12
  169. package/dist/getAddressElementOptions.js.map +0 -1
  170. package/dist/getAmountInSmallestCurrencyUnit.js +0 -12
  171. package/dist/getAmountInSmallestCurrencyUnit.js.map +0 -1
  172. package/dist/getAmountWithAppliedTax.js +0 -12
  173. package/dist/getAmountWithAppliedTax.js.map +0 -1
  174. package/dist/getFormattedAmount.js +0 -12
  175. package/dist/getFormattedAmount.js.map +0 -1
  176. package/dist/getFormattedDiscountedAmount.js +0 -12
  177. package/dist/getFormattedDiscountedAmount.js.map +0 -1
  178. package/dist/getFormattedDiscountedPercentage.js +0 -12
  179. package/dist/getFormattedDiscountedPercentage.js.map +0 -1
  180. package/dist/getFormattedTaxAmount.js +0 -12
  181. package/dist/getFormattedTaxAmount.js.map +0 -1
  182. package/dist/getFormattedTipAmount.js +0 -12
  183. package/dist/getFormattedTipAmount.js.map +0 -1
  184. package/dist/getQrCodeValue.js +0 -12
  185. package/dist/getQrCodeValue.js.map +0 -1
  186. package/dist/getTaxAmount.js +0 -12
  187. package/dist/getTaxAmount.js.map +0 -1
  188. package/dist/getTipAmount.js +0 -12
  189. package/dist/getTipAmount.js.map +0 -1
  190. package/dist/hasAmountToPay.js +0 -12
  191. package/dist/hasAmountToPay.js.map +0 -1
  192. package/dist/index-Xdf4XpRc.js +0 -842
  193. package/dist/index-Xdf4XpRc.js.map +0 -1
  194. package/dist/index.js +0 -108
  195. package/dist/index.js.map +0 -1
  196. package/dist/queryConstants-DFKKEEo0.js +0 -33
  197. package/dist/queryConstants-DFKKEEo0.js.map +0 -1
  198. package/dist/renderFunctions-BCW1POD1.js +0 -52
  199. package/dist/renderFunctions-BCW1POD1.js.map +0 -1
  200. package/dist/stripe.esm-DuZ_gsAa.js +0 -130
  201. package/dist/stripe.esm-DuZ_gsAa.js.map +0 -1
  202. package/dist/useAccountsApi-qzNkKYfX.js +0 -58
  203. package/dist/useAccountsApi-qzNkKYfX.js.map +0 -1
  204. package/dist/useIntegrationsApi-DkA7eXBT.js +0 -24
  205. package/dist/useIntegrationsApi-DkA7eXBT.js.map +0 -1
  206. package/dist/usePaymentApi-B1qMca2A.js +0 -53
  207. package/dist/usePaymentApi-B1qMca2A.js.map +0 -1
  208. package/dist/usePaymentApi-D8FEXicG.js +0 -37
  209. package/dist/usePaymentApi-D8FEXicG.js.map +0 -1
  210. package/dist/usePaymentApi-jZmkutky.js +0 -38
  211. package/dist/usePaymentApi-jZmkutky.js.map +0 -1
  212. package/dist/usePlatformApi-0sGcYfsx.js +0 -79
  213. package/dist/usePlatformApi-0sGcYfsx.js.map +0 -1
  214. package/dist/useRazorpayPayment.js +0 -111
  215. package/dist/useRazorpayPayment.js.map +0 -1
  216. package/dist/useStripePromise.js +0 -55
  217. package/dist/useStripePromise.js.map +0 -1
@@ -1,422 +0,0 @@
1
- 'use strict';
2
-
3
- var neetoCist = require('@bigbinary/neeto-cist');
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 _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
9
- var react = require('react');
10
- var DOMPurify = require('dompurify');
11
- var utils = require('@bigbinary/neeto-commons-frontend/utils');
12
- var Stripe = require('@bigbinary/neeto-icons/misc/Stripe');
13
- var CardLayout = require('@bigbinary/neeto-molecules/CardLayout');
14
- var Radio = require('@bigbinary/neetoui/Radio');
15
- var Button = require('@bigbinary/neetoui/Button');
16
- var useIntegrationsApi = require('./useIntegrationsApi-BLP7KuIR.js');
17
- var constants = require('./index-KqkPP267.js');
18
- var i18next = require('i18next');
19
- var yup = require('yup');
20
- var jsxRuntime = require('react/jsx-runtime');
21
- var Spinner = require('@bigbinary/neetoui/Spinner');
22
- var Select = require('@bigbinary/neetoui/formik/Select');
23
- var Form = require('@bigbinary/neetoui/formik/Form');
24
- var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
25
- var useAccountsApi = require('./useAccountsApi-CJf2ILqh.js');
26
- var reactQuery = require('@tanstack/react-query');
27
- var axios = require('axios');
28
- var queryConstants = require('./queryConstants-Cka1X6GX.js');
29
- var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
30
- var Typography = require('@bigbinary/neetoui/Typography');
31
- var Callout = require('@bigbinary/neetoui/Callout');
32
- require('@babel/runtime/helpers/defineProperty');
33
- require('@bigbinary/neeto-commons-frontend/constants');
34
- require('decimal.js');
35
- require('ramda');
36
-
37
- function _interopNamespaceDefault(e) {
38
- var n = Object.create(null);
39
- if (e) {
40
- Object.keys(e).forEach(function (k) {
41
- if (k !== 'default') {
42
- var d = Object.getOwnPropertyDescriptor(e, k);
43
- Object.defineProperty(n, k, d.get ? d : {
44
- enumerable: true,
45
- get: function () { return e[k]; }
46
- });
47
- }
48
- });
49
- }
50
- n.default = e;
51
- return Object.freeze(n);
52
- }
53
-
54
- var yup__namespace = /*#__PURE__*/_interopNamespaceDefault(yup);
55
-
56
- var INTEGRATION_METHOD = {
57
- useExistingAccount: "use_existing_account",
58
- createNewAccount: "create_new_account"
59
- };
60
- var INITIAL_VALUES = {
61
- country: "",
62
- return_url: ""
63
- };
64
- var VALIDATION_SCHEMA = yup__namespace.object().shape({
65
- country: yup__namespace.object().required(i18next.t("neetoPayments.validations.countryRequired"))
66
- });
67
-
68
- var sanitize = DOMPurify.sanitize;
69
- var Account = function Account(_ref) {
70
- var processingPageRoute = _ref.processingPageRoute,
71
- countryPageRoute = _ref.countryPageRoute,
72
- holdableId = _ref.holdableId,
73
- productNameLabel = _ref.productNameLabel,
74
- getStripeAccount = _ref.getStripeAccount,
75
- manageRoute = _ref.manageRoute;
76
- var _useTranslation = reactI18next.useTranslation(),
77
- t = _useTranslation.t;
78
- var _useState = react.useState(INTEGRATION_METHOD.createNewAccount),
79
- _useState2 = _slicedToArray(_useState, 2),
80
- selectedOption = _useState2[0],
81
- setSelectedOption = _useState2[1];
82
- var history = reactRouterDom.useHistory();
83
- var _useFetchPaymentInteg = useIntegrationsApi.useFetchPaymentIntegrations(),
84
- _useFetchPaymentInteg2 = _useFetchPaymentInteg.data,
85
- _useFetchPaymentInteg3 = _useFetchPaymentInteg2 === void 0 ? {} : _useFetchPaymentInteg2,
86
- stripeStandardAccounts = _useFetchPaymentInteg3.stripeStandardAccounts,
87
- stripeStandardAccount = _useFetchPaymentInteg3.stripeStandardAccount;
88
- var stripeAccount = getStripeAccount(stripeStandardAccounts) || stripeStandardAccount;
89
- var handleSubmit = function handleSubmit() {
90
- if (selectedOption !== INTEGRATION_METHOD.useExistingAccount) {
91
- return history.push(countryPageRoute);
92
- }
93
- var params = {
94
- return_url: "".concat(window.location.origin).concat(processingPageRoute)
95
- };
96
- if (holdableId) {
97
- params.holdable_id = holdableId;
98
- }
99
- var stripeConnectUrl = utils.buildUrl(constants.STRIPE_CONNECT_ENDPOINT, params);
100
- return window.location.href = sanitize(stripeConnectUrl);
101
- };
102
- react.useEffect(function () {
103
- if (stripeAccount !== null && stripeAccount !== void 0 && stripeAccount.isConnected) {
104
- history.push(manageRoute);
105
- }
106
- }, [stripeAccount === null || stripeAccount === void 0 ? void 0 : stripeAccount.isConnected]);
107
- return /*#__PURE__*/jsxRuntime.jsx(CardLayout, {
108
- icon: /*#__PURE__*/jsxRuntime.jsx(Stripe, {
109
- size: 48
110
- }),
111
- title: t("neetoPayments.stripeConnect.title"),
112
- actionBlock: /*#__PURE__*/jsxRuntime.jsx(Button, {
113
- label: t("neetoPayments.common.continue"),
114
- onClick: handleSubmit
115
- }),
116
- description: t("neetoPayments.stripeConnect.unlinkedDescription", {
117
- productNameLabel: productNameLabel
118
- }),
119
- children: /*#__PURE__*/jsxRuntime.jsxs(Radio, {
120
- value: selectedOption,
121
- onChange: function onChange(_ref2) {
122
- var value = _ref2.target.value;
123
- return setSelectedOption(value);
124
- },
125
- children: [/*#__PURE__*/jsxRuntime.jsx(Radio.Item, {
126
- label: t("neetoPayments.stripeConnect.createNewAccount"),
127
- name: "accountMethod",
128
- value: INTEGRATION_METHOD.createNewAccount
129
- }), /*#__PURE__*/jsxRuntime.jsx(Radio.Item, {
130
- label: t("neetoPayments.stripeConnect.useExistingAccount"),
131
- name: "accountMethod",
132
- value: INTEGRATION_METHOD.useExistingAccount
133
- })]
134
- })
135
- });
136
- };
137
-
138
- var fetchCountries = function fetchCountries() {
139
- return axios.get("".concat(constants.BASE_URL, "/api/v1/stripe/countries"));
140
- };
141
- var countriesApi = {
142
- fetchCountries: fetchCountries
143
- };
144
-
145
- var useFetchStripeCountries = function useFetchStripeCountries() {
146
- return reactQuery.useQuery({
147
- queryKey: [queryConstants.QUERY_KEYS.STRIPE_COUNTRIES],
148
- queryFn: countriesApi.fetchCountries
149
- });
150
- };
151
-
152
- var buildRefreshUrl = function buildRefreshUrl(accountId, returnUrl) {
153
- return "".concat(window.location.origin, "/payments/api/v1/stripe/callbacks/").concat(accountId, "/refresh?return_url=").concat(returnUrl);
154
- };
155
- var buildCountryOptions = function buildCountryOptions(countries) {
156
- var _Object$entries;
157
- return (_Object$entries = Object.entries(countries)) === null || _Object$entries === void 0 ? void 0 : _Object$entries.map(function (country) {
158
- return {
159
- label: neetoCist.humanize(country[0]),
160
- value: country[1]
161
- };
162
- });
163
- };
164
-
165
- var Country = function Country(_ref) {
166
- var processingPageRoute = _ref.processingPageRoute,
167
- productNameLabel = _ref.productNameLabel,
168
- getStripeAccount = _ref.getStripeAccount,
169
- _ref$holdableId = _ref.holdableId,
170
- holdableId = _ref$holdableId === void 0 ? "" : _ref$holdableId;
171
- var _useState = react.useState(false),
172
- _useState2 = _slicedToArray(_useState, 2),
173
- isPolling = _useState2[0],
174
- setIsPolling = _useState2[1];
175
- var _useTranslation = reactI18next.useTranslation(),
176
- t = _useTranslation.t;
177
- var history = reactRouterDom.useHistory();
178
- var refetchInterval = function refetchInterval(query) {
179
- var _ref2 = query.state.data || {},
180
- jobStatus = _ref2.jobStatus,
181
- onboarding = _ref2.onboarding;
182
- if (jobStatus === "complete") {
183
- window.open(onboarding === null || onboarding === void 0 ? void 0 : onboarding.url, "_self");
184
- return false;
185
- }
186
- return constants.POLLING_INTERVAL;
187
- };
188
- var _useCreateStripeAccou = useAccountsApi.useCreateStripeAccount({
189
- onSuccess: function onSuccess() {
190
- return setIsPolling(true);
191
- }
192
- }),
193
- isCreating = _useCreateStripeAccou.isPending,
194
- _useCreateStripeAccou2 = _useCreateStripeAccou.data,
195
- _useCreateStripeAccou3 = _useCreateStripeAccou2 === void 0 ? {} : _useCreateStripeAccou2,
196
- jobId = _useCreateStripeAccou3.jobId,
197
- createStripeAccount = _useCreateStripeAccou.mutate;
198
- var _useFetchPaymentInteg = useIntegrationsApi.useFetchPaymentIntegrations(),
199
- _useFetchPaymentInteg2 = _useFetchPaymentInteg.data,
200
- _useFetchPaymentInteg3 = _useFetchPaymentInteg2 === void 0 ? {} : _useFetchPaymentInteg2,
201
- stripeStandardAccounts = _useFetchPaymentInteg3.stripeStandardAccounts,
202
- stripeStandardAccount = _useFetchPaymentInteg3.stripeStandardAccount;
203
- var stripeAccount = getStripeAccount(stripeStandardAccounts) || stripeStandardAccount;
204
- var _useFetchStripeCountr = useFetchStripeCountries(),
205
- isLoading = _useFetchStripeCountr.isLoading,
206
- _useFetchStripeCountr2 = _useFetchStripeCountr.data,
207
- _useFetchStripeCountr3 = _useFetchStripeCountr2 === void 0 ? {} : _useFetchStripeCountr2,
208
- _useFetchStripeCountr4 = _useFetchStripeCountr3.countries,
209
- countries = _useFetchStripeCountr4 === void 0 ? {} : _useFetchStripeCountr4;
210
- useAccountsApi.usePollingStripeAccountCreationStatus(jobId, {
211
- refetchInterval: refetchInterval,
212
- enabled: neetoCist.isPresent(jobId)
213
- });
214
- var handleSubmit = function handleSubmit(values) {
215
- if (neetoCist.isPresent(stripeAccount)) {
216
- return window.location.href = buildRefreshUrl(stripeAccount === null || stripeAccount === void 0 ? void 0 : stripeAccount.id, "".concat(window.location.origin).concat(processingPageRoute));
217
- }
218
- var payload = {
219
- returnUrl: "".concat(window.location.origin).concat(processingPageRoute),
220
- country: values.country.value
221
- };
222
- if (holdableId) {
223
- payload.holdableId = holdableId;
224
- }
225
- return createStripeAccount(payload);
226
- };
227
- if (isLoading) {
228
- return /*#__PURE__*/jsxRuntime.jsx("div", {
229
- className: "flex items-center justify-center grow w-full",
230
- children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
231
- });
232
- }
233
- return /*#__PURE__*/jsxRuntime.jsx(Form, {
234
- className: "w-full",
235
- formikProps: {
236
- enableReinitialize: true,
237
- initialValues: INITIAL_VALUES,
238
- validationSchema: VALIDATION_SCHEMA,
239
- onSubmit: handleSubmit
240
- },
241
- children: /*#__PURE__*/jsxRuntime.jsx(CardLayout, {
242
- icon: /*#__PURE__*/jsxRuntime.jsx(Stripe, {
243
- size: 48
244
- }),
245
- title: t("neetoPayments.stripeConnect.title"),
246
- actionBlock: /*#__PURE__*/jsxRuntime.jsx(ActionBlock, {
247
- cancelButtonProps: {
248
- onClick: function onClick() {
249
- return history.goBack();
250
- }
251
- },
252
- isSubmitting: isCreating || isPolling,
253
- submitButtonProps: {
254
- label: t("neetoPayments.common.connect")
255
- }
256
- }),
257
- description: t("neetoPayments.stripeConnect.unlinkedDescription", {
258
- productNameLabel: productNameLabel
259
- }),
260
- children: /*#__PURE__*/jsxRuntime.jsx(Select, {
261
- required: true,
262
- helpText: t("neetoPayments.stripeConnect.countryHelpText"),
263
- label: t("neetoPayments.common.country"),
264
- name: "country",
265
- options: buildCountryOptions(countries),
266
- placeholder: t("neetoPayments.stripeConnect.countryPlaceholder")
267
- })
268
- })
269
- });
270
- };
271
-
272
- var Processing = function Processing(_ref) {
273
- var baseRoute = _ref.baseRoute,
274
- getStripeAccount = _ref.getStripeAccount,
275
- productNameLabel = _ref.productNameLabel,
276
- manageRoute = _ref.manageRoute;
277
- var queryClient = reactQuery.useQueryClient();
278
- var _useState = react.useState(false),
279
- _useState2 = _slicedToArray(_useState, 2),
280
- isPolling = _useState2[0],
281
- setIsPolling = _useState2[1];
282
- var _useTranslation = reactI18next.useTranslation(),
283
- t = _useTranslation.t;
284
- var history = reactRouterDom.useHistory();
285
- var _useQueryParams = reactUtils.useQueryParams(),
286
- error = _useQueryParams.error,
287
- _useQueryParams$error = _useQueryParams.errorDescription,
288
- errorDescription = _useQueryParams$error === void 0 ? "" : _useQueryParams$error;
289
- var refetchInterval = function refetchInterval(query) {
290
- var _ref2 = query.state.data || {},
291
- stripeStandardAccounts = _ref2.stripeStandardAccounts,
292
- stripeStandardAccount = _ref2.stripeStandardAccount;
293
- var stripeAccount = getStripeAccount(stripeStandardAccounts) || stripeStandardAccount;
294
- if (!(stripeAccount !== null && stripeAccount !== void 0 && stripeAccount.isConnected) && isPolling) {
295
- return constants.POLLING_INTERVAL;
296
- }
297
- if (stripeAccount !== null && stripeAccount !== void 0 && stripeAccount.isConnected) {
298
- setIsPolling(false);
299
- history.push(manageRoute);
300
- }
301
- return false;
302
- };
303
- var _useFetchPaymentInteg = useIntegrationsApi.useFetchPaymentIntegrations({
304
- refetchInterval: refetchInterval,
305
- enabled: neetoCist.isNotPresent(error)
306
- }),
307
- _useFetchPaymentInteg2 = _useFetchPaymentInteg.data,
308
- _useFetchPaymentInteg3 = _useFetchPaymentInteg2 === void 0 ? {} : _useFetchPaymentInteg2,
309
- stripeStandardAccounts = _useFetchPaymentInteg3.stripeStandardAccounts,
310
- stripeStandardAccount = _useFetchPaymentInteg3.stripeStandardAccount;
311
- var errorMessage = error === constants.ERROR_TYPE.processing_error ? errorDescription : neetoCist.humanize(errorDescription);
312
- var stripeAccount = getStripeAccount(stripeStandardAccounts) || stripeStandardAccount;
313
- var isAccountProcessingFailed = neetoCist.isPresent(error) && neetoCist.isPresent(errorDescription) || !isPolling && !(stripeAccount !== null && stripeAccount !== void 0 && stripeAccount.isConnected);
314
- var handleRetry = function handleRetry() {
315
- queryClient.invalidateQueries({
316
- queryKey: [queryConstants.QUERY_KEYS.PAYMENT_INTEGRATION_LIST]
317
- });
318
- history.push(baseRoute);
319
- };
320
- react.useEffect(function () {
321
- if (stripeAccount !== null && stripeAccount !== void 0 && stripeAccount.isConnected) {
322
- history.push(manageRoute);
323
- }
324
- if (neetoCist.isNotPresent(error)) {
325
- setIsPolling(true);
326
- }
327
- var pollingTimeoutId = setTimeout(function () {
328
- setIsPolling(false);
329
- }, constants.MAX_POLLING_TIME);
330
- return function () {
331
- clearTimeout(pollingTimeoutId);
332
- };
333
- }, []);
334
- return /*#__PURE__*/jsxRuntime.jsxs(CardLayout, {
335
- icon: /*#__PURE__*/jsxRuntime.jsx(Stripe, {
336
- size: 48
337
- }),
338
- title: t("neetoPayments.stripeConnect.title"),
339
- actionBlock: isAccountProcessingFailed && /*#__PURE__*/jsxRuntime.jsx(Button, {
340
- label: t("neetoPayments.common.tryAgain"),
341
- onClick: handleRetry
342
- }),
343
- description: isAccountProcessingFailed ? t("neetoPayments.common.processingFailed") : t("neetoPayments.stripeConnect.linkedDescription", {
344
- productNameLabel: productNameLabel
345
- }),
346
- children: [isPolling && /*#__PURE__*/jsxRuntime.jsx(Callout, {
347
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
348
- className: "flex space-x-4",
349
- children: [/*#__PURE__*/jsxRuntime.jsx(Spinner, {}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
350
- style: "body1",
351
- children: t("neetoPayments.stripeConnect.verifyingMessage")
352
- })]
353
- })
354
- }), isAccountProcessingFailed && /*#__PURE__*/jsxRuntime.jsx(Callout, {
355
- style: "danger",
356
- children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
357
- style: "body1",
358
- children: neetoCist.isPresent(errorDescription) ? errorMessage : t("neetoPayments.stripeConnect.failedProcessing")
359
- })
360
- })]
361
- });
362
- };
363
-
364
- var StripeConnect = function StripeConnect(_ref) {
365
- var baseRoute = _ref.baseRoute,
366
- manageRoute = _ref.manageRoute,
367
- breadcrumbs = _ref.breadcrumbs,
368
- holdableId = _ref.holdableId,
369
- productNameLabel = _ref.productNameLabel,
370
- _ref$getStripeAccount = _ref.getStripeAccount,
371
- getStripeAccount = _ref$getStripeAccount === void 0 ? neetoCist.noop : _ref$getStripeAccount;
372
- var _useTranslation = reactI18next.useTranslation(),
373
- t = _useTranslation.t;
374
- var countryPageRoute = "".concat(baseRoute, "/countries");
375
- var processingPageRoute = "".concat(baseRoute, "/processing");
376
- return /*#__PURE__*/jsxRuntime.jsxs(Container, {
377
- children: [/*#__PURE__*/jsxRuntime.jsx(Header, {
378
- breadcrumbs: breadcrumbs,
379
- title: t("neetoPayments.common.connect")
380
- }), /*#__PURE__*/jsxRuntime.jsxs(reactRouterDom.Switch, {
381
- children: [/*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
382
- exact: true,
383
- path: baseRoute,
384
- render: function render() {
385
- return /*#__PURE__*/jsxRuntime.jsx(Account, {
386
- countryPageRoute: countryPageRoute,
387
- getStripeAccount: getStripeAccount,
388
- holdableId: holdableId,
389
- manageRoute: manageRoute,
390
- processingPageRoute: processingPageRoute,
391
- productNameLabel: productNameLabel
392
- });
393
- }
394
- }), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
395
- exact: true,
396
- path: countryPageRoute,
397
- component: function component() {
398
- return /*#__PURE__*/jsxRuntime.jsx(Country, {
399
- getStripeAccount: getStripeAccount,
400
- holdableId: holdableId,
401
- processingPageRoute: processingPageRoute,
402
- productNameLabel: productNameLabel
403
- });
404
- }
405
- }), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
406
- exact: true,
407
- path: processingPageRoute,
408
- component: function component() {
409
- return /*#__PURE__*/jsxRuntime.jsx(Processing, {
410
- baseRoute: baseRoute,
411
- getStripeAccount: getStripeAccount,
412
- manageRoute: manageRoute,
413
- productNameLabel: productNameLabel
414
- });
415
- }
416
- })]
417
- })]
418
- });
419
- };
420
-
421
- module.exports = StripeConnect;
422
- //# sourceMappingURL=StripeConnect.js.map
@@ -1 +0,0 @@
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","_ref","processingPageRoute","countryPageRoute","holdableId","productNameLabel","getStripeAccount","manageRoute","_useTranslation","useTranslation","_useState","useState","_useState2","_slicedToArray","selectedOption","setSelectedOption","history","useHistory","_useFetchPaymentInteg","useFetchPaymentIntegrations","_useFetchPaymentInteg2","data","_useFetchPaymentInteg3","stripeStandardAccounts","stripeStandardAccount","stripeAccount","handleSubmit","push","params","concat","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","_ref2","target","Item","name","fetchCountries","axios","get","BASE_URL","countriesApi","useFetchStripeCountries","useQuery","queryKey","QUERY_KEYS","STRIPE_COUNTRIES","queryFn","buildRefreshUrl","accountId","returnUrl","buildCountryOptions","countries","_Object$entries","Object","entries","map","humanize","Country","_ref$holdableId","isPolling","setIsPolling","refetchInterval","query","state","jobStatus","onboarding","open","url","POLLING_INTERVAL","_useCreateStripeAccou","useCreateStripeAccount","onSuccess","isCreating","isPending","_useCreateStripeAccou2","_useCreateStripeAccou3","jobId","createStripeAccount","mutate","_useFetchStripeCountr","isLoading","_useFetchStripeCountr2","_useFetchStripeCountr3","_useFetchStripeCountr4","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","_useQueryParams","useQueryParams","error","_useQueryParams$error","errorDescription","isNotPresent","errorMessage","ERROR_TYPE","processing_error","isAccountProcessingFailed","handleRetry","invalidateQueries","PAYMENT_INTEGRATION_LIST","pollingTimeoutId","setTimeout","MAX_POLLING_TIME","clearTimeout","Callout","Typography","style","StripeConnect","breadcrumbs","_ref$getStripeAccount","noop","Container","Header","Switch","Route","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C;AAAA;AACF,OACH,CAAC,eACFmC,cAAA,CAAC0H,oBAAK,EAAA;QACJC,KAAK,EAAA,IAAA;AACLC,QAAAA,IAAI,EAAEjK,gBAAiB;QACvBmK,SAAS,EAAE,SAAXA,SAASA,GAAA;UAAA,oBACP9H,cAAA,CAACyC,OAAO,EAAA;AAEJ3E,YAAAA,gBAAgB,EAAhBA,gBAAgB;AAChBF,YAAAA,UAAU,EAAVA,UAAU;AACVF,YAAAA,mBAAmB,EAAnBA,mBAAmB;AACnBG,YAAAA,gBAAgB,EAAhBA;AAAgB,WAEnB,CAAC;AAAA;AACF,OACH,CAAC,eACFmC,cAAA,CAAC0H,oBAAK,EAAA;QACJC,KAAK,EAAA,IAAA;AACLC,QAAAA,IAAI,EAAElK,mBAAoB;QAC1BoK,SAAS,EAAE,SAAXA,SAASA,GAAA;UAAA,oBACP9H,cAAA,CAAC2F,UAAU,EAAA;AAEPC,YAAAA,SAAS,EAATA,SAAS;AACT9H,YAAAA,gBAAgB,EAAhBA,gBAAgB;AAChBC,YAAAA,WAAW,EAAXA,WAAW;AACXF,YAAAA,gBAAgB,EAAhBA;AAAgB,WAEnB,CAAC;AAAA;AACF,OACH,CAAC;AAAA,KACI,CAAC;AAAA,GACA,CAAC;AAEhB;;;;"}
@@ -1,53 +0,0 @@
1
- 'use strict';
2
-
3
- var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
4
- var ExternalLink = require('@bigbinary/neeto-icons/ExternalLink');
5
- var CardLayout = require('@bigbinary/neeto-molecules/CardLayout');
6
- var Typography = require('@bigbinary/neetoui/Typography');
7
- var Button = require('@bigbinary/neetoui/Button');
8
- var StripeCheckoutSetting = require('./StripeCheckoutSetting.js');
9
- var jsxRuntime = require('react/jsx-runtime');
10
- require('@bigbinary/neetoui/Switch');
11
- require('@bigbinary/neetoui/Tooltip');
12
- require('react-i18next');
13
- require('@babel/runtime/helpers/defineProperty');
14
- require('@tanstack/react-query');
15
- require('ramda');
16
- require('axios');
17
- require('./index-KqkPP267.js');
18
- require('i18next');
19
- require('@bigbinary/neeto-commons-frontend/constants');
20
- require('decimal.js');
21
- require('@bigbinary/neeto-cist');
22
- require('@bigbinary/neeto-commons-frontend/utils');
23
- require('./queryConstants-Cka1X6GX.js');
24
-
25
- var StripeManage = reactUtils.withT(function (_ref) {
26
- var t = _ref.t,
27
- stripeAccount = _ref.stripeAccount;
28
- return /*#__PURE__*/jsxRuntime.jsx(CardLayout, {
29
- actionBlock: /*#__PURE__*/jsxRuntime.jsx(Button, {
30
- "data-cy": "stripe-manage-view-stripe-dashboard",
31
- href: "https://dashboard.stripe.com",
32
- icon: ExternalLink,
33
- label: t("neetoPayments.stripeManage.viewStripeDashboard"),
34
- style: "secondary",
35
- target: "_blank"
36
- }),
37
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
38
- className: "space-y-6",
39
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
40
- className: "flex justify-between w-full",
41
- children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
42
- style: "h3",
43
- children: t("neetoPayments.stripeManage.checkoutSettings.title")
44
- })
45
- }), /*#__PURE__*/jsxRuntime.jsx(StripeCheckoutSetting, {
46
- stripeAccount: stripeAccount
47
- })]
48
- })
49
- });
50
- });
51
-
52
- module.exports = StripeManage;
53
- //# sourceMappingURL=StripeManage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StripeManage.js","sources":["../../app/javascript/src/components/StripeManage.jsx"],"sourcesContent":["import { withT } from \"neetocommons/react-utils\";\nimport { ExternalLink } from \"neetoicons\";\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-cy=\"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","_ref","t","stripeAccount","_jsx","CardLayout","actionBlock","Button","href","icon","ExternalLink","label","style","target","children","_jsxs","className","Typography","StripeCheckoutSetting"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAMA,YAAY,GAAGC,gBAAK,CAAC,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,CAAC,GAAAD,IAAA,CAADC,CAAC;IAAEC,aAAa,GAAAF,IAAA,CAAbE,aAAa;EAAA,oBAC5CC,cAAA,CAACC,UAAU,EAAA;IACTC,WAAW,eACTF,cAAA,CAACG,MAAM,EAAA;AACL,MAAA,SAAA,EAAQ,qCAAqC;AAC7CC,MAAAA,IAAI,EAAC,8BAA8B;AACnCC,MAAAA,IAAI,EAAEC,YAAa;AACnBC,MAAAA,KAAK,EAAET,CAAC,CAAC,gDAAgD,CAAE;AAC3DU,MAAAA,KAAK,EAAC,WAAW;AACjBC,MAAAA,MAAM,EAAC;AAAQ,KAChB,CACF;AAAAC,IAAAA,QAAA,eAEDC,eAAA,CAAA,KAAA,EAAA;AAAKC,MAAAA,SAAS,EAAC,WAAW;AAAAF,MAAAA,QAAA,gBACxBV,cAAA,CAAA,KAAA,EAAA;AAAKY,QAAAA,SAAS,EAAC,6BAA6B;QAAAF,QAAA,eAC1CV,cAAA,CAACa,UAAU,EAAA;AAACL,UAAAA,KAAK,EAAC,IAAI;UAAAE,QAAA,EACnBZ,CAAC,CAAC,mDAAmD;SAC5C;AAAC,OACV,CAAC,eACNE,cAAA,CAACc,qBAAqB,EAAA;AAAOf,QAAAA,aAAa,EAAbA;AAAa,OAAK,CAAC;KAC7C;AAAC,GACI,CAAC;AAAA,CACd;;;;"}