@bigbinary/neeto-payments-frontend 3.3.0 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ConfirmUpiPaymentButton.js +148 -0
- package/dist/ConfirmUpiPaymentButton.js.map +1 -0
- package/dist/TaxesDashboard.js +13 -12
- package/dist/TaxesDashboard.js.map +1 -1
- package/dist/UpiPayment.js +113 -13
- package/dist/UpiPayment.js.map +1 -1
- package/dist/cjs/ConfirmUpiPaymentButton.js +169 -0
- package/dist/cjs/ConfirmUpiPaymentButton.js.map +1 -0
- package/dist/cjs/TaxesDashboard.js +13 -12
- package/dist/cjs/TaxesDashboard.js.map +1 -1
- package/dist/cjs/UpiPayment.js +129 -14
- package/dist/cjs/UpiPayment.js.map +1 -1
- package/dist/cjs/index.js +17 -131
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/usePaymentsApi-CRsEWHjO.js +41 -0
- package/dist/cjs/usePaymentsApi-CRsEWHjO.js.map +1 -0
- package/dist/index.js +15 -132
- package/dist/index.js.map +1 -1
- package/dist/usePaymentsApi-BwHtaZK6.js +38 -0
- package/dist/usePaymentsApi-BwHtaZK6.js.map +1 -0
- package/package.json +9 -9
- package/dist/cjs/index-Cad6GOm0.js +0 -178
- package/dist/cjs/index-Cad6GOm0.js.map +0 -1
- package/dist/index-BWLyK2S8.js +0 -154
- package/dist/index-BWLyK2S8.js.map +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -10,38 +10,35 @@ var RefundsDashboard = require('./RefundsDashboard.js');
|
|
|
10
10
|
var SplitTransfersDashboard = require('./SplitTransfersDashboard.js');
|
|
11
11
|
var StripeConnect = require('./StripeConnect.js');
|
|
12
12
|
var TaxesDashboard = require('./TaxesDashboard.js');
|
|
13
|
+
var ConfirmUpiPaymentButton = require('./ConfirmUpiPaymentButton.js');
|
|
13
14
|
var UpiConnect = require('./UpiConnect.js');
|
|
14
|
-
var UpiPayment = require('./
|
|
15
|
-
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
16
|
-
var React = require('react');
|
|
17
|
-
var neetoCist = require('@bigbinary/neeto-cist');
|
|
18
|
-
var Button = require('@bigbinary/neetoui/Button');
|
|
19
|
-
var Modal = require('@bigbinary/neetoui/Modal');
|
|
20
|
-
var Typography = require('@bigbinary/neetoui/Typography');
|
|
21
|
-
var Form = require('@bigbinary/neetoui/formik/Form');
|
|
22
|
-
var Textarea = require('@bigbinary/neetoui/formik/Textarea');
|
|
23
|
-
var Select = require('@bigbinary/neetoui/formik/Select');
|
|
24
|
-
var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
|
|
25
|
-
var reactI18next = require('react-i18next');
|
|
26
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
15
|
+
var UpiPayment = require('./UpiPayment.js');
|
|
27
16
|
var useRazorpayPayment = require('./useRazorpayPayment.js');
|
|
28
17
|
var useStripePromise = require('./useStripePromise.js');
|
|
29
18
|
var constants = require('./index-DFhiGrTx.js');
|
|
30
19
|
var CopyButtonWrapper = require('./CopyButtonWrapper-Ds1k64E0.js');
|
|
20
|
+
require('@babel/runtime/helpers/slicedToArray');
|
|
21
|
+
require('react');
|
|
31
22
|
require('i18next');
|
|
23
|
+
require('@bigbinary/neeto-cist');
|
|
32
24
|
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
33
25
|
require('@bigbinary/neeto-filters-frontend/Bar');
|
|
34
26
|
require('@bigbinary/neeto-molecules/Header');
|
|
35
27
|
require('@bigbinary/neeto-molecules/SubHeader');
|
|
36
28
|
require('@bigbinary/neetoui/Tab');
|
|
29
|
+
require('@bigbinary/neetoui/Typography');
|
|
30
|
+
require('react-i18next');
|
|
37
31
|
require('./dashboard-Bhh942b_.js');
|
|
38
32
|
require('@babel/runtime/helpers/defineProperty');
|
|
39
33
|
require('@tanstack/react-query');
|
|
40
34
|
require('@tanstack/react-query-devtools');
|
|
41
35
|
require('@bigbinary/neeto-commons-frontend/constants');
|
|
36
|
+
require('react/jsx-runtime');
|
|
42
37
|
require('axios');
|
|
43
38
|
require('ramda');
|
|
44
39
|
require('@bigbinary/neeto-icons/Download');
|
|
40
|
+
require('@bigbinary/neetoui/Button');
|
|
41
|
+
require('@bigbinary/neetoui/Modal');
|
|
45
42
|
require('./exportChannel-BsZ3fusx.js');
|
|
46
43
|
require('@bigbinary/neeto-commons-frontend/utils');
|
|
47
44
|
require('@babel/runtime/helpers/toConsumableArray');
|
|
@@ -67,6 +64,9 @@ require('react-router-dom/cjs/react-router-dom');
|
|
|
67
64
|
require('@babel/runtime/helpers/asyncToGenerator');
|
|
68
65
|
require('@babel/runtime/regenerator');
|
|
69
66
|
require('./usePaymentApi-Ct4IyY6F.js');
|
|
67
|
+
require('@bigbinary/neetoui/formik/Form');
|
|
68
|
+
require('@bigbinary/neetoui/formik/Textarea');
|
|
69
|
+
require('@bigbinary/neetoui/formik/ActionBlock');
|
|
70
70
|
require('yup');
|
|
71
71
|
require('@bigbinary/neeto-molecules/HelpPopover');
|
|
72
72
|
require('@bigbinary/neetoui/Pane');
|
|
@@ -74,6 +74,7 @@ require('@bigbinary/neetoui/Dropdown');
|
|
|
74
74
|
require('neetointegrations/Demo');
|
|
75
75
|
require('neetointegrations/Modal');
|
|
76
76
|
require('@bigbinary/neetoui/Label');
|
|
77
|
+
require('@bigbinary/neetoui/formik/Select');
|
|
77
78
|
require('dompurify');
|
|
78
79
|
require('@bigbinary/neetoui/Radio');
|
|
79
80
|
require('neetointegrations/Finish');
|
|
@@ -82,126 +83,11 @@ require('@bigbinary/neeto-molecules/PageLoader');
|
|
|
82
83
|
require('@bigbinary/neetoui/formik/Input');
|
|
83
84
|
require('@bigbinary/neetoui/formik/Radio');
|
|
84
85
|
require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
86
|
+
require('./usePaymentsApi-CRsEWHjO.js');
|
|
85
87
|
require('qrcode.react');
|
|
86
88
|
require('@bigbinary/neeto-commons-frontend/initializers');
|
|
87
89
|
require('@bigbinary/neeto-molecules/CopyToClipboardButton');
|
|
88
90
|
|
|
89
|
-
var ConfirmButton = function ConfirmButton(_ref) {
|
|
90
|
-
var vpas = _ref.vpas,
|
|
91
|
-
identifier = _ref.identifier,
|
|
92
|
-
paymentId = _ref.paymentId,
|
|
93
|
-
payableId = _ref.payableId,
|
|
94
|
-
_ref$onSuccess = _ref.onSuccess,
|
|
95
|
-
onSuccess = _ref$onSuccess === void 0 ? neetoCist.noop : _ref$onSuccess;
|
|
96
|
-
var _useState = React.useState(false),
|
|
97
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
98
|
-
isModalOpen = _useState2[0],
|
|
99
|
-
setIsModalOpen = _useState2[1];
|
|
100
|
-
var _useTranslation = reactI18next.useTranslation(),
|
|
101
|
-
t = _useTranslation.t;
|
|
102
|
-
var _useUpdateUpiPayment = UpiPayment.useUpdateUpiPayment(paymentId, {
|
|
103
|
-
onSuccess: onSuccess
|
|
104
|
-
}),
|
|
105
|
-
updateUpiPayment = _useUpdateUpiPayment.mutate,
|
|
106
|
-
isPending = _useUpdateUpiPayment.isPending;
|
|
107
|
-
var onClose = function onClose() {
|
|
108
|
-
return setIsModalOpen(false);
|
|
109
|
-
};
|
|
110
|
-
var handleSubmit = function handleSubmit(_ref2) {
|
|
111
|
-
var vpaId = _ref2.vpaId,
|
|
112
|
-
notes = _ref2.notes;
|
|
113
|
-
var vpa = neetoCist.findBy({
|
|
114
|
-
id: vpaId
|
|
115
|
-
}, vpas);
|
|
116
|
-
var payload = {
|
|
117
|
-
notes: notes,
|
|
118
|
-
vpaId: vpaId,
|
|
119
|
-
payableId: payableId,
|
|
120
|
-
upiId: vpa.upiId,
|
|
121
|
-
status: "successful"
|
|
122
|
-
};
|
|
123
|
-
updateUpiPayment(payload);
|
|
124
|
-
};
|
|
125
|
-
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
126
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
127
|
-
label: t("neetoPayments.upi.payment.buttons.confirmPayment"),
|
|
128
|
-
loading: isPending,
|
|
129
|
-
size: "small",
|
|
130
|
-
style: "secondary",
|
|
131
|
-
onClick: function onClick() {
|
|
132
|
-
return setIsModalOpen(true);
|
|
133
|
-
}
|
|
134
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(Modal, {
|
|
135
|
-
onClose: onClose,
|
|
136
|
-
isOpen: isModalOpen,
|
|
137
|
-
size: "large",
|
|
138
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Modal.Header, {
|
|
139
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
140
|
-
style: "h2",
|
|
141
|
-
children: t("neetoPayments.upi.confirmModal.title")
|
|
142
|
-
})
|
|
143
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Form, {
|
|
144
|
-
formikProps: {
|
|
145
|
-
enableReinitialize: true,
|
|
146
|
-
onSubmit: handleSubmit,
|
|
147
|
-
initialValues: UpiPayment.CONFIRM_FORM_INITIAL_VALUE,
|
|
148
|
-
validationSchema: UpiPayment.CONFIRM_FORM_VALIDATION_SCHEMA
|
|
149
|
-
},
|
|
150
|
-
children: function children(_ref3) {
|
|
151
|
-
var setFieldValue = _ref3.setFieldValue;
|
|
152
|
-
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
153
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Modal.Body, {
|
|
154
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
155
|
-
className: "flex flex-col space-y-4",
|
|
156
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
157
|
-
lineHeight: "normal",
|
|
158
|
-
style: "body2",
|
|
159
|
-
children: t("neetoPayments.upi.confirmModal.upiTransactionId", {
|
|
160
|
-
identifier: identifier
|
|
161
|
-
})
|
|
162
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Select, {
|
|
163
|
-
label: t("neetoPayments.upi.confirmModal.accountIdLabel"),
|
|
164
|
-
name: "vpaId",
|
|
165
|
-
options: vpas === null || vpas === void 0 ? void 0 : vpas.map(function (_ref4) {
|
|
166
|
-
var address = _ref4.address,
|
|
167
|
-
id = _ref4.id;
|
|
168
|
-
return {
|
|
169
|
-
label: address,
|
|
170
|
-
value: id
|
|
171
|
-
};
|
|
172
|
-
}),
|
|
173
|
-
onChange: function onChange(_ref5) {
|
|
174
|
-
var value = _ref5.value;
|
|
175
|
-
return setFieldValue("vpaId", value);
|
|
176
|
-
}
|
|
177
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Textarea, {
|
|
178
|
-
"data-cy": "confirm-booking-modal-input-textfield",
|
|
179
|
-
label: t("neetoPayments.upi.confirmModal.notes"),
|
|
180
|
-
name: "notes",
|
|
181
|
-
placeholder: t("neetoPayments.upi.confirmModal.notesPlaceholder")
|
|
182
|
-
})]
|
|
183
|
-
})
|
|
184
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Modal.Footer, {
|
|
185
|
-
className: "space-x-2",
|
|
186
|
-
children: /*#__PURE__*/jsxRuntime.jsx(ActionBlock, {
|
|
187
|
-
isSubmitting: isPending,
|
|
188
|
-
position: "right",
|
|
189
|
-
cancelButtonProps: {
|
|
190
|
-
onClick: onClose,
|
|
191
|
-
style: "tertiary"
|
|
192
|
-
},
|
|
193
|
-
submitButtonProps: {
|
|
194
|
-
label: t("neetoPayments.common.confirm")
|
|
195
|
-
}
|
|
196
|
-
})
|
|
197
|
-
})]
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
})]
|
|
201
|
-
})]
|
|
202
|
-
});
|
|
203
|
-
};
|
|
204
|
-
|
|
205
91
|
var css = ".ant-table-cell-row-hover .identifier-copy-button{visibility:visible!important}";
|
|
206
92
|
CopyButtonWrapper.n(css,{});
|
|
207
93
|
|
|
@@ -215,11 +101,11 @@ exports.RefundsDashboard = RefundsDashboard;
|
|
|
215
101
|
exports.SplitTransfersDashboard = SplitTransfersDashboard;
|
|
216
102
|
exports.StripeConnect = StripeConnect;
|
|
217
103
|
exports.TaxesDashboard = TaxesDashboard;
|
|
104
|
+
exports.ConfirmUpiPaymentButton = ConfirmUpiPaymentButton;
|
|
218
105
|
exports.UpiConnect = UpiConnect;
|
|
219
|
-
exports.UpiPayment = UpiPayment
|
|
106
|
+
exports.UpiPayment = UpiPayment;
|
|
220
107
|
exports.useRazorpayPayment = useRazorpayPayment;
|
|
221
108
|
exports.useStripePromise = useStripePromise;
|
|
222
109
|
exports.CURRENCY_OPTIONS = constants.CURRENCY_OPTIONS;
|
|
223
110
|
exports.buildStripeTransactionLink = constants.buildStripeTransactionLink;
|
|
224
|
-
exports.ConfirmButton = ConfirmButton;
|
|
225
111
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
var reactQuery = require('@tanstack/react-query');
|
|
5
|
+
var axios = require('axios');
|
|
6
|
+
var constants = require('./index-DFhiGrTx.js');
|
|
7
|
+
|
|
8
|
+
var create = function create(payload) {
|
|
9
|
+
return axios.post("".concat(constants.BASE_URL, "/api/v1/public/upi/payments"), {
|
|
10
|
+
payment: payload
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var update = function update(id, payload) {
|
|
14
|
+
return axios.put("".concat(constants.BASE_URL, "/api/v1/upi/payments/").concat(id), {
|
|
15
|
+
payment: payload
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
var paymentsApi = {
|
|
19
|
+
create: create,
|
|
20
|
+
update: update
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
24
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
25
|
+
var useCreateUpiPayment = function useCreateUpiPayment(options) {
|
|
26
|
+
return reactQuery.useMutation(_objectSpread({
|
|
27
|
+
mutationFn: paymentsApi.create
|
|
28
|
+
}, options));
|
|
29
|
+
};
|
|
30
|
+
var useUpdateUpiPayment = function useUpdateUpiPayment(id) {
|
|
31
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
32
|
+
return reactQuery.useMutation(_objectSpread({
|
|
33
|
+
mutationFn: function mutationFn(payload) {
|
|
34
|
+
return paymentsApi.update(id, payload);
|
|
35
|
+
}
|
|
36
|
+
}, options));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
exports.useCreateUpiPayment = useCreateUpiPayment;
|
|
40
|
+
exports.useUpdateUpiPayment = useUpdateUpiPayment;
|
|
41
|
+
//# sourceMappingURL=usePaymentsApi-CRsEWHjO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePaymentsApi-CRsEWHjO.js","sources":["../../app/javascript/src/apis/upi/payments.js","../../app/javascript/src/hooks/reactQuery/upi/usePaymentsApi.js"],"sourcesContent":["import axios from \"axios\";\n\nimport { BASE_URL } from \"src/constants\";\n\nconst create = payload =>\n axios.post(`${BASE_URL}/api/v1/public/upi/payments`, {\n payment: payload,\n });\n\nconst update = (id, payload) =>\n axios.put(`${BASE_URL}/api/v1/upi/payments/${id}`, {\n payment: payload,\n });\n\nconst paymentsApi = { create, update };\n\nexport default paymentsApi;\n","import { useMutation } from \"@tanstack/react-query\";\n\nimport paymentsApi from \"apis/upi/payments\";\n\nexport const useCreateUpiPayment = options =>\n useMutation({ mutationFn: paymentsApi.create, ...options });\n\nexport const useUpdateUpiPayment = (id, options = {}) =>\n useMutation({\n mutationFn: payload => paymentsApi.update(id, payload),\n ...options,\n });\n"],"names":["create","payload","axios","post","concat","BASE_URL","payment","update","id","put","paymentsApi","useCreateUpiPayment","options","useMutation","_objectSpread","mutationFn","useUpdateUpiPayment","arguments","length","undefined"],"mappings":";;;;;;;AAIA,IAAMA,MAAM,GAAG,SAATA,MAAMA,CAAGC,OAAO,EAAA;AAAA,EAAA,OACpBC,KAAK,CAACC,IAAI,IAAAC,MAAA,CAAIC,kBAAQ,EAA+B,6BAAA,CAAA,EAAA;AACnDC,IAAAA,OAAO,EAAEL;AACX,GAAC,CAAC;AAAA,CAAA;AAEJ,IAAMM,MAAM,GAAG,SAATA,MAAMA,CAAIC,EAAE,EAAEP,OAAO,EAAA;EAAA,OACzBC,KAAK,CAACO,GAAG,CAAAL,EAAAA,CAAAA,MAAA,CAAIC,kBAAQ,EAAAD,uBAAAA,CAAAA,CAAAA,MAAA,CAAwBI,EAAE,CAAI,EAAA;AACjDF,IAAAA,OAAO,EAAEL;AACX,GAAC,CAAC;AAAA,CAAA;AAEJ,IAAMS,WAAW,GAAG;AAAEV,EAAAA,MAAM,EAANA,MAAM;AAAEO,EAAAA,MAAM,EAANA;AAAO,CAAC;;;;ICVzBI,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAGC,OAAO,EAAA;EAAA,OACxCC,sBAAW,CAAAC,aAAA,CAAA;IAAGC,UAAU,EAAEL,WAAW,CAACV;GAAWY,EAAAA,OAAO,CAAE,CAAC;AAAA;IAEhDI,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIR,EAAE,EAAA;AAAA,EAAA,IAAEI,OAAO,GAAAK,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,EAAE;EAAA,OAClDJ,sBAAW,CAAAC,aAAA,CAAA;AACTC,IAAAA,UAAU,EAAE,SAAZA,UAAUA,CAAEd,OAAO,EAAA;AAAA,MAAA,OAAIS,WAAW,CAACH,MAAM,CAACC,EAAE,EAAEP,OAAO,CAAC;AAAA;GACnDW,EAAAA,OAAO,CACX,CAAC;AAAA;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -8,39 +8,35 @@ export { default as RefundsDashboard } from './RefundsDashboard.js';
|
|
|
8
8
|
export { default as SplitTransfersDashboard } from './SplitTransfersDashboard.js';
|
|
9
9
|
export { default as StripeConnect } from './StripeConnect.js';
|
|
10
10
|
export { default as TaxesDashboard } from './TaxesDashboard.js';
|
|
11
|
+
export { default as ConfirmUpiPaymentButton } from './ConfirmUpiPaymentButton.js';
|
|
11
12
|
export { default as UpiConnect } from './UpiConnect.js';
|
|
12
|
-
|
|
13
|
-
export { U as UpiPayment } from './index-BWLyK2S8.js';
|
|
14
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
15
|
-
import { useState } from 'react';
|
|
16
|
-
import { findBy, noop } from '@bigbinary/neeto-cist';
|
|
17
|
-
import Button from '@bigbinary/neetoui/Button';
|
|
18
|
-
import Modal from '@bigbinary/neetoui/Modal';
|
|
19
|
-
import Typography from '@bigbinary/neetoui/Typography';
|
|
20
|
-
import Form from '@bigbinary/neetoui/formik/Form';
|
|
21
|
-
import Textarea from '@bigbinary/neetoui/formik/Textarea';
|
|
22
|
-
import Select from '@bigbinary/neetoui/formik/Select';
|
|
23
|
-
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
24
|
-
import { useTranslation } from 'react-i18next';
|
|
25
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
13
|
+
export { default as UpiPayment } from './UpiPayment.js';
|
|
26
14
|
export { default as useRazorpayPayment } from './useRazorpayPayment.js';
|
|
27
15
|
export { default as useStripePromise } from './useStripePromise.js';
|
|
28
16
|
export { C as CURRENCY_OPTIONS, b as buildStripeTransactionLink } from './index-Cl511Juk.js';
|
|
29
17
|
import { n } from './CopyButtonWrapper-SoJkwX-d.js';
|
|
18
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
19
|
+
import 'react';
|
|
30
20
|
import 'i18next';
|
|
21
|
+
import '@bigbinary/neeto-cist';
|
|
31
22
|
import '@bigbinary/neeto-commons-frontend/react-utils';
|
|
32
23
|
import '@bigbinary/neeto-filters-frontend/Bar';
|
|
33
24
|
import '@bigbinary/neeto-molecules/Header';
|
|
34
25
|
import '@bigbinary/neeto-molecules/SubHeader';
|
|
35
26
|
import '@bigbinary/neetoui/Tab';
|
|
27
|
+
import '@bigbinary/neetoui/Typography';
|
|
28
|
+
import 'react-i18next';
|
|
36
29
|
import './dashboard-BWze-7eb.js';
|
|
37
30
|
import '@babel/runtime/helpers/defineProperty';
|
|
38
31
|
import '@tanstack/react-query';
|
|
39
32
|
import '@tanstack/react-query-devtools';
|
|
40
33
|
import '@bigbinary/neeto-commons-frontend/constants';
|
|
34
|
+
import 'react/jsx-runtime';
|
|
41
35
|
import 'axios';
|
|
42
36
|
import 'ramda';
|
|
43
37
|
import '@bigbinary/neeto-icons/Download';
|
|
38
|
+
import '@bigbinary/neetoui/Button';
|
|
39
|
+
import '@bigbinary/neetoui/Modal';
|
|
44
40
|
import './exportChannel-CViICC6x.js';
|
|
45
41
|
import '@bigbinary/neeto-commons-frontend/utils';
|
|
46
42
|
import '@babel/runtime/helpers/toConsumableArray';
|
|
@@ -66,6 +62,9 @@ import 'react-router-dom/cjs/react-router-dom';
|
|
|
66
62
|
import '@babel/runtime/helpers/asyncToGenerator';
|
|
67
63
|
import '@babel/runtime/regenerator';
|
|
68
64
|
import './usePaymentApi-DiWHWkBI.js';
|
|
65
|
+
import '@bigbinary/neetoui/formik/Form';
|
|
66
|
+
import '@bigbinary/neetoui/formik/Textarea';
|
|
67
|
+
import '@bigbinary/neetoui/formik/ActionBlock';
|
|
69
68
|
import 'yup';
|
|
70
69
|
import '@bigbinary/neeto-molecules/HelpPopover';
|
|
71
70
|
import '@bigbinary/neetoui/Pane';
|
|
@@ -73,6 +72,7 @@ import '@bigbinary/neetoui/Dropdown';
|
|
|
73
72
|
import 'neetointegrations/Demo';
|
|
74
73
|
import 'neetointegrations/Modal';
|
|
75
74
|
import '@bigbinary/neetoui/Label';
|
|
75
|
+
import '@bigbinary/neetoui/formik/Select';
|
|
76
76
|
import 'dompurify';
|
|
77
77
|
import '@bigbinary/neetoui/Radio';
|
|
78
78
|
import 'neetointegrations/Finish';
|
|
@@ -81,128 +81,11 @@ import '@bigbinary/neeto-molecules/PageLoader';
|
|
|
81
81
|
import '@bigbinary/neetoui/formik/Input';
|
|
82
82
|
import '@bigbinary/neetoui/formik/Radio';
|
|
83
83
|
import '@bigbinary/neeto-molecules/MoreDropdown';
|
|
84
|
+
import './usePaymentsApi-BwHtaZK6.js';
|
|
84
85
|
import 'qrcode.react';
|
|
85
86
|
import '@bigbinary/neeto-commons-frontend/initializers';
|
|
86
87
|
import '@bigbinary/neeto-molecules/CopyToClipboardButton';
|
|
87
88
|
|
|
88
|
-
var ConfirmButton = function ConfirmButton(_ref) {
|
|
89
|
-
var vpas = _ref.vpas,
|
|
90
|
-
identifier = _ref.identifier,
|
|
91
|
-
paymentId = _ref.paymentId,
|
|
92
|
-
payableId = _ref.payableId,
|
|
93
|
-
_ref$onSuccess = _ref.onSuccess,
|
|
94
|
-
onSuccess = _ref$onSuccess === void 0 ? noop : _ref$onSuccess;
|
|
95
|
-
var _useState = useState(false),
|
|
96
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
97
|
-
isModalOpen = _useState2[0],
|
|
98
|
-
setIsModalOpen = _useState2[1];
|
|
99
|
-
var _useTranslation = useTranslation(),
|
|
100
|
-
t = _useTranslation.t;
|
|
101
|
-
var _useUpdateUpiPayment = useUpdateUpiPayment(paymentId, {
|
|
102
|
-
onSuccess: onSuccess
|
|
103
|
-
}),
|
|
104
|
-
updateUpiPayment = _useUpdateUpiPayment.mutate,
|
|
105
|
-
isPending = _useUpdateUpiPayment.isPending;
|
|
106
|
-
var onClose = function onClose() {
|
|
107
|
-
return setIsModalOpen(false);
|
|
108
|
-
};
|
|
109
|
-
var handleSubmit = function handleSubmit(_ref2) {
|
|
110
|
-
var vpaId = _ref2.vpaId,
|
|
111
|
-
notes = _ref2.notes;
|
|
112
|
-
var vpa = findBy({
|
|
113
|
-
id: vpaId
|
|
114
|
-
}, vpas);
|
|
115
|
-
var payload = {
|
|
116
|
-
notes: notes,
|
|
117
|
-
vpaId: vpaId,
|
|
118
|
-
payableId: payableId,
|
|
119
|
-
upiId: vpa.upiId,
|
|
120
|
-
status: "successful"
|
|
121
|
-
};
|
|
122
|
-
updateUpiPayment(payload);
|
|
123
|
-
};
|
|
124
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
125
|
-
children: [/*#__PURE__*/jsx(Button, {
|
|
126
|
-
label: t("neetoPayments.upi.payment.buttons.confirmPayment"),
|
|
127
|
-
loading: isPending,
|
|
128
|
-
size: "small",
|
|
129
|
-
style: "secondary",
|
|
130
|
-
onClick: function onClick() {
|
|
131
|
-
return setIsModalOpen(true);
|
|
132
|
-
}
|
|
133
|
-
}), /*#__PURE__*/jsxs(Modal, {
|
|
134
|
-
onClose: onClose,
|
|
135
|
-
isOpen: isModalOpen,
|
|
136
|
-
size: "large",
|
|
137
|
-
children: [/*#__PURE__*/jsx(Modal.Header, {
|
|
138
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
139
|
-
style: "h2",
|
|
140
|
-
children: t("neetoPayments.upi.confirmModal.title")
|
|
141
|
-
})
|
|
142
|
-
}), /*#__PURE__*/jsx(Form, {
|
|
143
|
-
formikProps: {
|
|
144
|
-
enableReinitialize: true,
|
|
145
|
-
onSubmit: handleSubmit,
|
|
146
|
-
initialValues: CONFIRM_FORM_INITIAL_VALUE,
|
|
147
|
-
validationSchema: CONFIRM_FORM_VALIDATION_SCHEMA
|
|
148
|
-
},
|
|
149
|
-
children: function children(_ref3) {
|
|
150
|
-
var setFieldValue = _ref3.setFieldValue;
|
|
151
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
152
|
-
children: [/*#__PURE__*/jsx(Modal.Body, {
|
|
153
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
154
|
-
className: "flex flex-col space-y-4",
|
|
155
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
156
|
-
lineHeight: "normal",
|
|
157
|
-
style: "body2",
|
|
158
|
-
children: t("neetoPayments.upi.confirmModal.upiTransactionId", {
|
|
159
|
-
identifier: identifier
|
|
160
|
-
})
|
|
161
|
-
}), /*#__PURE__*/jsx(Select, {
|
|
162
|
-
label: t("neetoPayments.upi.confirmModal.accountIdLabel"),
|
|
163
|
-
name: "vpaId",
|
|
164
|
-
options: vpas === null || vpas === void 0 ? void 0 : vpas.map(function (_ref4) {
|
|
165
|
-
var address = _ref4.address,
|
|
166
|
-
id = _ref4.id;
|
|
167
|
-
return {
|
|
168
|
-
label: address,
|
|
169
|
-
value: id
|
|
170
|
-
};
|
|
171
|
-
}),
|
|
172
|
-
onChange: function onChange(_ref5) {
|
|
173
|
-
var value = _ref5.value;
|
|
174
|
-
return setFieldValue("vpaId", value);
|
|
175
|
-
}
|
|
176
|
-
}), /*#__PURE__*/jsx(Textarea, {
|
|
177
|
-
"data-cy": "confirm-booking-modal-input-textfield",
|
|
178
|
-
label: t("neetoPayments.upi.confirmModal.notes"),
|
|
179
|
-
name: "notes",
|
|
180
|
-
placeholder: t("neetoPayments.upi.confirmModal.notesPlaceholder")
|
|
181
|
-
})]
|
|
182
|
-
})
|
|
183
|
-
}), /*#__PURE__*/jsx(Modal.Footer, {
|
|
184
|
-
className: "space-x-2",
|
|
185
|
-
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
186
|
-
isSubmitting: isPending,
|
|
187
|
-
position: "right",
|
|
188
|
-
cancelButtonProps: {
|
|
189
|
-
onClick: onClose,
|
|
190
|
-
style: "tertiary"
|
|
191
|
-
},
|
|
192
|
-
submitButtonProps: {
|
|
193
|
-
label: t("neetoPayments.common.confirm")
|
|
194
|
-
}
|
|
195
|
-
})
|
|
196
|
-
})]
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
})]
|
|
200
|
-
})]
|
|
201
|
-
});
|
|
202
|
-
};
|
|
203
|
-
|
|
204
89
|
var css = ".ant-table-cell-row-hover .identifier-copy-button{visibility:visible!important}";
|
|
205
90
|
n(css,{});
|
|
206
|
-
|
|
207
|
-
export { ConfirmButton };
|
|
208
91
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import { useMutation } from '@tanstack/react-query';
|
|
3
|
+
import axios from 'axios';
|
|
4
|
+
import { B as BASE_URL } from './index-Cl511Juk.js';
|
|
5
|
+
|
|
6
|
+
var create = function create(payload) {
|
|
7
|
+
return axios.post("".concat(BASE_URL, "/api/v1/public/upi/payments"), {
|
|
8
|
+
payment: payload
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var update = function update(id, payload) {
|
|
12
|
+
return axios.put("".concat(BASE_URL, "/api/v1/upi/payments/").concat(id), {
|
|
13
|
+
payment: payload
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
var paymentsApi = {
|
|
17
|
+
create: create,
|
|
18
|
+
update: update
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
|
+
var useCreateUpiPayment = function useCreateUpiPayment(options) {
|
|
24
|
+
return useMutation(_objectSpread({
|
|
25
|
+
mutationFn: paymentsApi.create
|
|
26
|
+
}, options));
|
|
27
|
+
};
|
|
28
|
+
var useUpdateUpiPayment = function useUpdateUpiPayment(id) {
|
|
29
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
30
|
+
return useMutation(_objectSpread({
|
|
31
|
+
mutationFn: function mutationFn(payload) {
|
|
32
|
+
return paymentsApi.update(id, payload);
|
|
33
|
+
}
|
|
34
|
+
}, options));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { useCreateUpiPayment as a, useUpdateUpiPayment as u };
|
|
38
|
+
//# sourceMappingURL=usePaymentsApi-BwHtaZK6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePaymentsApi-BwHtaZK6.js","sources":["../app/javascript/src/apis/upi/payments.js","../app/javascript/src/hooks/reactQuery/upi/usePaymentsApi.js"],"sourcesContent":["import axios from \"axios\";\n\nimport { BASE_URL } from \"src/constants\";\n\nconst create = payload =>\n axios.post(`${BASE_URL}/api/v1/public/upi/payments`, {\n payment: payload,\n });\n\nconst update = (id, payload) =>\n axios.put(`${BASE_URL}/api/v1/upi/payments/${id}`, {\n payment: payload,\n });\n\nconst paymentsApi = { create, update };\n\nexport default paymentsApi;\n","import { useMutation } from \"@tanstack/react-query\";\n\nimport paymentsApi from \"apis/upi/payments\";\n\nexport const useCreateUpiPayment = options =>\n useMutation({ mutationFn: paymentsApi.create, ...options });\n\nexport const useUpdateUpiPayment = (id, options = {}) =>\n useMutation({\n mutationFn: payload => paymentsApi.update(id, payload),\n ...options,\n });\n"],"names":["create","payload","axios","post","concat","BASE_URL","payment","update","id","put","paymentsApi","useCreateUpiPayment","options","useMutation","_objectSpread","mutationFn","useUpdateUpiPayment","arguments","length","undefined"],"mappings":";;;;;AAIA,IAAMA,MAAM,GAAG,SAATA,MAAMA,CAAGC,OAAO,EAAA;AAAA,EAAA,OACpBC,KAAK,CAACC,IAAI,IAAAC,MAAA,CAAIC,QAAQ,EAA+B,6BAAA,CAAA,EAAA;AACnDC,IAAAA,OAAO,EAAEL;AACX,GAAC,CAAC;AAAA,CAAA;AAEJ,IAAMM,MAAM,GAAG,SAATA,MAAMA,CAAIC,EAAE,EAAEP,OAAO,EAAA;EAAA,OACzBC,KAAK,CAACO,GAAG,CAAAL,EAAAA,CAAAA,MAAA,CAAIC,QAAQ,EAAAD,uBAAAA,CAAAA,CAAAA,MAAA,CAAwBI,EAAE,CAAI,EAAA;AACjDF,IAAAA,OAAO,EAAEL;AACX,GAAC,CAAC;AAAA,CAAA;AAEJ,IAAMS,WAAW,GAAG;AAAEV,EAAAA,MAAM,EAANA,MAAM;AAAEO,EAAAA,MAAM,EAANA;AAAO,CAAC;;;;ICVzBI,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAGC,OAAO,EAAA;EAAA,OACxCC,WAAW,CAAAC,aAAA,CAAA;IAAGC,UAAU,EAAEL,WAAW,CAACV;GAAWY,EAAAA,OAAO,CAAE,CAAC;AAAA;IAEhDI,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIR,EAAE,EAAA;AAAA,EAAA,IAAEI,OAAO,GAAAK,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,EAAE;EAAA,OAClDJ,WAAW,CAAAC,aAAA,CAAA;AACTC,IAAAA,UAAU,EAAE,SAAZA,UAAUA,CAAEd,OAAO,EAAA;AAAA,MAAA,OAAIS,WAAW,CAACH,MAAM,CAACC,EAAE,EAAEP,OAAO,CAAC;AAAA;GACnDW,EAAAA,OAAO,CACX,CAAC;AAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-payments-frontend",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"description": "To manage payments across the neeto products.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://github.com/bigbinary/neeto-payments-nano",
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
"@bigbinary/babel-preset-neeto": "^1.0.3",
|
|
61
61
|
"@bigbinary/eslint-plugin-neeto": "1.5.6",
|
|
62
62
|
"@bigbinary/neeto-cist": "1.0.14",
|
|
63
|
-
"@bigbinary/neeto-commons-frontend": "4.13.
|
|
63
|
+
"@bigbinary/neeto-commons-frontend": "4.13.17",
|
|
64
64
|
"@bigbinary/neeto-editor": "1.45.1",
|
|
65
65
|
"@bigbinary/neeto-filters-frontend": "4.3.13",
|
|
66
|
-
"@bigbinary/neeto-icons": "1.20.
|
|
67
|
-
"@bigbinary/neeto-molecules": "3.15.
|
|
68
|
-
"@bigbinary/neetoui": "8.2.
|
|
66
|
+
"@bigbinary/neeto-icons": "1.20.24",
|
|
67
|
+
"@bigbinary/neeto-molecules": "3.15.14",
|
|
68
|
+
"@bigbinary/neetoui": "8.2.56",
|
|
69
69
|
"@emotion/is-prop-valid": "1.2.0",
|
|
70
70
|
"@faker-js/faker": "8.2.0",
|
|
71
71
|
"@honeybadger-io/js": "6.10.1",
|
|
@@ -170,12 +170,12 @@
|
|
|
170
170
|
"peerDependencies": {
|
|
171
171
|
"@babel/runtime": "7.26.0",
|
|
172
172
|
"@bigbinary/neeto-cist": "1.0.14",
|
|
173
|
-
"@bigbinary/neeto-commons-frontend": "4.13.
|
|
173
|
+
"@bigbinary/neeto-commons-frontend": "4.13.17",
|
|
174
174
|
"@bigbinary/neeto-editor": "1.45.1",
|
|
175
175
|
"@bigbinary/neeto-filters-frontend": "4.3.13",
|
|
176
|
-
"@bigbinary/neeto-icons": "1.20.
|
|
177
|
-
"@bigbinary/neeto-molecules": "3.15.
|
|
178
|
-
"@bigbinary/neetoui": "8.2.
|
|
176
|
+
"@bigbinary/neeto-icons": "1.20.24",
|
|
177
|
+
"@bigbinary/neeto-molecules": "3.15.14",
|
|
178
|
+
"@bigbinary/neetoui": "8.2.56",
|
|
179
179
|
"@honeybadger-io/js": "6.10.1",
|
|
180
180
|
"@honeybadger-io/react": "6.1.25",
|
|
181
181
|
"@tailwindcss/container-queries": "^0.1.1",
|