@bigbinary/neeto-payments-frontend 6.3.5 → 6.3.7
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/app/javascript/src/translations/ar.json +3 -3
- package/app/javascript/src/translations/bg.json +3 -3
- package/app/javascript/src/translations/ca.json +3 -3
- package/app/javascript/src/translations/cs.json +3 -3
- package/app/javascript/src/translations/da.json +3 -3
- package/app/javascript/src/translations/de.json +3 -3
- package/app/javascript/src/translations/en.json +3 -3
- package/app/javascript/src/translations/es-MX.json +3 -3
- package/app/javascript/src/translations/es.json +3 -3
- package/app/javascript/src/translations/et.json +3 -3
- package/app/javascript/src/translations/fi.json +3 -3
- package/app/javascript/src/translations/fil.json +3 -3
- package/app/javascript/src/translations/fr.json +3 -3
- package/app/javascript/src/translations/he.json +3 -3
- package/app/javascript/src/translations/hi.json +3 -3
- package/app/javascript/src/translations/hr.json +3 -3
- package/app/javascript/src/translations/hu.json +3 -3
- package/app/javascript/src/translations/id.json +3 -3
- package/app/javascript/src/translations/it.json +3 -3
- package/app/javascript/src/translations/ja.json +3 -3
- package/app/javascript/src/translations/ko.json +3 -3
- package/app/javascript/src/translations/nl.json +3 -3
- package/app/javascript/src/translations/pl.json +3 -3
- package/app/javascript/src/translations/pt-BR.json +3 -3
- package/app/javascript/src/translations/pt.json +3 -3
- package/app/javascript/src/translations/ro.json +3 -3
- package/app/javascript/src/translations/ru.json +3 -3
- package/app/javascript/src/translations/sk.json +3 -3
- package/app/javascript/src/translations/sl.json +3 -3
- package/app/javascript/src/translations/sv.json +3 -3
- package/app/javascript/src/translations/th.json +3 -3
- package/app/javascript/src/translations/tr.json +3 -3
- package/app/javascript/src/translations/uk.json +3 -3
- package/app/javascript/src/translations/vi.json +3 -3
- package/app/javascript/src/translations/zh-CN.json +3 -3
- package/app/javascript/src/translations/zh-TW.json +3 -3
- package/dist/ManualUpiPayment.js +96 -21
- package/dist/ManualUpiPayment.js.map +1 -1
- package/dist/ManualUpiPaymentConfirmButton.js +1 -1
- package/dist/ManualUpiPaymentRejectButton.js +1 -1
- package/dist/cjs/ManualUpiPayment.js +96 -21
- package/dist/cjs/ManualUpiPayment.js.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/v2/ManualUpiPayment.js +88 -14
- package/dist/cjs/v2/ManualUpiPayment.js.map +1 -1
- package/dist/cjs/v2/index.js +1 -0
- package/dist/cjs/v2/index.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/{usePaymentApi-C8fRdHmK.js → usePaymentApi-CjtkL3IU.js} +2 -2
- package/dist/{usePaymentApi-C8fRdHmK.js.map → usePaymentApi-CjtkL3IU.js.map} +1 -1
- package/dist/v2/ManualUpiPayment.js +88 -14
- package/dist/v2/ManualUpiPayment.js.map +1 -1
- package/dist/v2/ManualUpiPaymentConfirmButton.js +1 -1
- package/dist/v2/ManualUpiPaymentRejectButton.js +1 -1
- package/dist/v2/index.js +2 -1
- package/dist/v2/index.js.map +1 -1
- package/package.json +5 -5
package/dist/cjs/v2/index.js
CHANGED
|
@@ -70,6 +70,7 @@ require('@bigbinary/neeto-molecules/v2/MoreDropdown');
|
|
|
70
70
|
require('@rails/activestorage');
|
|
71
71
|
require('qrcode.react');
|
|
72
72
|
require('../usePaymentApi-CuL13mny.js');
|
|
73
|
+
require('formik');
|
|
73
74
|
require('../ExportModal-Bt_Aal7b.js');
|
|
74
75
|
require('../useExportsApi-rYuPpXWl.js');
|
|
75
76
|
require('../usePaymentsApi-ZomyqUIJ.js');
|
package/dist/cjs/v2/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -66,7 +66,8 @@ import 'yup';
|
|
|
66
66
|
import '@bigbinary/neeto-molecules/MoreDropdown';
|
|
67
67
|
import '@rails/activestorage';
|
|
68
68
|
import 'qrcode.react';
|
|
69
|
-
import './usePaymentApi-
|
|
69
|
+
import './usePaymentApi-CjtkL3IU.js';
|
|
70
|
+
import 'formik';
|
|
70
71
|
import './ExportModal-Bun3pMGn.js';
|
|
71
72
|
import './useExportsApi-C1wjoVYy.js';
|
|
72
73
|
import './usePaymentsApi-C2xbgHmw.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -37,5 +37,5 @@ const useUpdateUpiPayment = ({
|
|
|
37
37
|
...options
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
export {
|
|
41
|
-
//# sourceMappingURL=usePaymentApi-
|
|
40
|
+
export { useCreateUpiPayment as a, useUpdateUpiPayment as u };
|
|
41
|
+
//# sourceMappingURL=usePaymentApi-CjtkL3IU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePaymentApi-
|
|
1
|
+
{"version":3,"file":"usePaymentApi-CjtkL3IU.js","sources":["../app/javascript/src/apis/manual_upi/payments.js","../app/javascript/src/hooks/reactQuery/manualUpi/usePaymentApi.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/manual_upi/payments`, {\n payment: payload,\n });\n\nconst update = ({ id, manualUpiId, payload }) =>\n axios.put(`${BASE_URL}/api/v1/manual_upi/${manualUpiId}/payments/${id}`, {\n payment: payload,\n });\n\nconst paymentsApi = { update, create };\n\nexport default paymentsApi;\n","import { useMutation } from \"@tanstack/react-query\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport paymentsApi from \"apis/manual_upi/payments\";\nimport { QUERY_KEYS } from \"src/common/queryConstants\";\n\nexport const useCreateUpiPayment = options =>\n useMutation({ mutationFn: paymentsApi.create, ...options });\n\nexport const useUpdateUpiPayment = ({\n id,\n manualUpiId,\n options = {},\n keysToInvalidate = [],\n}) =>\n useMutationWithInvalidation(\n payload => paymentsApi.update({ id, manualUpiId, payload }),\n {\n keysToInvalidate: [...keysToInvalidate, [QUERY_KEYS.PAYMENTS_LIST]],\n ...options,\n }\n );\n"],"names":["create","payload","axios","post","BASE_URL","payment","update","id","manualUpiId","put","paymentsApi","useCreateUpiPayment","options","useMutation","mutationFn","useUpdateUpiPayment","keysToInvalidate","useMutationWithInvalidation","QUERY_KEYS","PAYMENTS_LIST"],"mappings":";;;;;;AAIA,MAAMA,MAAM,GAAGC,OAAO,IACpBC,KAAK,CAACC,IAAI,CAAC,CAAA,EAAGC,QAAQ,CAAA,kCAAA,CAAoC,EAAE;AAC1DC,EAAAA,OAAO,EAAEJ;AACX,CAAC,CAAC;AAEJ,MAAMK,MAAM,GAAGA,CAAC;EAAEC,EAAE;EAAEC,WAAW;AAAEP,EAAAA;AAAQ,CAAC,KAC1CC,KAAK,CAACO,GAAG,CAAC,CAAA,EAAGL,QAAQ,CAAA,mBAAA,EAAsBI,WAAW,CAAA,UAAA,EAAaD,EAAE,CAAA,CAAE,EAAE;AACvEF,EAAAA,OAAO,EAAEJ;AACX,CAAC,CAAC;AAEJ,MAAMS,WAAW,GAAG;EAAEJ,MAAM;AAAEN,EAAAA;AAAO,CAAC;;MCRzBW,mBAAmB,GAAGC,OAAO,IACxCC,WAAW,CAAC;EAAEC,UAAU,EAAEJ,WAAW,CAACV,MAAM;EAAE,GAAGY;AAAQ,CAAC;AAErD,MAAMG,mBAAmB,GAAGA,CAAC;EAClCR,EAAE;EACFC,WAAW;EACXI,OAAO,GAAG,EAAE;AACZI,EAAAA,gBAAgB,GAAG;AACrB,CAAC,KACCC,2BAA2B,CACzBhB,OAAO,IAAIS,WAAW,CAACJ,MAAM,CAAC;EAAEC,EAAE;EAAEC,WAAW;AAAEP,EAAAA;AAAQ,CAAC,CAAC,EAC3D;EACEe,gBAAgB,EAAE,CAAC,GAAGA,gBAAgB,EAAE,CAACE,UAAU,CAACC,aAAa,CAAC,CAAC;EACnE,GAAGP;AACL,CACF;;;;"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { useRef, useState, useMemo, useEffect } from 'react';
|
|
2
2
|
import { Typography, Button, Toastr } from '@bigbinary/neeto-atoms';
|
|
3
|
-
import { Form,
|
|
3
|
+
import { Form, ActionBlock } from '@bigbinary/neeto-atoms/formik';
|
|
4
4
|
import { DirectUpload } from '@rails/activestorage';
|
|
5
5
|
import { X } from 'lucide-react';
|
|
6
6
|
import { isPresent, isNotPresent, noop } from 'neetocist';
|
|
7
7
|
import QRCodeImage from 'qrcode.react';
|
|
8
8
|
import { pluck } from 'ramda';
|
|
9
9
|
import { useTranslation } from 'react-i18next';
|
|
10
|
-
import {
|
|
10
|
+
import { a as useCreateUpiPayment } from '../usePaymentApi-CjtkL3IU.js';
|
|
11
11
|
import { k as getQrCodeValue } from '../index-CajHy3NQ.js';
|
|
12
12
|
import { t } from 'i18next';
|
|
13
13
|
import * as yup from 'yup';
|
|
14
|
-
import {
|
|
14
|
+
import { useField } from 'formik';
|
|
15
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
15
16
|
import '@tanstack/react-query';
|
|
16
17
|
import 'neetocommons/react-utils';
|
|
17
18
|
import 'axios';
|
|
@@ -26,6 +27,7 @@ const DIRECT_UPLOAD_URL = "/rails/active_storage/direct_uploads";
|
|
|
26
27
|
const INITIAL_VALUES = {
|
|
27
28
|
identifier: ""
|
|
28
29
|
};
|
|
30
|
+
const UPI_TRANSACTION_ID_LENGTH = 12;
|
|
29
31
|
const buildValidationSchema = screenshotFile => yup.object({
|
|
30
32
|
identifier: yup.number().typeError(t("neetoPayments.validations.invalidField", {
|
|
31
33
|
entity: t("neetoPayments.common.transactionId")
|
|
@@ -36,6 +38,79 @@ const buildValidationSchema = screenshotFile => yup.object({
|
|
|
36
38
|
}), value => isNotPresent(value) || value?.toString().length === 12)
|
|
37
39
|
});
|
|
38
40
|
|
|
41
|
+
const toSlots = value => Array.from({
|
|
42
|
+
length: UPI_TRANSACTION_ID_LENGTH
|
|
43
|
+
}, (_, index) => value[index] ?? "");
|
|
44
|
+
const UpiTransactionIdInput = ({
|
|
45
|
+
name = "identifier"
|
|
46
|
+
}) => {
|
|
47
|
+
const {
|
|
48
|
+
t
|
|
49
|
+
} = useTranslation();
|
|
50
|
+
const [, meta, helpers] = useField(name);
|
|
51
|
+
const inputsRef = useRef([]);
|
|
52
|
+
const [slots, setSlots] = useState(() => toSlots((meta.initialValue ?? "").toString()));
|
|
53
|
+
const sync = nextSlots => {
|
|
54
|
+
setSlots(nextSlots);
|
|
55
|
+
helpers.setValue(nextSlots.join(""));
|
|
56
|
+
};
|
|
57
|
+
const setDigit = (index, digit) => sync(slots.map((slot, i) => i === index ? digit : slot));
|
|
58
|
+
const focusBox = index => inputsRef.current[index]?.focus();
|
|
59
|
+
const handleChange = (index, event) => {
|
|
60
|
+
const sanitized = event.target.value.replace(/\D/g, "");
|
|
61
|
+
setDigit(index, sanitized ? sanitized[sanitized.length - 1] : "");
|
|
62
|
+
if (sanitized && index < UPI_TRANSACTION_ID_LENGTH - 1) focusBox(index + 1);
|
|
63
|
+
};
|
|
64
|
+
const handleKeyDown = (index, event) => {
|
|
65
|
+
if (event.key === "Backspace" && !slots[index] && index > 0) {
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
setDigit(index - 1, "");
|
|
68
|
+
focusBox(index - 1);
|
|
69
|
+
} else if (event.key === "ArrowLeft" && index > 0) {
|
|
70
|
+
focusBox(index - 1);
|
|
71
|
+
} else if (event.key === "ArrowRight" && index < UPI_TRANSACTION_ID_LENGTH - 1) {
|
|
72
|
+
focusBox(index + 1);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const handlePaste = event => {
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
const pasted = event.clipboardData.getData("text").replace(/\D/g, "").slice(0, UPI_TRANSACTION_ID_LENGTH);
|
|
78
|
+
if (!pasted) return;
|
|
79
|
+
sync(toSlots(pasted));
|
|
80
|
+
focusBox(Math.min(pasted.length, UPI_TRANSACTION_ID_LENGTH - 1));
|
|
81
|
+
};
|
|
82
|
+
const showError = meta.touched && meta.error;
|
|
83
|
+
return /*#__PURE__*/jsxs("div", {
|
|
84
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
85
|
+
className: "mb-2",
|
|
86
|
+
variant: "body2",
|
|
87
|
+
weight: "medium",
|
|
88
|
+
children: t("neetoPayments.upi.payment.transaction.label")
|
|
89
|
+
}), /*#__PURE__*/jsx("div", {
|
|
90
|
+
className: "flex flex-wrap gap-2",
|
|
91
|
+
onPaste: handlePaste,
|
|
92
|
+
children: slots.map((slot, index) => /*#__PURE__*/jsx("input", {
|
|
93
|
+
autoComplete: "off",
|
|
94
|
+
className: "h-10 w-8 neeto-ui-rounded border neeto-ui-border-gray-300 text-center text-base focus:neeto-ui-border-gray-500 focus:outline-none",
|
|
95
|
+
"data-testid": `upi-transaction-id-box-${index}`,
|
|
96
|
+
inputMode: "numeric",
|
|
97
|
+
maxLength: 1,
|
|
98
|
+
ref: element => inputsRef.current[index] = element,
|
|
99
|
+
type: "text",
|
|
100
|
+
value: slot,
|
|
101
|
+
onBlur: () => helpers.setTouched(true),
|
|
102
|
+
onChange: event => handleChange(index, event),
|
|
103
|
+
onFocus: event => event.target.select(),
|
|
104
|
+
onKeyDown: event => handleKeyDown(index, event)
|
|
105
|
+
}, index))
|
|
106
|
+
}), showError && /*#__PURE__*/jsx(Typography, {
|
|
107
|
+
className: "neeto-ui-text-error-500 mt-1",
|
|
108
|
+
variant: "body3",
|
|
109
|
+
children: meta.error
|
|
110
|
+
})]
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
|
|
39
114
|
const ManualUpiPayment = ({
|
|
40
115
|
fee,
|
|
41
116
|
payableId,
|
|
@@ -125,32 +200,31 @@ const ManualUpiPayment = ({
|
|
|
125
200
|
dirty
|
|
126
201
|
}) => /*#__PURE__*/jsxs(Fragment, {
|
|
127
202
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
128
|
-
|
|
203
|
+
className: "neeto-ui-text-gray-600",
|
|
204
|
+
variant: "body2",
|
|
129
205
|
children: t("neetoPayments.upi.payment.vpaText", {
|
|
130
206
|
count: vpaIds.length
|
|
131
207
|
})
|
|
132
208
|
}), isPresent(vpaIds) && /*#__PURE__*/jsx("div", {
|
|
133
|
-
className: "
|
|
209
|
+
className: "flex flex-wrap gap-8",
|
|
134
210
|
children: vpaIds.map(vpaId => /*#__PURE__*/jsxs("div", {
|
|
135
211
|
className: "flex flex-col items-center justify-center",
|
|
136
212
|
children: [/*#__PURE__*/jsx(QRCodeImage, {
|
|
137
213
|
size: 256,
|
|
138
214
|
style: {
|
|
139
|
-
width:
|
|
140
|
-
height:
|
|
215
|
+
width: 120,
|
|
216
|
+
height: 120
|
|
141
217
|
},
|
|
142
218
|
value: getQrCodeValue(vpaId, amountToUpi)
|
|
143
219
|
}), /*#__PURE__*/jsx(Typography, {
|
|
144
220
|
className: "w-full mt-2 text-center wrap-break-word",
|
|
145
221
|
variant: "body2",
|
|
222
|
+
weight: "medium",
|
|
146
223
|
children: vpaId
|
|
147
224
|
})]
|
|
148
225
|
}, vpaId))
|
|
149
|
-
}), /*#__PURE__*/jsx(
|
|
150
|
-
|
|
151
|
-
name: "identifier",
|
|
152
|
-
placeholder: t("neetoPayments.upi.payment.transaction.placeholder"),
|
|
153
|
-
type: "number"
|
|
226
|
+
}), /*#__PURE__*/jsx(UpiTransactionIdInput, {
|
|
227
|
+
name: "identifier"
|
|
154
228
|
}), /*#__PURE__*/jsxs("div", {
|
|
155
229
|
className: "flex items-center gap-3",
|
|
156
230
|
children: [/*#__PURE__*/jsx("hr", {
|
|
@@ -195,9 +269,9 @@ const ManualUpiPayment = ({
|
|
|
195
269
|
children: [/*#__PURE__*/jsx("i", {
|
|
196
270
|
className: "ri-upload-2-line text-2xl text-muted-foreground"
|
|
197
271
|
}), /*#__PURE__*/jsx(Typography, {
|
|
198
|
-
className: "mt-1",
|
|
199
|
-
color: "muted",
|
|
272
|
+
className: "mt-1 text-blue-600 hover:underline",
|
|
200
273
|
variant: "caption",
|
|
274
|
+
weight: "medium",
|
|
201
275
|
children: t("neetoPayments.upi.payment.screenshot.uploadText")
|
|
202
276
|
}), /*#__PURE__*/jsx(Typography, {
|
|
203
277
|
color: "muted",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManualUpiPayment.js","sources":["../../app/javascript/src/v2/components/ManualUpiPayment/constants.js","../../app/javascript/src/v2/components/ManualUpiPayment/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport { isPresent, isNotPresent } from \"neetocist\";\nimport * as yup from \"yup\";\n\nexport const ACCEPTED_SCREENSHOT_FORMATS = \"image/png,image/jpeg,image/jpg\";\n\nexport const MAX_SCREENSHOT_SIZE_MB = 5;\n\nexport const DIRECT_UPLOAD_URL = \"/rails/active_storage/direct_uploads\";\n\nexport const INITIAL_VALUES = { identifier: \"\" };\n\nexport const buildValidationSchema = screenshotFile =>\n yup.object({\n identifier: yup\n .number()\n .typeError(\n t(\"neetoPayments.validations.invalidField\", {\n entity: t(\"neetoPayments.common.transactionId\"),\n })\n )\n .nullable()\n .transform((value, originalValue) =>\n originalValue === \"\" ? null : value\n )\n .test(\n \"identifier-or-screenshot\",\n t(\"neetoPayments.upi.payment.transaction.identifierOrScreenshot\"),\n value => isPresent(value) || isPresent(screenshotFile)\n )\n .test(\n \"is-integer\",\n t(\"neetoPayments.validations.invalidField\", {\n entity: t(\"neetoPayments.common.transactionId\"),\n }),\n value => isNotPresent(value) || Number.isInteger(value)\n )\n .test(\n \"len\",\n t(\"neetoPayments.validations.length\", { length: 12 }),\n value => isNotPresent(value) || value?.toString().length === 12\n ),\n });\n","import { useRef, useState, useMemo, useEffect } from \"react\";\n\nimport { Button, Toastr, Typography } from \"@bigbinary/neeto-atoms\";\nimport { ActionBlock, Form, Input } from \"@bigbinary/neeto-atoms/formik\";\nimport { DirectUpload } from \"@rails/activestorage\";\nimport { X } from \"lucide-react\";\nimport { noop, isPresent } from \"neetocist\";\nimport QRCodeImage from \"qrcode.react\";\nimport { pluck } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useCreateUpiPayment } from \"hooks/reactQuery/manualUpi/usePaymentApi\";\nimport { getQrCodeValue } from \"utils\";\n\nimport {\n buildValidationSchema,\n ACCEPTED_SCREENSHOT_FORMATS,\n MAX_SCREENSHOT_SIZE_MB,\n DIRECT_UPLOAD_URL,\n INITIAL_VALUES,\n} from \"./constants\";\n\nconst ManualUpiPayment = ({\n fee,\n payableId,\n tip,\n amount,\n discountCode,\n customAmount,\n handleCancel,\n payableType = null,\n onBeforePayment = noop,\n onFailedPayment = noop,\n onSuccessfulPayment = noop,\n}) => {\n const { t } = useTranslation();\n const fileInputRef = useRef(null);\n const [screenshotFile, setScreenshotFile] = useState(null);\n const [isUploading, setIsUploading] = useState(false);\n\n const screenshotPreview = useMemo(\n () => (screenshotFile ? URL.createObjectURL(screenshotFile) : null),\n [screenshotFile]\n );\n\n useEffect(\n () => () => {\n if (screenshotPreview) URL.revokeObjectURL(screenshotPreview);\n },\n [screenshotPreview]\n );\n\n const vpaIds = pluck(\"address\", fee?.vpas);\n const amountToUpi = customAmount || amount;\n\n const { isPending, mutate: createPayment } = useCreateUpiPayment({\n onSuccess: onSuccessfulPayment,\n onError: onFailedPayment,\n });\n\n const validationSchema = useMemo(\n () => buildValidationSchema(screenshotFile),\n [screenshotFile]\n );\n\n const handleScreenshotSelect = event => {\n const file = event.target.files[0];\n if (!file) return;\n\n if (file.size > MAX_SCREENSHOT_SIZE_MB * 1024 * 1024) {\n Toastr.error(\n t(\"neetoPayments.upi.payment.screenshot.tooLarge\", {\n maxSize: MAX_SCREENSHOT_SIZE_MB,\n })\n );\n\n return;\n }\n\n setScreenshotFile(file);\n };\n\n const handleRemoveScreenshot = () => {\n setScreenshotFile(null);\n if (fileInputRef.current) fileInputRef.current.value = \"\";\n };\n\n const uploadScreenshot = file =>\n new Promise((resolve, reject) => {\n const upload = new DirectUpload(file, DIRECT_UPLOAD_URL);\n upload.create((error, blob) => {\n if (error) reject(error);\n else resolve(blob.signed_id);\n });\n });\n\n const handleSubmit = async values => {\n onBeforePayment();\n\n let paymentScreenshot = null;\n if (screenshotFile) {\n try {\n setIsUploading(true);\n paymentScreenshot = await uploadScreenshot(screenshotFile);\n } catch {\n onFailedPayment();\n\n return;\n } finally {\n setIsUploading(false);\n }\n }\n\n createPayment({\n ...values,\n payableId,\n customAmount,\n payableType,\n discountCode,\n tipAttributes: tip,\n paymentScreenshot,\n });\n };\n\n return (\n <Form\n className=\"space-y-4\"\n formikProps={{\n onSubmit: handleSubmit,\n initialValues: INITIAL_VALUES,\n validationSchema,\n }}\n >\n {({ dirty }) => (\n <>\n <Typography variant=\"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={getQrCodeValue(vpaId, amountToUpi)}\n />\n <Typography\n className=\"w-full mt-2 text-center wrap-break-word\"\n variant=\"body2\"\n >\n {vpaId}\n </Typography>\n </div>\n ))}\n </div>\n )}\n <Input\n label={t(\"neetoPayments.upi.payment.transaction.label\")}\n name=\"identifier\"\n placeholder={t(\"neetoPayments.upi.payment.transaction.placeholder\")}\n type=\"number\"\n />\n <div className=\"flex items-center gap-3\">\n <hr className=\"flex-1 border-border\" />\n <Typography className=\"uppercase\" color=\"muted\" variant=\"body2\">\n {t(\"neetoPayments.common.or\")}\n </Typography>\n <hr className=\"flex-1 border-border\" />\n </div>\n <div>\n <Typography className=\"mb-2\" variant=\"body2\" weight=\"medium\">\n {t(\"neetoPayments.upi.payment.screenshot.label\")}\n </Typography>\n {screenshotPreview ? (\n <div className=\"relative inline-block\">\n <img\n alt={t(\"neetoPayments.upi.payment.screenshot.alt\")}\n className=\"max-h-40 rounded border border-border\"\n src={screenshotPreview}\n />\n <Button\n className=\"absolute -end-2 -top-2 rounded-full bg-background shadow-sm\"\n icon={X}\n size=\"sm\"\n variant=\"ghost\"\n onClick={handleRemoveScreenshot}\n />\n </div>\n ) : (\n <div\n className=\"flex cursor-pointer flex-col items-center justify-center rounded border-2 border-dashed border-border p-6 transition-colors hover:border-ring\"\n role=\"button\"\n tabIndex={0}\n onClick={() => fileInputRef.current?.click()}\n onKeyDown={e => {\n if (e.key === \"Enter\" || e.key === \" \") {\n fileInputRef.current?.click();\n }\n }}\n >\n <i className=\"ri-upload-2-line text-2xl text-muted-foreground\" />\n <Typography className=\"mt-1\" color=\"muted\" variant=\"caption\">\n {t(\"neetoPayments.upi.payment.screenshot.uploadText\")}\n </Typography>\n <Typography color=\"muted\" variant=\"nano\">\n {t(\"neetoPayments.upi.payment.screenshot.formatHint\", {\n maxSize: MAX_SCREENSHOT_SIZE_MB,\n })}\n </Typography>\n </div>\n )}\n <input\n accept={ACCEPTED_SCREENSHOT_FORMATS}\n className=\"hidden\"\n data-testid=\"manual-upi-screenshot-upload-input-field\"\n ref={fileInputRef}\n type=\"file\"\n onChange={handleScreenshotSelect}\n />\n </div>\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 && !screenshotFile) || isPending || isUploading,\n loading: isPending || isUploading,\n }}\n />\n </>\n )}\n </Form>\n );\n};\n\nexport default ManualUpiPayment;\n"],"names":["ACCEPTED_SCREENSHOT_FORMATS","MAX_SCREENSHOT_SIZE_MB","DIRECT_UPLOAD_URL","INITIAL_VALUES","identifier","buildValidationSchema","screenshotFile","yup","object","number","typeError","t","entity","nullable","transform","value","originalValue","test","isPresent","isNotPresent","Number","isInteger","length","toString","ManualUpiPayment","fee","payableId","tip","amount","discountCode","customAmount","handleCancel","payableType","onBeforePayment","noop","onFailedPayment","onSuccessfulPayment","useTranslation","fileInputRef","useRef","setScreenshotFile","useState","isUploading","setIsUploading","screenshotPreview","useMemo","URL","createObjectURL","useEffect","revokeObjectURL","vpaIds","pluck","vpas","amountToUpi","isPending","mutate","createPayment","useCreateUpiPayment","onSuccess","onError","validationSchema","handleScreenshotSelect","event","file","target","files","size","Toastr","error","maxSize","handleRemoveScreenshot","current","uploadScreenshot","Promise","resolve","reject","upload","DirectUpload","create","blob","signed_id","handleSubmit","values","paymentScreenshot","tipAttributes","_jsx","Form","className","formikProps","onSubmit","initialValues","children","dirty","_jsxs","_Fragment","Typography","variant","count","map","vpaId","QRCodeImage","style","width","height","getQrCodeValue","Input","label","name","placeholder","type","color","weight","alt","src","Button","icon","X","onClick","role","tabIndex","click","onKeyDown","e","key","accept","ref","onChange","ActionBlock","cancelButtonProps","disabled","submitButtonProps","loading"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIO,MAAMA,2BAA2B,GAAG,gCAAgC;AAEpE,MAAMC,sBAAsB,GAAG,CAAC;AAEhC,MAAMC,iBAAiB,GAAG,sCAAsC;AAEhE,MAAMC,cAAc,GAAG;AAAEC,EAAAA,UAAU,EAAE;AAAG,C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AAEjE;AAAuB,SAClC,CAAC;AAAA,OACC,CAAC,eACNwB,GAAA,CAAC0C,WAAW,EAAA;AACVC,QAAAA,iBAAiB,EAAE;AACjBtB,UAAAA,KAAK,EAAE/F,CAAC,CAAC,wCAAwC,CAAC;AAClD0G,UAAAA,OAAO,EAAEtF,YAAY;AACrBkG,UAAAA,QAAQ,EAAE3E;SACV;AACF4E,QAAAA,iBAAiB,EAAE;AACjBxB,UAAAA,KAAK,EAAE/F,CAAC,CAAC,0CAA0C,CAAC;UACpDsH,QAAQ,EAAG,CAACrC,KAAK,IAAI,CAACtF,cAAc,IAAKgD,SAAS,IAAIZ,WAAW;UACjEyF,OAAO,EAAE7E,SAAS,IAAIZ;AACxB;AAAE,OACH,CAAC;KACF;AACH,GACG,CAAC;AAEX;;;;"}
|
|
1
|
+
{"version":3,"file":"ManualUpiPayment.js","sources":["../../app/javascript/src/v2/components/ManualUpiPayment/constants.js","../../app/javascript/src/v2/components/ManualUpiPayment/UpiTransactionIdInput.jsx","../../app/javascript/src/v2/components/ManualUpiPayment/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport { isPresent, isNotPresent } from \"neetocist\";\nimport * as yup from \"yup\";\n\nexport const ACCEPTED_SCREENSHOT_FORMATS = \"image/png,image/jpeg,image/jpg\";\n\nexport const MAX_SCREENSHOT_SIZE_MB = 5;\n\nexport const DIRECT_UPLOAD_URL = \"/rails/active_storage/direct_uploads\";\n\nexport const INITIAL_VALUES = { identifier: \"\" };\n\nexport const UPI_TRANSACTION_ID_LENGTH = 12;\n\nexport const buildValidationSchema = screenshotFile =>\n yup.object({\n identifier: yup\n .number()\n .typeError(\n t(\"neetoPayments.validations.invalidField\", {\n entity: t(\"neetoPayments.common.transactionId\"),\n })\n )\n .nullable()\n .transform((value, originalValue) =>\n originalValue === \"\" ? null : value\n )\n .test(\n \"identifier-or-screenshot\",\n t(\"neetoPayments.upi.payment.transaction.identifierOrScreenshot\"),\n value => isPresent(value) || isPresent(screenshotFile)\n )\n .test(\n \"is-integer\",\n t(\"neetoPayments.validations.invalidField\", {\n entity: t(\"neetoPayments.common.transactionId\"),\n }),\n value => isNotPresent(value) || Number.isInteger(value)\n )\n .test(\n \"len\",\n t(\"neetoPayments.validations.length\", { length: 12 }),\n value => isNotPresent(value) || value?.toString().length === 12\n ),\n });\n","import { useRef, useState } from \"react\";\n\nimport { Typography } from \"@bigbinary/neeto-atoms\";\nimport { useField } from \"formik\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { UPI_TRANSACTION_ID_LENGTH as LENGTH } from \"./constants\";\n\nconst toSlots = value =>\n Array.from({ length: LENGTH }, (_, index) => value[index] ?? \"\");\n\nconst UpiTransactionIdInput = ({ name = \"identifier\" }) => {\n const { t } = useTranslation();\n const [, meta, helpers] = useField(name);\n const inputsRef = useRef([]);\n const [slots, setSlots] = useState(() =>\n toSlots((meta.initialValue ?? \"\").toString())\n );\n\n const sync = nextSlots => {\n setSlots(nextSlots);\n helpers.setValue(nextSlots.join(\"\"));\n };\n\n const setDigit = (index, digit) =>\n sync(slots.map((slot, i) => (i === index ? digit : slot)));\n\n const focusBox = index => inputsRef.current[index]?.focus();\n\n const handleChange = (index, event) => {\n const sanitized = event.target.value.replace(/\\D/g, \"\");\n setDigit(index, sanitized ? sanitized[sanitized.length - 1] : \"\");\n if (sanitized && index < LENGTH - 1) focusBox(index + 1);\n };\n\n const handleKeyDown = (index, event) => {\n if (event.key === \"Backspace\" && !slots[index] && index > 0) {\n event.preventDefault();\n setDigit(index - 1, \"\");\n focusBox(index - 1);\n } else if (event.key === \"ArrowLeft\" && index > 0) {\n focusBox(index - 1);\n } else if (event.key === \"ArrowRight\" && index < LENGTH - 1) {\n focusBox(index + 1);\n }\n };\n\n const handlePaste = event => {\n event.preventDefault();\n const pasted = event.clipboardData\n .getData(\"text\")\n .replace(/\\D/g, \"\")\n .slice(0, LENGTH);\n if (!pasted) return;\n\n sync(toSlots(pasted));\n focusBox(Math.min(pasted.length, LENGTH - 1));\n };\n\n const showError = meta.touched && meta.error;\n\n return (\n <div>\n <Typography className=\"mb-2\" variant=\"body2\" weight=\"medium\">\n {t(\"neetoPayments.upi.payment.transaction.label\")}\n </Typography>\n <div className=\"flex flex-wrap gap-2\" onPaste={handlePaste}>\n {slots.map((slot, index) => (\n <input\n autoComplete=\"off\"\n className=\"h-10 w-8 neeto-ui-rounded border neeto-ui-border-gray-300 text-center text-base focus:neeto-ui-border-gray-500 focus:outline-none\"\n data-testid={`upi-transaction-id-box-${index}`}\n inputMode=\"numeric\"\n key={index}\n maxLength={1}\n ref={element => (inputsRef.current[index] = element)}\n type=\"text\"\n value={slot}\n onBlur={() => helpers.setTouched(true)}\n onChange={event => handleChange(index, event)}\n onFocus={event => event.target.select()}\n onKeyDown={event => handleKeyDown(index, event)}\n />\n ))}\n </div>\n {showError && (\n <Typography className=\"neeto-ui-text-error-500 mt-1\" variant=\"body3\">\n {meta.error}\n </Typography>\n )}\n </div>\n );\n};\n\nexport default UpiTransactionIdInput;\n","import { useRef, useState, useMemo, useEffect } from \"react\";\n\nimport { Button, Toastr, Typography } from \"@bigbinary/neeto-atoms\";\nimport { ActionBlock, Form } from \"@bigbinary/neeto-atoms/formik\";\nimport { DirectUpload } from \"@rails/activestorage\";\nimport { X } from \"lucide-react\";\nimport { noop, isPresent } from \"neetocist\";\nimport QRCodeImage from \"qrcode.react\";\nimport { pluck } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useCreateUpiPayment } from \"hooks/reactQuery/manualUpi/usePaymentApi\";\nimport { getQrCodeValue } from \"utils\";\n\nimport {\n buildValidationSchema,\n ACCEPTED_SCREENSHOT_FORMATS,\n MAX_SCREENSHOT_SIZE_MB,\n DIRECT_UPLOAD_URL,\n INITIAL_VALUES,\n} from \"./constants\";\nimport UpiTransactionIdInput from \"./UpiTransactionIdInput\";\n\nconst ManualUpiPayment = ({\n fee,\n payableId,\n tip,\n amount,\n discountCode,\n customAmount,\n handleCancel,\n payableType = null,\n onBeforePayment = noop,\n onFailedPayment = noop,\n onSuccessfulPayment = noop,\n}) => {\n const { t } = useTranslation();\n const fileInputRef = useRef(null);\n const [screenshotFile, setScreenshotFile] = useState(null);\n const [isUploading, setIsUploading] = useState(false);\n\n const screenshotPreview = useMemo(\n () => (screenshotFile ? URL.createObjectURL(screenshotFile) : null),\n [screenshotFile]\n );\n\n useEffect(\n () => () => {\n if (screenshotPreview) URL.revokeObjectURL(screenshotPreview);\n },\n [screenshotPreview]\n );\n\n const vpaIds = pluck(\"address\", fee?.vpas);\n const amountToUpi = customAmount || amount;\n\n const { isPending, mutate: createPayment } = useCreateUpiPayment({\n onSuccess: onSuccessfulPayment,\n onError: onFailedPayment,\n });\n\n const validationSchema = useMemo(\n () => buildValidationSchema(screenshotFile),\n [screenshotFile]\n );\n\n const handleScreenshotSelect = event => {\n const file = event.target.files[0];\n if (!file) return;\n\n if (file.size > MAX_SCREENSHOT_SIZE_MB * 1024 * 1024) {\n Toastr.error(\n t(\"neetoPayments.upi.payment.screenshot.tooLarge\", {\n maxSize: MAX_SCREENSHOT_SIZE_MB,\n })\n );\n\n return;\n }\n\n setScreenshotFile(file);\n };\n\n const handleRemoveScreenshot = () => {\n setScreenshotFile(null);\n if (fileInputRef.current) fileInputRef.current.value = \"\";\n };\n\n const uploadScreenshot = file =>\n new Promise((resolve, reject) => {\n const upload = new DirectUpload(file, DIRECT_UPLOAD_URL);\n upload.create((error, blob) => {\n if (error) reject(error);\n else resolve(blob.signed_id);\n });\n });\n\n const handleSubmit = async values => {\n onBeforePayment();\n\n let paymentScreenshot = null;\n if (screenshotFile) {\n try {\n setIsUploading(true);\n paymentScreenshot = await uploadScreenshot(screenshotFile);\n } catch {\n onFailedPayment();\n\n return;\n } finally {\n setIsUploading(false);\n }\n }\n\n createPayment({\n ...values,\n payableId,\n customAmount,\n payableType,\n discountCode,\n tipAttributes: tip,\n paymentScreenshot,\n });\n };\n\n return (\n <Form\n className=\"space-y-4\"\n formikProps={{\n onSubmit: handleSubmit,\n initialValues: INITIAL_VALUES,\n validationSchema,\n }}\n >\n {({ dirty }) => (\n <>\n <Typography className=\"neeto-ui-text-gray-600\" variant=\"body2\">\n {t(\"neetoPayments.upi.payment.vpaText\", { count: vpaIds.length })}\n </Typography>\n {isPresent(vpaIds) && (\n <div className=\"flex flex-wrap gap-8\">\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: 120, height: 120 }}\n value={getQrCodeValue(vpaId, amountToUpi)}\n />\n <Typography\n className=\"w-full mt-2 text-center wrap-break-word\"\n variant=\"body2\"\n weight=\"medium\"\n >\n {vpaId}\n </Typography>\n </div>\n ))}\n </div>\n )}\n <UpiTransactionIdInput name=\"identifier\" />\n <div className=\"flex items-center gap-3\">\n <hr className=\"flex-1 border-border\" />\n <Typography className=\"uppercase\" color=\"muted\" variant=\"body2\">\n {t(\"neetoPayments.common.or\")}\n </Typography>\n <hr className=\"flex-1 border-border\" />\n </div>\n <div>\n <Typography className=\"mb-2\" variant=\"body2\" weight=\"medium\">\n {t(\"neetoPayments.upi.payment.screenshot.label\")}\n </Typography>\n {screenshotPreview ? (\n <div className=\"relative inline-block\">\n <img\n alt={t(\"neetoPayments.upi.payment.screenshot.alt\")}\n className=\"max-h-40 rounded border border-border\"\n src={screenshotPreview}\n />\n <Button\n className=\"absolute -end-2 -top-2 rounded-full bg-background shadow-sm\"\n icon={X}\n size=\"sm\"\n variant=\"ghost\"\n onClick={handleRemoveScreenshot}\n />\n </div>\n ) : (\n <div\n className=\"flex cursor-pointer flex-col items-center justify-center rounded border-2 border-dashed border-border p-6 transition-colors hover:border-ring\"\n role=\"button\"\n tabIndex={0}\n onClick={() => fileInputRef.current?.click()}\n onKeyDown={e => {\n if (e.key === \"Enter\" || e.key === \" \") {\n fileInputRef.current?.click();\n }\n }}\n >\n <i className=\"ri-upload-2-line text-2xl text-muted-foreground\" />\n <Typography\n className=\"mt-1 text-blue-600 hover:underline\"\n variant=\"caption\"\n weight=\"medium\"\n >\n {t(\"neetoPayments.upi.payment.screenshot.uploadText\")}\n </Typography>\n <Typography color=\"muted\" variant=\"nano\">\n {t(\"neetoPayments.upi.payment.screenshot.formatHint\", {\n maxSize: MAX_SCREENSHOT_SIZE_MB,\n })}\n </Typography>\n </div>\n )}\n <input\n accept={ACCEPTED_SCREENSHOT_FORMATS}\n className=\"hidden\"\n data-testid=\"manual-upi-screenshot-upload-input-field\"\n ref={fileInputRef}\n type=\"file\"\n onChange={handleScreenshotSelect}\n />\n </div>\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 && !screenshotFile) || isPending || isUploading,\n loading: isPending || isUploading,\n }}\n />\n </>\n )}\n </Form>\n );\n};\n\nexport default ManualUpiPayment;\n"],"names":["ACCEPTED_SCREENSHOT_FORMATS","MAX_SCREENSHOT_SIZE_MB","DIRECT_UPLOAD_URL","INITIAL_VALUES","identifier","UPI_TRANSACTION_ID_LENGTH","buildValidationSchema","screenshotFile","yup","object","number","typeError","t","entity","nullable","transform","value","originalValue","test","isPresent","isNotPresent","Number","isInteger","length","toString","toSlots","Array","from","LENGTH","_","index","UpiTransactionIdInput","name","useTranslation","meta","helpers","useField","inputsRef","useRef","slots","setSlots","useState","initialValue","sync","nextSlots","setValue","join","setDigit","digit","map","slot","i","focusBox","current","focus","handleChange","event","sanitized","target","replace","handleKeyDown","key","preventDefault","handlePaste","pasted","clipboardData","getData","slice","Math","min","showError","touched","error","_jsxs","children","_jsx","Typography","className","variant","weight","onPaste","autoComplete","inputMode","maxLength","ref","element","type","onBlur","setTouched","onChange","onFocus","select","onKeyDown","ManualUpiPayment","fee","payableId","tip","amount","discountCode","customAmount","handleCancel","payableType","onBeforePayment","noop","onFailedPayment","onSuccessfulPayment","fileInputRef","setScreenshotFile","isUploading","setIsUploading","screenshotPreview","useMemo","URL","createObjectURL","useEffect","revokeObjectURL","vpaIds","pluck","vpas","amountToUpi","isPending","mutate","createPayment","useCreateUpiPayment","onSuccess","onError","validationSchema","handleScreenshotSelect","file","files","size","Toastr","maxSize","handleRemoveScreenshot","uploadScreenshot","Promise","resolve","reject","upload","DirectUpload","create","blob","signed_id","handleSubmit","values","paymentScreenshot","tipAttributes","Form","formikProps","onSubmit","initialValues","dirty","_Fragment","count","vpaId","QRCodeImage","style","width","height","getQrCodeValue","color","alt","src","Button","icon","X","onClick","role","tabIndex","click","e","accept","ActionBlock","cancelButtonProps","label","disabled","submitButtonProps","loading"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAIO,MAAMA,2BAA2B,GAAG,gCAAgC;AAEpE,MAAMC,sBAAsB,GAAG,CAAC;AAEhC,MAAMC,iBAAiB,GAAG,sCAAsC;AAEhE,MAAMC,cAAc,GAAG;AAAEC,EAAAA,UAAU,EAAE;AAAG,CAAC;AAEzC,MAAMC,yBAAyB,GAAG,EAAE;AAEpC,MAAMC,qBAAqB,GAAGC,cAAc,IACjDC,GAAG,CAACC,MAAM,CAAC;AACTL,EAAAA,UAAU,EAAEI,GAAG,CACZE,MAAM,EAAE,CACRC,SAAS,CACRC,CAAC,CAAC,wCAAwC,EAAE;IAC1CC,MAAM,EAAED,CAAC,CAAC,oCAAoC;GAC/C,CACH,CAAC,CACAE,QAAQ,EAAE,CACVC,SAAS,CAAC,CAACC,KAAK,EAAEC,aAAa,KAC9BA,aAAa,KAAK,EAAE,GAAG,IAAI,GAAGD,KAChC,CAAC,CACAE,IAAI,CACH,0BAA0B,EAC1BN,CAAC,CAAC,8DAA8D,CAAC,EACjEI,KAAK,IAAIG,SAAS,CAACH,KAAK,CAAC,IAAIG,SAAS,CAACZ,cAAc,CACvD,CAAC,CACAW,IAAI,CACH,YAAY,EACZN,CAAC,CAAC,wCAAwC,EAAE;IAC1CC,MAAM,EAAED,CAAC,CAAC,oCAAoC;G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,KAAK,EAAElK,CAAC,CAAC,0CAA0C,CAAC;UACpDmK,QAAQ,EAAG,CAACxB,KAAK,IAAI,CAAChJ,cAAc,IAAKiH,SAAS,IAAIZ,WAAW;UACjEqE,OAAO,EAAEzD,SAAS,IAAIZ;AACxB;AAAE,OACH,CAAC;KACF;AACH,GACG,CAAC;AAEX;;;;"}
|
|
@@ -4,7 +4,7 @@ import { Form, Select, Textarea, ActionBlock } from '@bigbinary/neeto-atoms/form
|
|
|
4
4
|
import { noop, findBy } from 'neetocist';
|
|
5
5
|
import { mergeLeft } from 'ramda';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import {
|
|
7
|
+
import { u as useUpdateUpiPayment } from '../usePaymentApi-CjtkL3IU.js';
|
|
8
8
|
import { t } from 'i18next';
|
|
9
9
|
import * as yup from 'yup';
|
|
10
10
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
@@ -3,7 +3,7 @@ import { Button, Dialog, Typography } from '@bigbinary/neeto-atoms';
|
|
|
3
3
|
import { Form, Textarea, ActionBlock } from '@bigbinary/neeto-atoms/formik';
|
|
4
4
|
import { noop } from 'neetocist';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import {
|
|
6
|
+
import { u as useUpdateUpiPayment } from '../usePaymentApi-CjtkL3IU.js';
|
|
7
7
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
8
8
|
import '@tanstack/react-query';
|
|
9
9
|
import 'neetocommons/react-utils';
|
package/dist/v2/index.js
CHANGED
|
@@ -67,7 +67,8 @@ import 'neetocommons/v2/utils';
|
|
|
67
67
|
import '@bigbinary/neeto-molecules/v2/MoreDropdown';
|
|
68
68
|
import '@rails/activestorage';
|
|
69
69
|
import 'qrcode.react';
|
|
70
|
-
import '../usePaymentApi-
|
|
70
|
+
import '../usePaymentApi-CjtkL3IU.js';
|
|
71
|
+
import 'formik';
|
|
71
72
|
import '../ExportModal-k--5vSLt.js';
|
|
72
73
|
import '../useExportsApi-C1wjoVYy.js';
|
|
73
74
|
import '../usePaymentsApi-C2xbgHmw.js';
|
package/dist/v2/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-payments-frontend",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.7",
|
|
4
4
|
"description": "To manage payments across the neeto products.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://github.com/bigbinary/neeto-payments-nano",
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
"@bigbinary/neeto-atoms": "1.0.90",
|
|
76
76
|
"@bigbinary/neeto-cist": "1.0.17",
|
|
77
77
|
"@bigbinary/neeto-commons-frontend": "4.13.138",
|
|
78
|
-
"@bigbinary/neeto-editor": "1.47.
|
|
78
|
+
"@bigbinary/neeto-editor": "1.47.120",
|
|
79
79
|
"@bigbinary/neeto-filters-frontend": "4.3.40",
|
|
80
80
|
"@bigbinary/neeto-icons": "1.20.89",
|
|
81
|
-
"@bigbinary/neeto-molecules": "5.1.
|
|
81
|
+
"@bigbinary/neeto-molecules": "5.1.35",
|
|
82
82
|
"@dnd-kit/core": "6.3.1",
|
|
83
83
|
"@dnd-kit/sortable": "10.0.0",
|
|
84
84
|
"@emotion/is-prop-valid": "1.2.0",
|
|
@@ -189,10 +189,10 @@
|
|
|
189
189
|
"@bigbinary/neeto-atoms": "1.0.90",
|
|
190
190
|
"@bigbinary/neeto-cist": "1.0.17",
|
|
191
191
|
"@bigbinary/neeto-commons-frontend": "4.13.138",
|
|
192
|
-
"@bigbinary/neeto-editor": "1.47.
|
|
192
|
+
"@bigbinary/neeto-editor": "1.47.120",
|
|
193
193
|
"@bigbinary/neeto-filters-frontend": "4.3.40",
|
|
194
194
|
"@bigbinary/neeto-icons": "1.20.89",
|
|
195
|
-
"@bigbinary/neeto-molecules": "5.1.
|
|
195
|
+
"@bigbinary/neeto-molecules": "5.1.35",
|
|
196
196
|
"@dnd-kit/core": "6.3.1",
|
|
197
197
|
"@dnd-kit/sortable": "10.0.0",
|
|
198
198
|
"@honeybadger-io/js": "6.10.1",
|