@bigbinary/neeto-payments-frontend 4.0.8 → 4.0.10

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 (119) hide show
  1. package/app/javascript/src/translations/en.json +24 -1
  2. package/dist/AccountsDashboard.js +13 -34
  3. package/dist/AccountsDashboard.js.map +1 -1
  4. package/dist/AdminCancelRecurringPaymentButton.js +1 -1
  5. package/dist/CashPaymentButton.js +2 -2
  6. package/dist/ConfirmCashPaymentButton.js +2 -2
  7. package/dist/CustomerCancelRecurringPaymentForm.js +2 -2
  8. package/dist/{ExportModal-B4zqaXJ1.js → ExportModal-UegCpavy.js} +2 -2
  9. package/dist/{ExportModal-B4zqaXJ1.js.map → ExportModal-UegCpavy.js.map} +1 -1
  10. package/dist/ManualUpiConnect.js +2 -2
  11. package/dist/ManualUpiPayment.js +2 -2
  12. package/dist/ManualUpiPaymentConfirmButton.js +2 -2
  13. package/dist/ManualUpiPaymentRejectButton.js +2 -2
  14. package/dist/PaymentsDashboard.js +3 -3
  15. package/dist/PayoutsDashboard.js +5 -5
  16. package/dist/PayoutsPage.js +4 -4
  17. package/dist/RazorpayPaymentButton.js +2 -2
  18. package/dist/RecurringPaymentSettings.js +2 -2
  19. package/dist/RefundsDashboard.js +3 -3
  20. package/dist/SplitTransfersDashboard.js +3 -3
  21. package/dist/StripeConnect.js +362 -0
  22. package/dist/StripeConnect.js.map +1 -0
  23. package/dist/StripeManage.js +123 -0
  24. package/dist/StripeManage.js.map +1 -0
  25. package/dist/TaxesDashboard.js +2 -2
  26. package/dist/buildStripeTransactionLink.js +1 -1
  27. package/dist/cjs/AccountsDashboard.js +14 -35
  28. package/dist/cjs/AccountsDashboard.js.map +1 -1
  29. package/dist/cjs/AdminCancelRecurringPaymentButton.js +1 -1
  30. package/dist/cjs/CashPaymentButton.js +2 -2
  31. package/dist/cjs/ConfirmCashPaymentButton.js +2 -2
  32. package/dist/cjs/CustomerCancelRecurringPaymentForm.js +2 -2
  33. package/dist/cjs/{ExportModal-GI2FElh3.js → ExportModal-DxApGBel.js} +2 -2
  34. package/dist/cjs/{ExportModal-GI2FElh3.js.map → ExportModal-DxApGBel.js.map} +1 -1
  35. package/dist/cjs/ManualUpiConnect.js +2 -2
  36. package/dist/cjs/ManualUpiPayment.js +2 -2
  37. package/dist/cjs/ManualUpiPaymentConfirmButton.js +2 -2
  38. package/dist/cjs/ManualUpiPaymentRejectButton.js +2 -2
  39. package/dist/cjs/PaymentsDashboard.js +3 -3
  40. package/dist/cjs/PayoutsDashboard.js +5 -5
  41. package/dist/cjs/PayoutsPage.js +4 -4
  42. package/dist/cjs/RazorpayPaymentButton.js +2 -2
  43. package/dist/cjs/RecurringPaymentSettings.js +2 -2
  44. package/dist/cjs/RefundsDashboard.js +3 -3
  45. package/dist/cjs/SplitTransfersDashboard.js +3 -3
  46. package/dist/cjs/StripeConnect.js +383 -0
  47. package/dist/cjs/StripeConnect.js.map +1 -0
  48. package/dist/cjs/StripeManage.js +125 -0
  49. package/dist/cjs/StripeManage.js.map +1 -0
  50. package/dist/cjs/TaxesDashboard.js +2 -2
  51. package/dist/cjs/buildStripeTransactionLink.js +1 -1
  52. package/dist/cjs/constants.js +2 -1
  53. package/dist/cjs/constants.js.map +1 -1
  54. package/dist/cjs/{dashboard-DDW7FD1Q.js → dashboard-BS8RsSUN.js} +2 -2
  55. package/dist/cjs/{dashboard-DDW7FD1Q.js.map → dashboard-BS8RsSUN.js.map} +1 -1
  56. package/dist/cjs/getAmountInSmallestCurrencyUnit.js +1 -1
  57. package/dist/cjs/getAmountWithAppliedTax.js +1 -1
  58. package/dist/cjs/getFormattedAmount.js +1 -1
  59. package/dist/cjs/getFormattedTaxAmount.js +1 -1
  60. package/dist/cjs/getFormattedTipAmount.js +1 -1
  61. package/dist/cjs/getQrCodeValue.js +1 -1
  62. package/dist/cjs/getTaxAmount.js +1 -1
  63. package/dist/cjs/getTipAmount.js +1 -1
  64. package/dist/cjs/{index-RKMq21yy.js → index-D0lrwfeJ.js} +3 -1
  65. package/dist/cjs/{index-RKMq21yy.js.map → index-D0lrwfeJ.js.map} +1 -1
  66. package/dist/cjs/index.js +20 -9
  67. package/dist/cjs/index.js.map +1 -1
  68. package/dist/cjs/{queryConstants-D2ARfy8-.js → queryConstants-DwAnNVdh.js} +5 -2
  69. package/dist/cjs/queryConstants-DwAnNVdh.js.map +1 -0
  70. package/dist/cjs/{renderFunctions-9xNgMpUY.js → renderFunctions-pCev76XN.js} +2 -2
  71. package/dist/cjs/{renderFunctions-9xNgMpUY.js.map → renderFunctions-pCev76XN.js.map} +1 -1
  72. package/dist/cjs/useAccountsApi-BZBjuzQ9.js +62 -0
  73. package/dist/cjs/useAccountsApi-BZBjuzQ9.js.map +1 -0
  74. package/dist/cjs/useIntegrationsApi-CsGOvw5C.js +26 -0
  75. package/dist/cjs/useIntegrationsApi-CsGOvw5C.js.map +1 -0
  76. package/dist/cjs/{usePaymentApi-CMOLq2VR.js → usePaymentApi-CHAcirnx.js} +2 -2
  77. package/dist/cjs/{usePaymentApi-CMOLq2VR.js.map → usePaymentApi-CHAcirnx.js.map} +1 -1
  78. package/dist/cjs/{usePaymentApi-D9rbv9km.js → usePaymentApi-DoMBeLfx.js} +2 -2
  79. package/dist/cjs/{usePaymentApi-D9rbv9km.js.map → usePaymentApi-DoMBeLfx.js.map} +1 -1
  80. package/dist/cjs/{usePaymentApi-DU3yYSX5.js → usePaymentApi-qdh5LN7u.js} +2 -2
  81. package/dist/cjs/{usePaymentApi-DU3yYSX5.js.map → usePaymentApi-qdh5LN7u.js.map} +1 -1
  82. package/dist/cjs/{usePlatformApi-CmetBzFR.js → usePlatformApi-BP0LZThB.js} +3 -3
  83. package/dist/cjs/{usePlatformApi-CmetBzFR.js.map → usePlatformApi-BP0LZThB.js.map} +1 -1
  84. package/dist/cjs/useRazorpayPayment.js +2 -2
  85. package/dist/constants.js +1 -1
  86. package/dist/{dashboard-W7nZb7Nt.js → dashboard-BmgAk7ZF.js} +2 -2
  87. package/dist/{dashboard-W7nZb7Nt.js.map → dashboard-BmgAk7ZF.js.map} +1 -1
  88. package/dist/getAmountInSmallestCurrencyUnit.js +1 -1
  89. package/dist/getAmountWithAppliedTax.js +1 -1
  90. package/dist/getFormattedAmount.js +1 -1
  91. package/dist/getFormattedTaxAmount.js +1 -1
  92. package/dist/getFormattedTipAmount.js +1 -1
  93. package/dist/getQrCodeValue.js +1 -1
  94. package/dist/getTaxAmount.js +1 -1
  95. package/dist/getTipAmount.js +1 -1
  96. package/dist/{index-DrwJCsVB.js → index-P40XHLrP.js} +3 -2
  97. package/dist/{index-DrwJCsVB.js.map → index-P40XHLrP.js.map} +1 -1
  98. package/dist/index.js +18 -9
  99. package/dist/index.js.map +1 -1
  100. package/dist/{queryConstants-jobxv6K1.js → queryConstants-aYVM1oL2.js} +5 -2
  101. package/dist/queryConstants-aYVM1oL2.js.map +1 -0
  102. package/dist/{renderFunctions-CwG8PO6s.js → renderFunctions-ByiZ0trU.js} +2 -2
  103. package/dist/{renderFunctions-CwG8PO6s.js.map → renderFunctions-ByiZ0trU.js.map} +1 -1
  104. package/dist/useAccountsApi-CY07Pd2F.js +58 -0
  105. package/dist/useAccountsApi-CY07Pd2F.js.map +1 -0
  106. package/dist/useIntegrationsApi-Cm_61Wk1.js +24 -0
  107. package/dist/useIntegrationsApi-Cm_61Wk1.js.map +1 -0
  108. package/dist/{usePaymentApi--FTQFayz.js → usePaymentApi-BEsw6xFl.js} +2 -2
  109. package/dist/{usePaymentApi--FTQFayz.js.map → usePaymentApi-BEsw6xFl.js.map} +1 -1
  110. package/dist/{usePaymentApi-D57hcC0x.js → usePaymentApi-CnjUFTLo.js} +2 -2
  111. package/dist/{usePaymentApi-D57hcC0x.js.map → usePaymentApi-CnjUFTLo.js.map} +1 -1
  112. package/dist/{usePaymentApi-CnXIy7y7.js → usePaymentApi-DTQ8wxiL.js} +2 -2
  113. package/dist/{usePaymentApi-CnXIy7y7.js.map → usePaymentApi-DTQ8wxiL.js.map} +1 -1
  114. package/dist/{usePlatformApi-CG6LhSj3.js → usePlatformApi-OKTgTm_o.js} +3 -3
  115. package/dist/{usePlatformApi-CG6LhSj3.js.map → usePlatformApi-OKTgTm_o.js.map} +1 -1
  116. package/dist/useRazorpayPayment.js +2 -2
  117. package/package.json +3 -3
  118. package/dist/cjs/queryConstants-D2ARfy8-.js.map +0 -1
  119. package/dist/queryConstants-jobxv6K1.js.map +0 -1
@@ -10,13 +10,13 @@ var SubHeader = require('@bigbinary/neeto-molecules/SubHeader');
10
10
  var Tab = require('@bigbinary/neetoui/Tab');
11
11
  var Typography = require('@bigbinary/neetoui/Typography');
12
12
  var reactI18next = require('react-i18next');
13
- var dashboard = require('./dashboard-DDW7FD1Q.js');
13
+ var dashboard = require('./dashboard-BS8RsSUN.js');
14
14
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
15
15
  var Download = require('@bigbinary/neeto-icons/Download');
16
16
  var Button = require('@bigbinary/neetoui/Button');
17
17
  var Modal = require('@bigbinary/neetoui/Modal');
18
18
  var exportChannel = require('./exportChannel-BsZ3fusx.js');
19
- var constants = require('./index-RKMq21yy.js');
19
+ var constants = require('./index-D0lrwfeJ.js');
20
20
  var jsxRuntime = require('react/jsx-runtime');
21
21
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
22
22
  var neetoCist = require('@bigbinary/neeto-cist');
@@ -24,7 +24,7 @@ var utils = require('@bigbinary/neeto-commons-frontend/utils');
24
24
  var utils$1 = require('@bigbinary/neeto-filters-frontend/utils');
25
25
  var ramda = require('ramda');
26
26
  var reactRouterDom = require('react-router-dom');
27
- var renderFunctions = require('./renderFunctions-9xNgMpUY.js');
27
+ var renderFunctions = require('./renderFunctions-pCev76XN.js');
28
28
  var CopyButtonWrapper = require('./CopyButtonWrapper-CzQmYDby.js');
29
29
  var constants$1 = require('@bigbinary/neeto-commons-frontend/constants');
30
30
  var Columns = require('@bigbinary/neeto-molecules/Columns');
@@ -32,7 +32,7 @@ var TableWrapper = require('@bigbinary/neeto-molecules/TableWrapper');
32
32
  var Table = require('@bigbinary/neetoui/Table');
33
33
  var NoData = require('@bigbinary/neetoui/NoData');
34
34
  var Spinner = require('@bigbinary/neetoui/Spinner');
35
- var usePlatformApi = require('./usePlatformApi-CmetBzFR.js');
35
+ var usePlatformApi = require('./usePlatformApi-BP0LZThB.js');
36
36
  require('@tanstack/react-query');
37
37
  require('@tanstack/react-query-devtools');
38
38
  require('axios');
@@ -42,7 +42,7 @@ require('@bigbinary/neetoui/Tag');
42
42
  require('@bigbinary/neetoui/Tooltip');
43
43
  require('@bigbinary/neeto-molecules/CopyToClipboardButton');
44
44
  require('qs');
45
- require('./queryConstants-D2ARfy8-.js');
45
+ require('./queryConstants-DwAnNVdh.js');
46
46
 
47
47
  var TAB = {
48
48
  all: "all",
@@ -6,11 +6,11 @@ var Spinner = require('@bigbinary/neetoui/Spinner');
6
6
  var Typography = require('@bigbinary/neetoui/Typography');
7
7
  var reactI18next = require('react-i18next');
8
8
  var reactRouterDom = require('react-router-dom/cjs/react-router-dom');
9
- var renderFunctions = require('./renderFunctions-9xNgMpUY.js');
10
- var usePlatformApi = require('./usePlatformApi-CmetBzFR.js');
9
+ var renderFunctions = require('./renderFunctions-pCev76XN.js');
10
+ var usePlatformApi = require('./usePlatformApi-BP0LZThB.js');
11
11
  var Button = require('@bigbinary/neetoui/Button');
12
12
  var CopyButtonWrapper = require('./CopyButtonWrapper-CzQmYDby.js');
13
- var constants = require('./index-RKMq21yy.js');
13
+ var constants = require('./index-D0lrwfeJ.js');
14
14
  var jsxRuntime = require('react/jsx-runtime');
15
15
  require('i18next');
16
16
  require('@bigbinary/neeto-molecules/DateFormat');
@@ -23,7 +23,7 @@ require('@tanstack/react-query');
23
23
  require('@bigbinary/neeto-commons-frontend/react-utils');
24
24
  require('axios');
25
25
  require('qs');
26
- require('./queryConstants-D2ARfy8-.js');
26
+ require('./queryConstants-DwAnNVdh.js');
27
27
  require('@bigbinary/neeto-commons-frontend/constants');
28
28
  require('decimal.js');
29
29
  require('@bigbinary/neeto-commons-frontend/utils');
@@ -6,8 +6,8 @@ var neetoCist = require('@bigbinary/neeto-cist');
6
6
  var Button = require('@bigbinary/neetoui/Button');
7
7
  var ramda = require('ramda');
8
8
  var reactI18next = require('react-i18next');
9
- var usePaymentApi = require('./usePaymentApi-DU3yYSX5.js');
10
- var constants = require('./index-RKMq21yy.js');
9
+ var usePaymentApi = require('./usePaymentApi-qdh5LN7u.js');
10
+ var constants = require('./index-D0lrwfeJ.js');
11
11
  var jsxRuntime = require('react/jsx-runtime');
12
12
  require('@babel/runtime/helpers/defineProperty');
13
13
  require('@tanstack/react-query');
@@ -16,8 +16,8 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
16
16
  var reactQuery = require('@tanstack/react-query');
17
17
  var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
18
18
  var axios = require('axios');
19
- var constants = require('./index-RKMq21yy.js');
20
- var queryConstants = require('./queryConstants-D2ARfy8-.js');
19
+ var constants = require('./index-D0lrwfeJ.js');
20
+ var queryConstants = require('./queryConstants-DwAnNVdh.js');
21
21
  var i18next = require('i18next');
22
22
  var yup = require('yup');
23
23
  var jsxRuntime = require('react/jsx-runtime');
@@ -10,11 +10,11 @@ var utils$1 = require('@bigbinary/neeto-filters-frontend/utils');
10
10
  var Spinner = require('@bigbinary/neetoui/Spinner');
11
11
  var ramda = require('ramda');
12
12
  var reactRouterDom = require('react-router-dom');
13
- var ExportModal = require('./ExportModal-GI2FElh3.js');
13
+ var ExportModal = require('./ExportModal-DxApGBel.js');
14
14
  var reactQuery = require('@tanstack/react-query');
15
15
  var axios = require('axios');
16
- var constants = require('./index-RKMq21yy.js');
17
- var queryConstants = require('./queryConstants-D2ARfy8-.js');
16
+ var constants = require('./index-D0lrwfeJ.js');
17
+ var queryConstants = require('./queryConstants-DwAnNVdh.js');
18
18
  var i18next = require('i18next');
19
19
  var neetoCist = require('@bigbinary/neeto-cist');
20
20
  var Columns = require('@bigbinary/neeto-molecules/Columns');
@@ -10,12 +10,12 @@ var utils$1 = require('@bigbinary/neeto-filters-frontend/utils');
10
10
  var Spinner = require('@bigbinary/neetoui/Spinner');
11
11
  var ramda = require('ramda');
12
12
  var reactRouterDom = require('react-router-dom');
13
- var ExportModal = require('./ExportModal-GI2FElh3.js');
13
+ var ExportModal = require('./ExportModal-DxApGBel.js');
14
14
  var reactQuery = require('@tanstack/react-query');
15
15
  var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
16
16
  var axios = require('axios');
17
- var constants = require('./index-RKMq21yy.js');
18
- var queryConstants = require('./queryConstants-D2ARfy8-.js');
17
+ var constants = require('./index-D0lrwfeJ.js');
18
+ var queryConstants = require('./queryConstants-DwAnNVdh.js');
19
19
  var Modal = require('@bigbinary/neetoui/Modal');
20
20
  var Typography = require('@bigbinary/neetoui/Typography');
21
21
  var Form = require('@bigbinary/neetoui/formik/Form');
@@ -0,0 +1,383 @@
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-CsGOvw5C.js');
17
+ var constants = require('./index-D0lrwfeJ.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-BZBjuzQ9.js');
26
+ var reactQuery = require('@tanstack/react-query');
27
+ var axios = require('axios');
28
+ var queryConstants = require('./queryConstants-DwAnNVdh.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 POLLING_INTERVAL = 5000;
61
+ var MAX_POLLING_TIME = 30000;
62
+ var INITIAL_VALUES = {
63
+ country: "",
64
+ return_url: ""
65
+ };
66
+ var VALIDATION_SCHEMA = yup__namespace.object().shape({
67
+ country: yup__namespace.object().required(i18next.t("neetoPayments.validations.countryRequired"))
68
+ });
69
+
70
+ var sanitize = DOMPurify.sanitize;
71
+ var Account = function Account(_ref) {
72
+ var processingPageRoute = _ref.processingPageRoute,
73
+ countryPageRoute = _ref.countryPageRoute,
74
+ productNameLabel = _ref.productNameLabel,
75
+ getStripeAccount = _ref.getStripeAccount,
76
+ manageRoute = _ref.manageRoute;
77
+ var _useTranslation = reactI18next.useTranslation(),
78
+ t = _useTranslation.t;
79
+ var _useState = react.useState(INTEGRATION_METHOD.createNewAccount),
80
+ _useState2 = _slicedToArray(_useState, 2),
81
+ selectedOption = _useState2[0],
82
+ setSelectedOption = _useState2[1];
83
+ var history = reactRouterDom.useHistory();
84
+ var _useFetchPaymentInteg = useIntegrationsApi.useFetchPaymentIntegrations(),
85
+ _useFetchPaymentInteg2 = _useFetchPaymentInteg.data,
86
+ _useFetchPaymentInteg3 = _useFetchPaymentInteg2 === void 0 ? {} : _useFetchPaymentInteg2,
87
+ stripeStandardAccounts = _useFetchPaymentInteg3.stripeStandardAccounts;
88
+ var stripeAccount = getStripeAccount(stripeStandardAccounts);
89
+ var stripeConnectUrl = utils.buildUrl(constants.STRIPE_CONNECT_ENDPOINT, {
90
+ return_url: "".concat(window.location.origin).concat(processingPageRoute)
91
+ });
92
+ var handleSubmit = function handleSubmit() {
93
+ if (selectedOption !== INTEGRATION_METHOD.useExistingAccount) {
94
+ return history.push(countryPageRoute);
95
+ }
96
+ return window.location.href = sanitize(stripeConnectUrl);
97
+ };
98
+ react.useEffect(function () {
99
+ if (stripeAccount !== null && stripeAccount !== void 0 && stripeAccount.isConnected) {
100
+ history.push(manageRoute);
101
+ }
102
+ }, [stripeAccount === null || stripeAccount === void 0 ? void 0 : stripeAccount.isConnected]);
103
+ return /*#__PURE__*/jsxRuntime.jsx(CardLayout, {
104
+ icon: /*#__PURE__*/jsxRuntime.jsx(Stripe, {
105
+ size: 48
106
+ }),
107
+ title: t("neetoPayments.stripeConnect.title"),
108
+ actionBlock: /*#__PURE__*/jsxRuntime.jsx(Button, {
109
+ label: t("neetoPayments.common.continue"),
110
+ onClick: handleSubmit
111
+ }),
112
+ description: t("neetoPayments.stripeConnect.unlinkedDescription", {
113
+ productNameLabel: productNameLabel
114
+ }),
115
+ children: /*#__PURE__*/jsxRuntime.jsxs(Radio, {
116
+ value: selectedOption,
117
+ onChange: function onChange(_ref2) {
118
+ var value = _ref2.target.value;
119
+ return setSelectedOption(value);
120
+ },
121
+ children: [/*#__PURE__*/jsxRuntime.jsx(Radio.Item, {
122
+ label: t("neetoPayments.stripeConnect.createNewAccount"),
123
+ name: "accountMethod",
124
+ value: INTEGRATION_METHOD.createNewAccount
125
+ }), /*#__PURE__*/jsxRuntime.jsx(Radio.Item, {
126
+ label: t("neetoPayments.stripeConnect.useExistingAccount"),
127
+ name: "accountMethod",
128
+ value: INTEGRATION_METHOD.useExistingAccount
129
+ })]
130
+ })
131
+ });
132
+ };
133
+
134
+ var fetchCountries = function fetchCountries() {
135
+ return axios.get("".concat(constants.BASE_URL, "/api/v1/stripe/countries"));
136
+ };
137
+ var countriesApi = {
138
+ fetchCountries: fetchCountries
139
+ };
140
+
141
+ var useFetchStripeCountries = function useFetchStripeCountries() {
142
+ return reactQuery.useQuery({
143
+ queryKey: [queryConstants.QUERY_KEYS.STRIPE_COUNTRIES],
144
+ queryFn: countriesApi.fetchCountries
145
+ });
146
+ };
147
+
148
+ var buildRefreshUrl = function buildRefreshUrl(accountId, returnUrl) {
149
+ return "/payments/api/v1/stripe/callbacks/".concat(accountId, "/refresh?return_url=").concat(returnUrl);
150
+ };
151
+ var buildCountryOptions = function buildCountryOptions(countries) {
152
+ var _Object$entries;
153
+ return (_Object$entries = Object.entries(countries)) === null || _Object$entries === void 0 ? void 0 : _Object$entries.map(function (country) {
154
+ return {
155
+ label: neetoCist.humanize(country[0]),
156
+ value: country[1]
157
+ };
158
+ });
159
+ };
160
+
161
+ var Country = function Country(_ref) {
162
+ var processingPageRoute = _ref.processingPageRoute,
163
+ productNameLabel = _ref.productNameLabel;
164
+ var _useState = react.useState(false),
165
+ _useState2 = _slicedToArray(_useState, 2),
166
+ isPolling = _useState2[0],
167
+ setIsPolling = _useState2[1];
168
+ var _useTranslation = reactI18next.useTranslation(),
169
+ t = _useTranslation.t;
170
+ var history = reactRouterDom.useHistory();
171
+ var refetchInterval = function refetchInterval(query) {
172
+ var _ref2 = query.state.data || {},
173
+ jobStatus = _ref2.jobStatus,
174
+ onboarding = _ref2.onboarding;
175
+ if (jobStatus === "complete") {
176
+ window.open(onboarding === null || onboarding === void 0 ? void 0 : onboarding.url, "_self");
177
+ return false;
178
+ }
179
+ return POLLING_INTERVAL;
180
+ };
181
+ var _useCreateStripeAccou = useAccountsApi.useCreateStripeAccount({
182
+ onSuccess: function onSuccess() {
183
+ return setIsPolling(true);
184
+ }
185
+ }),
186
+ isCreating = _useCreateStripeAccou.isPending,
187
+ _useCreateStripeAccou2 = _useCreateStripeAccou.data,
188
+ _useCreateStripeAccou3 = _useCreateStripeAccou2 === void 0 ? {} : _useCreateStripeAccou2,
189
+ jobId = _useCreateStripeAccou3.jobId,
190
+ createStripeAccount = _useCreateStripeAccou.mutate;
191
+ var _useFetchStripeCountr = useFetchStripeCountries(),
192
+ isLoading = _useFetchStripeCountr.isLoading,
193
+ _useFetchStripeCountr2 = _useFetchStripeCountr.data,
194
+ _useFetchStripeCountr3 = _useFetchStripeCountr2 === void 0 ? {} : _useFetchStripeCountr2,
195
+ _useFetchStripeCountr4 = _useFetchStripeCountr3.countries,
196
+ countries = _useFetchStripeCountr4 === void 0 ? {} : _useFetchStripeCountr4;
197
+ useAccountsApi.usePollingStripeAccountCreationStatus(jobId, {
198
+ refetchInterval: refetchInterval,
199
+ enabled: neetoCist.isPresent(jobId)
200
+ });
201
+ var handleSubmit = function handleSubmit(values) {
202
+ var payload = {
203
+ returnUrl: "".concat(window.location.origin).concat(processingPageRoute),
204
+ country: values.country.value
205
+ };
206
+ createStripeAccount(payload);
207
+ };
208
+ if (isLoading) {
209
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
210
+ className: "flex items-center justify-center flex-grow w-full",
211
+ children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
212
+ });
213
+ }
214
+ return /*#__PURE__*/jsxRuntime.jsx(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(Stripe, {
224
+ size: 48
225
+ }),
226
+ title: t("neetoPayments.stripeConnect.title"),
227
+ actionBlock: /*#__PURE__*/jsxRuntime.jsx(ActionBlock, {
228
+ cancelButtonProps: {
229
+ onClick: function onClick() {
230
+ return history.goBack();
231
+ }
232
+ },
233
+ isSubmitting: isCreating || isPolling,
234
+ submitButtonProps: {
235
+ label: t("neetoPayments.common.connect")
236
+ }
237
+ }),
238
+ description: t("neetoPayments.stripeConnect.unlinkedDescription", {
239
+ productNameLabel: productNameLabel
240
+ }),
241
+ children: /*#__PURE__*/jsxRuntime.jsx(Select, {
242
+ required: true,
243
+ helpText: t("neetoPayments.stripeConnect.countryHelpText"),
244
+ label: t("neetoPayments.common.country"),
245
+ name: "country",
246
+ options: buildCountryOptions(countries),
247
+ placeholder: t("neetoPayments.stripeConnect.countryPlaceholder")
248
+ })
249
+ })
250
+ });
251
+ };
252
+
253
+ var Processing = function Processing(_ref) {
254
+ var getStripeAccount = _ref.getStripeAccount,
255
+ productNameLabel = _ref.productNameLabel,
256
+ manageRoute = _ref.manageRoute;
257
+ var _useState = react.useState(false),
258
+ _useState2 = _slicedToArray(_useState, 2),
259
+ isPolling = _useState2[0],
260
+ setIsPolling = _useState2[1];
261
+ var _useTranslation = reactI18next.useTranslation(),
262
+ t = _useTranslation.t;
263
+ var history = reactRouterDom.useHistory();
264
+ var _useQueryParams = reactUtils.useQueryParams(),
265
+ error = _useQueryParams.error,
266
+ errorDescription = _useQueryParams.errorDescription;
267
+ var refetchInterval = function refetchInterval(query) {
268
+ var _ref2 = query.state.data || {},
269
+ stripeStandardAccounts = _ref2.stripeStandardAccounts;
270
+ var stripeAccount = getStripeAccount(stripeStandardAccounts);
271
+ if (!(stripeAccount !== null && stripeAccount !== void 0 && stripeAccount.isConnected) && isPolling) {
272
+ return POLLING_INTERVAL;
273
+ }
274
+ if (stripeAccount !== null && stripeAccount !== void 0 && stripeAccount.isConnected) {
275
+ setIsPolling(false);
276
+ history.push(manageRoute);
277
+ }
278
+ return false;
279
+ };
280
+ var _useFetchPaymentInteg = useIntegrationsApi.useFetchPaymentIntegrations({
281
+ refetchInterval: refetchInterval,
282
+ enabled: neetoCist.isNotPresent(error)
283
+ }),
284
+ _useFetchPaymentInteg2 = _useFetchPaymentInteg.data,
285
+ _useFetchPaymentInteg3 = _useFetchPaymentInteg2 === void 0 ? {} : _useFetchPaymentInteg2,
286
+ stripeStandardAccounts = _useFetchPaymentInteg3.stripeStandardAccounts;
287
+ var stripeAccount = getStripeAccount(stripeStandardAccounts);
288
+ var isAccountProcessingFailed = neetoCist.isPresent(error) && neetoCist.isPresent(errorDescription) || !isPolling && !(stripeAccount !== null && stripeAccount !== void 0 && stripeAccount.isConnected);
289
+ react.useEffect(function () {
290
+ if (stripeAccount !== null && stripeAccount !== void 0 && stripeAccount.isConnected) {
291
+ history.push(manageRoute);
292
+ }
293
+ if (neetoCist.isNotPresent(error)) {
294
+ setIsPolling(true);
295
+ }
296
+ setInterval(function () {
297
+ setIsPolling(false);
298
+ }, MAX_POLLING_TIME);
299
+ }, []);
300
+ return /*#__PURE__*/jsxRuntime.jsxs(CardLayout, {
301
+ icon: /*#__PURE__*/jsxRuntime.jsx(Stripe, {
302
+ size: 48
303
+ }),
304
+ title: t("neetoPayments.stripeConnect.title"),
305
+ actionBlock: isAccountProcessingFailed && /*#__PURE__*/jsxRuntime.jsx(Button, {
306
+ href: buildRefreshUrl(stripeAccount === null || stripeAccount === void 0 ? void 0 : stripeAccount.id),
307
+ label: t("neetoPayments.common.tryAgain")
308
+ }),
309
+ description: t("neetoPayments.stripeConnect.linkedDescription", {
310
+ productNameLabel: productNameLabel
311
+ }),
312
+ children: [isPolling && /*#__PURE__*/jsxRuntime.jsx(Callout, {
313
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
314
+ className: "flex space-x-4",
315
+ children: [/*#__PURE__*/jsxRuntime.jsx(Spinner, {}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
316
+ style: "body1",
317
+ children: t("neetoPayments.stripeConnect.verifyingMessage")
318
+ })]
319
+ })
320
+ }), isAccountProcessingFailed && /*#__PURE__*/jsxRuntime.jsx(Callout, {
321
+ style: "danger",
322
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
323
+ style: "body1",
324
+ children: neetoCist.isPresent(errorDescription) ? neetoCist._humanize(errorDescription) : t("neetoPayments.stripeConnect.failedProcessing")
325
+ })
326
+ })]
327
+ });
328
+ };
329
+
330
+ var StripeConnect = function StripeConnect(_ref) {
331
+ var baseRoute = _ref.baseRoute,
332
+ manageRoute = _ref.manageRoute,
333
+ breadcrumbs = _ref.breadcrumbs,
334
+ productNameLabel = _ref.productNameLabel,
335
+ _ref$getStripeAccount = _ref.getStripeAccount,
336
+ getStripeAccount = _ref$getStripeAccount === void 0 ? neetoCist.noop : _ref$getStripeAccount;
337
+ var _useTranslation = reactI18next.useTranslation(),
338
+ t = _useTranslation.t;
339
+ var countryPageRoute = "".concat(baseRoute, "/countries");
340
+ var processingPageRoute = "".concat(baseRoute, "/processing");
341
+ return /*#__PURE__*/jsxRuntime.jsxs(Container, {
342
+ children: [/*#__PURE__*/jsxRuntime.jsx(Header, {
343
+ breadcrumbs: breadcrumbs,
344
+ title: t("neetoPayments.common.connect")
345
+ }), /*#__PURE__*/jsxRuntime.jsxs(reactRouterDom.Switch, {
346
+ children: [/*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
347
+ exact: true,
348
+ path: baseRoute,
349
+ render: function render() {
350
+ return /*#__PURE__*/jsxRuntime.jsx(Account, {
351
+ countryPageRoute: countryPageRoute,
352
+ getStripeAccount: getStripeAccount,
353
+ manageRoute: manageRoute,
354
+ processingPageRoute: processingPageRoute,
355
+ productNameLabel: productNameLabel
356
+ });
357
+ }
358
+ }), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
359
+ exact: true,
360
+ path: countryPageRoute,
361
+ component: function component() {
362
+ return /*#__PURE__*/jsxRuntime.jsx(Country, {
363
+ processingPageRoute: processingPageRoute,
364
+ productNameLabel: productNameLabel
365
+ });
366
+ }
367
+ }), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
368
+ exact: true,
369
+ path: processingPageRoute,
370
+ component: function component() {
371
+ return /*#__PURE__*/jsxRuntime.jsx(Processing, {
372
+ getStripeAccount: getStripeAccount,
373
+ manageRoute: manageRoute,
374
+ productNameLabel: productNameLabel
375
+ });
376
+ }
377
+ })]
378
+ })]
379
+ });
380
+ };
381
+
382
+ module.exports = StripeConnect;
383
+ //# 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};\nexport const POLLING_INTERVAL = 5000;\nexport const MAX_POLLING_TIME = 30000;\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 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 } = {} } =\n useFetchPaymentIntegrations();\n const stripeAccount = getStripeAccount(stripeStandardAccounts);\n\n const stripeConnectUrl = buildUrl(STRIPE_CONNECT_ENDPOINT, {\n return_url: `${window.location.origin}${processingPageRoute}`,\n });\n\n const handleSubmit = () => {\n if (selectedOption !== INTEGRATION_METHOD.useExistingAccount) {\n return history.push(countryPageRoute);\n }\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 `/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\";\n\nimport {\n INITIAL_VALUES,\n POLLING_INTERVAL,\n VALIDATION_SCHEMA,\n} from \"./constants\";\nimport { buildCountryOptions } from \"./utils\";\n\nconst Country = ({ processingPageRoute, productNameLabel }) => {\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 { isLoading, data: { countries = {} } = {} } =\n useFetchStripeCountries();\n\n usePollingStripeAccountCreationStatus(jobId, {\n refetchInterval,\n enabled: isPresent(jobId),\n });\n\n const handleSubmit = values => {\n const payload = {\n returnUrl: `${window.location.origin}${processingPageRoute}`,\n country: values.country.value,\n };\n createStripeAccount(payload);\n };\n\n if (isLoading) {\n return (\n <div className=\"flex items-center justify-center flex-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 { 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\";\n\nimport { MAX_POLLING_TIME, POLLING_INTERVAL } from \"./constants\";\nimport { buildRefreshUrl } from \"./utils\";\n\nconst Processing = ({ getStripeAccount, productNameLabel, manageRoute }) => {\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 } = query.state.data || {};\n const stripeAccount = getStripeAccount(stripeStandardAccounts);\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 } = {} } = useFetchPaymentIntegrations(\n { refetchInterval, enabled: isNotPresent(error) }\n );\n\n const stripeAccount = getStripeAccount(stripeStandardAccounts);\n const isAccountProcessingFailed =\n (isPresent(error) && isPresent(errorDescription)) ||\n (!isPolling && !stripeAccount?.isConnected);\n\n useEffect(() => {\n if (stripeAccount?.isConnected) {\n history.push(manageRoute);\n }\n\n if (isNotPresent(error)) {\n setIsPolling(true);\n }\n\n setInterval(() => {\n setIsPolling(false);\n }, MAX_POLLING_TIME);\n }, []);\n\n return (\n <CardLayout\n icon={<Stripe size={48} />}\n title={t(\"neetoPayments.stripeConnect.title\")}\n actionBlock={\n isAccountProcessingFailed && (\n <Button\n href={buildRefreshUrl(stripeAccount?.id)}\n label={t(\"neetoPayments.common.tryAgain\")}\n />\n )\n }\n description={t(\"neetoPayments.stripeConnect.linkedDescription\", {\n productNameLabel,\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 ? _humanize(errorDescription)\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 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 manageRoute,\n processingPageRoute,\n productNameLabel,\n }}\n />\n )}\n />\n <Route\n exact\n path={countryPageRoute}\n component={() => (\n <Country {...{ processingPageRoute, productNameLabel }} />\n )}\n />\n <Route\n exact\n path={processingPageRoute}\n component={() => (\n <Processing\n {...{ getStripeAccount, manageRoute, productNameLabel }}\n />\n )}\n />\n </Switch>\n </Container>\n );\n};\n\nexport default StripeConnect;\n"],"names":["INTEGRATION_METHOD","useExistingAccount","createNewAccount","POLLING_INTERVAL","MAX_POLLING_TIME","INITIAL_VALUES","country","return_url","VALIDATION_SCHEMA","yup","object","shape","required","t","sanitize","DOMPurify","Account","_ref","processingPageRoute","countryPageRoute","productNameLabel","getStripeAccount","manageRoute","_useTranslation","useTranslation","_useState","useState","_useState2","_slicedToArray","selectedOption","setSelectedOption","history","useHistory","_useFetchPaymentInteg","useFetchPaymentIntegrations","_useFetchPaymentInteg2","data","_useFetchPaymentInteg3","stripeStandardAccounts","stripeAccount","stripeConnectUrl","buildUrl","STRIPE_CONNECT_ENDPOINT","concat","window","location","origin","handleSubmit","push","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","isPolling","setIsPolling","refetchInterval","query","state","jobStatus","onboarding","open","url","_useCreateStripeAccou","useCreateStripeAccount","onSuccess","isCreating","isPending","_useCreateStripeAccou2","_useCreateStripeAccou3","jobId","createStripeAccount","mutate","_useFetchStripeCountr","isLoading","_useFetchStripeCountr2","_useFetchStripeCountr3","_useFetchStripeCountr4","usePollingStripeAccountCreationStatus","enabled","isPresent","values","payload","className","Spinner","Form","formikProps","enableReinitialize","initialValues","validationSchema","onSubmit","ActionBlock","cancelButtonProps","goBack","isSubmitting","submitButtonProps","Select","helpText","options","placeholder","Processing","_useQueryParams","useQueryParams","error","errorDescription","isNotPresent","isAccountProcessingFailed","setInterval","id","Callout","Typography","style","_humanize","StripeConnect","baseRoute","breadcrumbs","_ref$getStripeAccount","noop","Container","Header","Switch","Route","exact","path","render","component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQO,IAAMA,kBAAkB,GAAG;AAChCC,EAAAA,kBAAkB,EAAE,sBAAsB;AAC1CC,EAAAA,gBAAgB,EAAE;AACpB,CAAC;AACM,IAAMC,gBAAgB,GAAG,IAAI;AAC7B,IAAMC,gBAAgB,GAAG,KAAK;AAC9B,IAAMC,cAAc,GAAG;AAAEC,EAAAA,OAAO,EAAE,EAAE;AAAEC,EAAAA,UAAU,EAAE;AAAG,CAAC;AAEtD,IAAMC,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;;ACLF,IAAMC,QAAQ,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