@bigbinary/neeto-payments-frontend 3.2.5 → 3.3.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.
@@ -1,25 +1,140 @@
1
1
  'use strict';
2
2
 
3
- require('@babel/runtime/helpers/defineProperty');
4
- require('@bigbinary/neeto-cist');
5
- require('@bigbinary/neetoui/Typography');
6
- require('@bigbinary/neetoui/formik/ActionBlock');
7
- require('@bigbinary/neetoui/formik/Form');
8
- require('@bigbinary/neetoui/formik/Input');
9
- require('qrcode.react');
10
- require('ramda');
11
- require('react-i18next');
12
- var UpiPayment = require('./index-Cad6GOm0.js');
13
- require('react/jsx-runtime');
3
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
+ var neetoCist = require('@bigbinary/neeto-cist');
5
+ var Typography = require('@bigbinary/neetoui/Typography');
6
+ var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
7
+ var Form = require('@bigbinary/neetoui/formik/Form');
8
+ var Input = require('@bigbinary/neetoui/formik/Input');
9
+ var QRCodeImage = require('qrcode.react');
10
+ var ramda = require('ramda');
11
+ var reactI18next = require('react-i18next');
12
+ var usePaymentsApi = require('./usePaymentsApi-CRsEWHjO.js');
13
+ var i18next = require('i18next');
14
+ var yup = require('yup');
15
+ var jsxRuntime = require('react/jsx-runtime');
14
16
  require('@tanstack/react-query');
15
17
  require('axios');
16
18
  require('./index-DFhiGrTx.js');
17
- require('i18next');
18
19
  require('@bigbinary/neeto-commons-frontend/constants');
19
20
  require('@bigbinary/neeto-commons-frontend/utils');
20
- require('yup');
21
21
 
22
+ function _interopNamespaceDefault(e) {
23
+ var n = Object.create(null);
24
+ if (e) {
25
+ Object.keys(e).forEach(function (k) {
26
+ if (k !== 'default') {
27
+ var d = Object.getOwnPropertyDescriptor(e, k);
28
+ Object.defineProperty(n, k, d.get ? d : {
29
+ enumerable: true,
30
+ get: function () { return e[k]; }
31
+ });
32
+ }
33
+ });
34
+ }
35
+ n.default = e;
36
+ return Object.freeze(n);
37
+ }
22
38
 
39
+ var yup__namespace = /*#__PURE__*/_interopNamespaceDefault(yup);
23
40
 
24
- module.exports = UpiPayment.UpiPayment;
41
+ var VALIDATION_SCHEMA = yup__namespace.object({
42
+ identifier: yup__namespace.string().required(i18next.t("neetoPayments.upi.payment.transaction.required")).min(6, i18next.t("neetoPayments.upi.payment.transaction.sixCharacters")).max(6, i18next.t("neetoPayments.upi.payment.transaction.sixCharacters"))
43
+ });
44
+
45
+ var vpaIdToQrCodeValue = function vpaIdToQrCodeValue(vpaId) {
46
+ return "upi://pay?pa=".concat(vpaId);
47
+ };
48
+
49
+ 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; }
50
+ 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; }
51
+ var UpiPayment = function UpiPayment(_ref) {
52
+ var fee = _ref.fee,
53
+ payableId = _ref.payableId,
54
+ discountCode = _ref.discountCode,
55
+ handleCancel = _ref.handleCancel,
56
+ _ref$onBeforePayment = _ref.onBeforePayment,
57
+ onBeforePayment = _ref$onBeforePayment === void 0 ? neetoCist.noop : _ref$onBeforePayment,
58
+ _ref$onFailedPayment = _ref.onFailedPayment,
59
+ onFailedPayment = _ref$onFailedPayment === void 0 ? neetoCist.noop : _ref$onFailedPayment,
60
+ _ref$onSuccessfulPaym = _ref.onSuccessfulPayment,
61
+ onSuccessfulPayment = _ref$onSuccessfulPaym === void 0 ? neetoCist.noop : _ref$onSuccessfulPaym;
62
+ var _useTranslation = reactI18next.useTranslation(),
63
+ t = _useTranslation.t;
64
+ var vpaIds = ramda.pluck("address", fee === null || fee === void 0 ? void 0 : fee.vpas);
65
+ var _useCreateUpiPayment = usePaymentsApi.useCreateUpiPayment({
66
+ onSuccess: onSuccessfulPayment,
67
+ onError: onFailedPayment
68
+ }),
69
+ isPending = _useCreateUpiPayment.isPending,
70
+ createPayment = _useCreateUpiPayment.mutate;
71
+ var handleSubmit = function handleSubmit(values) {
72
+ onBeforePayment();
73
+ var payload = _objectSpread(_objectSpread({}, values), {}, {
74
+ payableId: payableId,
75
+ discountCode: discountCode
76
+ });
77
+ createPayment(payload);
78
+ };
79
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
80
+ children: /*#__PURE__*/jsxRuntime.jsx(Form, {
81
+ className: "space-y-4",
82
+ formikProps: {
83
+ onSubmit: handleSubmit,
84
+ initialValues: {
85
+ identifier: ""
86
+ },
87
+ validationSchema: VALIDATION_SCHEMA
88
+ },
89
+ children: function children(_ref2) {
90
+ var dirty = _ref2.dirty;
91
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
92
+ children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
93
+ style: "body1",
94
+ children: t("neetoPayments.upi.payment.vpaText", {
95
+ count: vpaIds.length
96
+ })
97
+ }), neetoCist.isPresent(vpaIds) && /*#__PURE__*/jsxRuntime.jsx("div", {
98
+ className: "grid grid-cols-1 gap-8 gap-y-4 sm:grid-cols-2",
99
+ children: vpaIds.map(function (vpaId) {
100
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
101
+ className: "flex flex-col items-center justify-center",
102
+ children: [/*#__PURE__*/jsxRuntime.jsx(QRCodeImage, {
103
+ size: 256,
104
+ style: {
105
+ width: 80,
106
+ height: 80
107
+ },
108
+ value: vpaIdToQrCodeValue(vpaId)
109
+ }), /*#__PURE__*/jsxRuntime.jsx(Typography, {
110
+ className: "mt-2 w-full break-words text-center",
111
+ style: "body2",
112
+ children: vpaId
113
+ })]
114
+ }, vpaId);
115
+ })
116
+ }), /*#__PURE__*/jsxRuntime.jsx(Input, {
117
+ required: true,
118
+ label: t("neetoPayments.upi.payment.transaction.label"),
119
+ name: "identifier",
120
+ placeholder: t("neetoPayments.upi.payment.transaction.placeholder")
121
+ }), /*#__PURE__*/jsxRuntime.jsx(ActionBlock, {
122
+ cancelButtonProps: {
123
+ label: t("neetoPayments.upi.payment.buttons.back"),
124
+ onClick: handleCancel,
125
+ disabled: isPending
126
+ },
127
+ submitButtonProps: {
128
+ label: t("neetoPayments.upi.payment.buttons.submit"),
129
+ disabled: !dirty || isPending,
130
+ loading: isPending
131
+ }
132
+ })]
133
+ });
134
+ }
135
+ })
136
+ });
137
+ };
138
+
139
+ module.exports = UpiPayment;
25
140
  //# sourceMappingURL=UpiPayment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UpiPayment.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"UpiPayment.js","sources":["../../app/javascript/src/components/UpiPayment/constants.js","../../app/javascript/src/components/UpiPayment/utils.js","../../app/javascript/src/components/UpiPayment/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const VALIDATION_SCHEMA = yup.object({\n identifier: yup\n .string()\n .required(t(\"neetoPayments.upi.payment.transaction.required\"))\n .min(6, t(\"neetoPayments.upi.payment.transaction.sixCharacters\"))\n .max(6, t(\"neetoPayments.upi.payment.transaction.sixCharacters\")),\n});\n","export const vpaIdToQrCodeValue = vpaId => `upi://pay?pa=${vpaId}`;\n","import { noop, isPresent } from \"neetocist\";\nimport { Typography } from \"neetoui\";\nimport { ActionBlock, Form, Input } from \"neetoui/formik\";\nimport QRCodeImage from \"qrcode.react\";\nimport { pluck } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useCreateUpiPayment } from \"hooks/reactQuery/upi/usePaymentsApi\";\n\nimport { VALIDATION_SCHEMA } from \"./constants\";\nimport { vpaIdToQrCodeValue } from \"./utils\";\n\nconst UpiPayment = ({\n fee,\n payableId,\n discountCode,\n handleCancel,\n onBeforePayment = noop,\n onFailedPayment = noop,\n onSuccessfulPayment = noop,\n}) => {\n const { t } = useTranslation();\n\n const vpaIds = pluck(\"address\", fee?.vpas);\n\n const { isPending, mutate: createPayment } = useCreateUpiPayment({\n onSuccess: onSuccessfulPayment,\n onError: onFailedPayment,\n });\n\n const handleSubmit = values => {\n onBeforePayment();\n const payload = { ...values, payableId, discountCode };\n createPayment(payload);\n };\n\n return (\n <div>\n <Form\n className=\"space-y-4\"\n formikProps={{\n onSubmit: handleSubmit,\n initialValues: { identifier: \"\" },\n validationSchema: VALIDATION_SCHEMA,\n }}\n >\n {({ dirty }) => (\n <>\n <Typography style=\"body1\">\n {t(\"neetoPayments.upi.payment.vpaText\", { count: vpaIds.length })}\n </Typography>\n {isPresent(vpaIds) && (\n <div className=\"grid grid-cols-1 gap-8 gap-y-4 sm:grid-cols-2\">\n {vpaIds.map(vpaId => (\n <div\n className=\"flex flex-col items-center justify-center\"\n key={vpaId}\n >\n <QRCodeImage\n size={256}\n style={{ width: 80, height: 80 }}\n value={vpaIdToQrCodeValue(vpaId)}\n />\n <Typography\n className=\"mt-2 w-full break-words text-center\"\n style=\"body2\"\n >\n {vpaId}\n </Typography>\n </div>\n ))}\n </div>\n )}\n <Input\n required\n label={t(\"neetoPayments.upi.payment.transaction.label\")}\n name=\"identifier\"\n placeholder={t(\n \"neetoPayments.upi.payment.transaction.placeholder\"\n )}\n />\n <ActionBlock\n cancelButtonProps={{\n label: t(\"neetoPayments.upi.payment.buttons.back\"),\n onClick: handleCancel,\n disabled: isPending,\n }}\n submitButtonProps={{\n label: t(\"neetoPayments.upi.payment.buttons.submit\"),\n disabled: !dirty || isPending,\n loading: isPending,\n }}\n />\n </>\n )}\n </Form>\n </div>\n );\n};\n\nexport default UpiPayment;\n"],"names":["VALIDATION_SCHEMA","yup","object","identifier","string","required","t","min","max","vpaIdToQrCodeValue","vpaId","concat","UpiPayment","_ref","fee","payableId","discountCode","handleCancel","_ref$onBeforePayment","onBeforePayment","noop","_ref$onFailedPayment","onFailedPayment","_ref$onSuccessfulPaym","onSuccessfulPayment","_useTranslation","useTranslation","vpaIds","pluck","vpas","_useCreateUpiPayment","useCreateUpiPayment","onSuccess","onError","isPending","createPayment","mutate","handleSubmit","values","payload","_objectSpread","_jsx","children","Form","className","formikProps","onSubmit","initialValues","validationSchema","_ref2","dirty","_jsxs","_Fragment","Typography","style","count","length","isPresent","map","QRCodeImage","size","width","height","value","Input","label","name","placeholder","ActionBlock","cancelButtonProps","onClick","disabled","submitButtonProps","loading"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,iBAAiB,GAAGC,cAAG,CAACC,MAAM,CAAC;AAC1CC,EAAAA,UAAU,EAAEF,cAAG,CACZG,MAAM,EAAE,CACRC,QAAQ,CAACC,SAAC,CAAC,gDAAgD,CAAC,CAAC,CAC7DC,GAAG,CAAC,CAAC,EAAED,SAAC,CAAC,qDAAqD,CAAC,CAAC,CAChEE,GAAG,CAAC,CAAC,EAAEF,SAAC,CAAC,qDAAqD,CAAC;AACpE,CAAC,CAAC;;ACTK,IAAMG,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAGC,KAAK,EAAA;EAAA,OAAAC,eAAAA,CAAAA,MAAA,CAAoBD,KAAK,CAAA;AAAA,CAAE;;;;ACYlE,IAAME,UAAU,GAAG,SAAbA,UAAUA,CAAAC,IAAA,EAQV;AAAA,EAAA,IAPJC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IACHC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,YAAY,GAAAH,IAAA,CAAZG,YAAY;IACZC,YAAY,GAAAJ,IAAA,CAAZI,YAAY;IAAAC,oBAAA,GAAAL,IAAA,CACZM,eAAe;AAAfA,IAAAA,eAAe,GAAAD,o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AAE3D,CAAC,CAAC,6CAA6C,CAAE;AACxD4D,YAAAA,IAAI,EAAC,YAAY;YACjBC,WAAW,EAAE7D,CAAC,CACZ,mDACF;AAAE,WACH,CAAC,eACFmC,cAAA,CAAC2B,WAAW,EAAA;AACVC,YAAAA,iBAAiB,EAAE;AACjBJ,cAAAA,KAAK,EAAE3D,CAAC,CAAC,wCAAwC,CAAC;AAClDgE,cAAAA,OAAO,EAAErD,YAAY;AACrBsD,cAAAA,QAAQ,EAAErC;aACV;AACFsC,YAAAA,iBAAiB,EAAE;AACjBP,cAAAA,KAAK,EAAE3D,CAAC,CAAC,0CAA0C,CAAC;AACpDiE,cAAAA,QAAQ,EAAE,CAACrB,KAAK,IAAIhB,SAAS;AAC7BuC,cAAAA,OAAO,EAAEvC;AACX;AAAE,WACH,CAAC;AAAA,SACF,CAAC;AAAA;KAED;AAAC,GACJ,CAAC;AAEV;;;;"}
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('./index-Cad6GOm0.js');
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.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
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../app/javascript/src/components/UpiPayment/ConfirmButton.jsx"],"sourcesContent":["import { useState } from \"react\";\n\nimport { findBy, noop } from \"neetocist\";\nimport { Button, Modal, Typography } from \"neetoui\";\nimport { Form, Textarea, Select, ActionBlock } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useUpdateUpiPayment } from \"hooks/reactQuery/upi/usePaymentsApi\";\n\nimport {\n CONFIRM_FORM_INITIAL_VALUE,\n CONFIRM_FORM_VALIDATION_SCHEMA,\n} from \"./constants\";\n\nconst ConfirmButton = ({\n vpas,\n identifier,\n paymentId,\n payableId,\n onSuccess = noop,\n}) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const { t } = useTranslation();\n\n const { mutate: updateUpiPayment, isPending } = useUpdateUpiPayment(\n paymentId,\n { onSuccess }\n );\n const onClose = () => setIsModalOpen(false);\n\n const handleSubmit = ({ vpaId, notes }) => {\n const vpa = findBy({ id: vpaId }, vpas);\n const payload = {\n notes,\n vpaId,\n payableId,\n upiId: vpa.upiId,\n status: \"successful\",\n };\n updateUpiPayment(payload);\n };\n\n return (\n <>\n <Button\n label={t(\"neetoPayments.upi.payment.buttons.confirmPayment\")}\n loading={isPending}\n size=\"small\"\n style=\"secondary\"\n onClick={() => setIsModalOpen(true)}\n />\n <Modal {...{ onClose }} isOpen={isModalOpen} size=\"large\">\n <Modal.Header>\n <Typography style=\"h2\">\n {t(\"neetoPayments.upi.confirmModal.title\")}\n </Typography>\n </Modal.Header>\n <Form\n formikProps={{\n enableReinitialize: true,\n onSubmit: handleSubmit,\n initialValues: CONFIRM_FORM_INITIAL_VALUE,\n validationSchema: CONFIRM_FORM_VALIDATION_SCHEMA,\n }}\n >\n {({ setFieldValue }) => (\n <>\n <Modal.Body>\n <div className=\"flex flex-col space-y-4\">\n <Typography lineHeight=\"normal\" style=\"body2\">\n {t(\"neetoPayments.upi.confirmModal.upiTransactionId\", {\n identifier,\n })}\n </Typography>\n <Select\n label={t(\"neetoPayments.upi.confirmModal.accountIdLabel\")}\n name=\"vpaId\"\n options={vpas?.map(({ address, id }) => ({\n label: address,\n value: id,\n }))}\n onChange={({ value }) => setFieldValue(\"vpaId\", value)}\n />\n <Textarea\n data-cy=\"confirm-booking-modal-input-textfield\"\n label={t(\"neetoPayments.upi.confirmModal.notes\")}\n name=\"notes\"\n placeholder={t(\n \"neetoPayments.upi.confirmModal.notesPlaceholder\"\n )}\n />\n </div>\n </Modal.Body>\n <Modal.Footer className=\"space-x-2\">\n <ActionBlock\n isSubmitting={isPending}\n position=\"right\"\n cancelButtonProps={{\n onClick: onClose,\n style: \"tertiary\",\n }}\n submitButtonProps={{\n label: t(\"neetoPayments.common.confirm\"),\n }}\n />\n </Modal.Footer>\n </>\n )}\n </Form>\n </Modal>\n </>\n );\n};\n\nexport default ConfirmButton;\n"],"names":["ConfirmButton","_ref","vpas","identifier","paymentId","payableId","_ref$onSuccess","onSuccess","noop","_useState","useState","_useState2","_slicedToArray","isModalOpen","setIsModalOpen","_useTranslation","useTranslation","t","_useUpdateUpiPayment","useUpdateUpiPayment","updateUpiPayment","mutate","isPending","onClose","handleSubmit","_ref2","vpaId","notes","vpa","findBy","id","payload","upiId","status","_jsxs","_Fragment","children","_jsx","Button","label","loading","size","style","onClick","Modal","isOpen","Header","Typography","Form","formikProps","enableReinitialize","onSubmit","initialValues","CONFIRM_FORM_INITIAL_VALUE","validationSchema","CONFIRM_FORM_VALIDATION_SCHEMA","_ref3","setFieldValue","Body","className","lineHeight","Select","name","options","map","_ref4","address","value","onChange","_ref5","Textarea","placeholder","Footer","ActionBlock","isSubmitting","position","cancelButtonProps","submitButtonProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAAAC,IAAA,EAMb;AAAA,EAAA,IALJC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IACVC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IAAAC,cAAA,GAAAL,IAAA,CACTM,SAAS;AAATA,IAAAA,SAAS,GAA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AiB,EAAE;AACjBjC,kBAAAA,OAAO,EAAEpB,OAAO;AAChBmB,kBAAAA,KAAK,EAAE;iBACP;AACFmC,gBAAAA,iBAAiB,EAAE;kBACjBtC,KAAK,EAAEtB,CAAC,CAAC,8BAA8B;AACzC;eACD;AAAC,aACU,CAAC;AAAA,WACf,CAAC;AAAA;AACJ,OACG,CAAC;AAAA,KACF,CAAC;AAAA,GACR,CAAC;AAEP;;;;;;;;;;;;;;;;;;;;;;;"}
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
- import { u as useUpdateUpiPayment, C as CONFIRM_FORM_INITIAL_VALUE, a as CONFIRM_FORM_VALIDATION_SCHEMA } from './index-BWLyK2S8.js';
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