@bigbinary/neeto-payments-frontend 2.2.0 → 2.2.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/app/javascript/src/translations/en.json +11 -2
- package/dist/AccountsDashboard.js +368 -302
- package/dist/AccountsDashboard.js.map +1 -1
- package/dist/CopyButtonWrapper-54c5e270.js +27 -0
- package/dist/CopyButtonWrapper-54c5e270.js.map +1 -0
- package/dist/Dashboard.js +532 -440
- package/dist/Dashboard.js.map +1 -1
- package/dist/ExportModal-e95e0af1.js +694 -0
- package/dist/ExportModal-e95e0af1.js.map +1 -0
- package/dist/IdentifierButton-350fcc55.js +19 -0
- package/dist/IdentifierButton-350fcc55.js.map +1 -0
- package/dist/PaymentKindRestrictionAlert.js +18 -12
- package/dist/PaymentKindRestrictionAlert.js.map +1 -1
- package/dist/PaymentsDashboard.js +474 -0
- package/dist/PaymentsDashboard.js.map +1 -0
- package/dist/PayoutsDashboard.js +373 -315
- package/dist/PayoutsDashboard.js.map +1 -1
- package/dist/PayoutsPage.js +136 -112
- package/dist/PayoutsPage.js.map +1 -1
- package/dist/RazorpayDashboard.js +184 -172
- package/dist/RazorpayDashboard.js.map +1 -1
- package/dist/RazorpayPaymentButton.js +92 -66
- package/dist/RazorpayPaymentButton.js.map +1 -1
- package/dist/StripeConnect.js +359 -318
- package/dist/StripeConnect.js.map +1 -1
- package/dist/UpiConnect.js +128 -106
- package/dist/UpiConnect.js.map +1 -1
- package/dist/UpiMarkAsPaidButton.js +22 -21
- package/dist/UpiMarkAsPaidButton.js.map +1 -1
- package/dist/UpiPayment.js +75 -63
- package/dist/UpiPayment.js.map +1 -1
- package/dist/V2PaymentsDashboard.js +185 -176
- package/dist/V2PaymentsDashboard.js.map +1 -1
- package/dist/_commonjsHelpers-ae89b920.js +6 -0
- package/dist/_commonjsHelpers-ae89b920.js.map +1 -0
- package/dist/buildStripeTransactionLink.js +2 -2
- package/dist/cjs/AccountsDashboard.js +369 -303
- package/dist/cjs/AccountsDashboard.js.map +1 -1
- package/dist/cjs/CopyButtonWrapper-57331e1c.js +34 -0
- package/dist/cjs/CopyButtonWrapper-57331e1c.js.map +1 -0
- package/dist/cjs/Dashboard.js +533 -441
- package/dist/cjs/Dashboard.js.map +1 -1
- package/dist/cjs/ExportModal-730a91b8.js +718 -0
- package/dist/cjs/ExportModal-730a91b8.js.map +1 -0
- package/dist/cjs/IdentifierButton-3162ff10.js +25 -0
- package/dist/cjs/IdentifierButton-3162ff10.js.map +1 -0
- package/dist/cjs/PaymentKindRestrictionAlert.js +18 -12
- package/dist/cjs/PaymentKindRestrictionAlert.js.map +1 -1
- package/dist/cjs/PaymentsDashboard.js +492 -0
- package/dist/cjs/PaymentsDashboard.js.map +1 -0
- package/dist/cjs/PayoutsDashboard.js +374 -316
- package/dist/cjs/PayoutsDashboard.js.map +1 -1
- package/dist/cjs/PayoutsPage.js +136 -112
- package/dist/cjs/PayoutsPage.js.map +1 -1
- package/dist/cjs/RazorpayDashboard.js +185 -173
- package/dist/cjs/RazorpayDashboard.js.map +1 -1
- package/dist/cjs/RazorpayPaymentButton.js +92 -66
- package/dist/cjs/RazorpayPaymentButton.js.map +1 -1
- package/dist/cjs/StripeConnect.js +356 -315
- package/dist/cjs/StripeConnect.js.map +1 -1
- package/dist/cjs/UpiConnect.js +129 -107
- package/dist/cjs/UpiConnect.js.map +1 -1
- package/dist/cjs/UpiMarkAsPaidButton.js +22 -21
- package/dist/cjs/UpiMarkAsPaidButton.js.map +1 -1
- package/dist/cjs/UpiPayment.js +75 -63
- package/dist/cjs/UpiPayment.js.map +1 -1
- package/dist/cjs/V2PaymentsDashboard.js +186 -177
- package/dist/cjs/V2PaymentsDashboard.js.map +1 -1
- package/dist/cjs/_commonjsHelpers-755157d3.js +8 -0
- package/dist/cjs/_commonjsHelpers-755157d3.js.map +1 -0
- package/dist/cjs/buildStripeTransactionLink.js +1 -1
- package/dist/cjs/constants.js +12 -12
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/defineProperty-f3094d6c.js +45 -0
- package/dist/cjs/defineProperty-f3094d6c.js.map +1 -0
- package/dist/cjs/exportChannel-2d528a51.js +45 -0
- package/dist/cjs/{exportChannel-1c3103ef.js.map → exportChannel-2d528a51.js.map} +1 -1
- package/dist/cjs/{index-b7badf96.js → index-1ce7ebb8.js} +8 -8
- package/dist/cjs/{index-b7badf96.js.map → index-1ce7ebb8.js.map} +1 -1
- package/dist/cjs/index-6f9eb83b.js +387 -0
- package/dist/cjs/index-6f9eb83b.js.map +1 -0
- package/dist/cjs/index-8a575dd1.js +47 -0
- package/dist/cjs/index-8a575dd1.js.map +1 -0
- package/dist/cjs/index.js +31 -22
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/objectWithoutProperties-2fed2d7d.js +33 -0
- package/dist/cjs/objectWithoutProperties-2fed2d7d.js.map +1 -0
- package/dist/cjs/{queryConstants-45f84f3e.js → queryConstants-cb79f600.js} +4 -3
- package/dist/cjs/queryConstants-cb79f600.js.map +1 -0
- package/dist/cjs/renderFunctions-0284d0cb.js +159 -0
- package/dist/cjs/renderFunctions-0284d0cb.js.map +1 -0
- package/dist/cjs/slicedToArray-f320d9e7.js +61 -0
- package/dist/cjs/slicedToArray-f320d9e7.js.map +1 -0
- package/dist/cjs/toConsumableArray-9abb3858.js +22 -0
- package/dist/cjs/toConsumableArray-9abb3858.js.map +1 -0
- package/dist/cjs/{useConnectApi-a80cbf88.js → useConnectApi-67c912ae.js} +106 -85
- package/dist/cjs/useConnectApi-67c912ae.js.map +1 -0
- package/dist/cjs/useFiltersAndPagination-cd8bd491.js +316 -0
- package/dist/cjs/useFiltersAndPagination-cd8bd491.js.map +1 -0
- package/dist/cjs/usePaymentApi-7c41a34a.js +57 -0
- package/dist/cjs/usePaymentApi-7c41a34a.js.map +1 -0
- package/dist/cjs/usePaymentsApi-f53c5543.js +45 -0
- package/dist/cjs/usePaymentsApi-f53c5543.js.map +1 -0
- package/dist/cjs/usePlatformApi-365cf2dc.js +149 -0
- package/dist/cjs/usePlatformApi-365cf2dc.js.map +1 -0
- package/dist/cjs/useRazorpayPayment.js +70 -48
- package/dist/cjs/useRazorpayPayment.js.map +1 -1
- package/dist/cjs/useStripePromise.js +41 -16
- package/dist/cjs/useStripePromise.js.map +1 -1
- package/dist/constants.js +12 -12
- package/dist/constants.js.map +1 -1
- package/dist/defineProperty-e90a259c.js +43 -0
- package/dist/defineProperty-e90a259c.js.map +1 -0
- package/dist/exportChannel-e33c4c66.js +38 -0
- package/dist/{exportChannel-23e4628c.js.map → exportChannel-e33c4c66.js.map} +1 -1
- package/dist/index-1fdfa272.js +384 -0
- package/dist/index-1fdfa272.js.map +1 -0
- package/dist/{index-1aedc364.js → index-adf12baa.js} +8 -8
- package/dist/{index-1aedc364.js.map → index-adf12baa.js.map} +1 -1
- package/dist/index-f03e9537.js +38 -0
- package/dist/index-f03e9537.js.map +1 -0
- package/dist/index.js +29 -21
- package/dist/index.js.map +1 -1
- package/dist/objectWithoutProperties-a0edb288.js +31 -0
- package/dist/objectWithoutProperties-a0edb288.js.map +1 -0
- package/dist/{queryConstants-7d91832f.js → queryConstants-fada3549.js} +4 -3
- package/dist/queryConstants-fada3549.js.map +1 -0
- package/dist/renderFunctions-3640a4cf.js +143 -0
- package/dist/renderFunctions-3640a4cf.js.map +1 -0
- package/dist/slicedToArray-b4278ecd.js +57 -0
- package/dist/slicedToArray-b4278ecd.js.map +1 -0
- package/dist/toConsumableArray-1cc38429.js +20 -0
- package/dist/toConsumableArray-1cc38429.js.map +1 -0
- package/dist/{useConnectApi-36a92bd8.js → useConnectApi-b4fc32db.js} +107 -86
- package/dist/useConnectApi-b4fc32db.js.map +1 -0
- package/dist/useFiltersAndPagination-d14df27d.js +302 -0
- package/dist/useFiltersAndPagination-d14df27d.js.map +1 -0
- package/dist/usePaymentApi-433482f2.js +50 -0
- package/dist/usePaymentApi-433482f2.js.map +1 -0
- package/dist/usePaymentsApi-e95b2517.js +38 -0
- package/dist/usePaymentsApi-e95b2517.js.map +1 -0
- package/dist/usePlatformApi-9711698e.js +137 -0
- package/dist/usePlatformApi-9711698e.js.map +1 -0
- package/dist/useRazorpayPayment.js +70 -48
- package/dist/useRazorpayPayment.js.map +1 -1
- package/dist/useStripePromise.js +41 -16
- package/dist/useStripePromise.js.map +1 -1
- package/package.json +1 -1
- package/dist/ExportModal-23f4fa34.js +0 -645
- package/dist/ExportModal-23f4fa34.js.map +0 -1
- package/dist/IdentifierButton-81450a91.js +0 -20
- package/dist/IdentifierButton-81450a91.js.map +0 -1
- package/dist/cjs/ExportModal-b94a33bf.js +0 -669
- package/dist/cjs/ExportModal-b94a33bf.js.map +0 -1
- package/dist/cjs/IdentifierButton-c5f8ded9.js +0 -26
- package/dist/cjs/IdentifierButton-c5f8ded9.js.map +0 -1
- package/dist/cjs/exportChannel-1c3103ef.js +0 -39
- package/dist/cjs/extends-1b35a664.js +0 -19
- package/dist/cjs/extends-1b35a664.js.map +0 -1
- package/dist/cjs/index-e317e851.js +0 -41
- package/dist/cjs/index-e317e851.js.map +0 -1
- package/dist/cjs/queryConstants-45f84f3e.js.map +0 -1
- package/dist/cjs/renderFunctions-621282bb.js +0 -165
- package/dist/cjs/renderFunctions-621282bb.js.map +0 -1
- package/dist/cjs/useConnectApi-a80cbf88.js.map +0 -1
- package/dist/cjs/useFiltersAndPagination-98eb45d6.js +0 -276
- package/dist/cjs/useFiltersAndPagination-98eb45d6.js.map +0 -1
- package/dist/cjs/usePaymentApi-77803596.js +0 -48
- package/dist/cjs/usePaymentApi-77803596.js.map +0 -1
- package/dist/cjs/usePaymentsApi-239e8d8a.js +0 -36
- package/dist/cjs/usePaymentsApi-239e8d8a.js.map +0 -1
- package/dist/cjs/usePlatformApi-6740cf80.js +0 -117
- package/dist/cjs/usePlatformApi-6740cf80.js.map +0 -1
- package/dist/exportChannel-23e4628c.js +0 -32
- package/dist/extends-093996c9.js +0 -17
- package/dist/extends-093996c9.js.map +0 -1
- package/dist/index-385083ef.js +0 -32
- package/dist/index-385083ef.js.map +0 -1
- package/dist/queryConstants-7d91832f.js.map +0 -1
- package/dist/renderFunctions-ac5ef9d0.js +0 -146
- package/dist/renderFunctions-ac5ef9d0.js.map +0 -1
- package/dist/useConnectApi-36a92bd8.js.map +0 -1
- package/dist/useFiltersAndPagination-8813cdb2.js +0 -262
- package/dist/useFiltersAndPagination-8813cdb2.js.map +0 -1
- package/dist/usePaymentApi-edc45d99.js +0 -41
- package/dist/usePaymentApi-edc45d99.js.map +0 -1
- package/dist/usePaymentsApi-663c4058.js +0 -29
- package/dist/usePaymentsApi-663c4058.js.map +0 -1
- package/dist/usePlatformApi-3faabc82.js +0 -105
- package/dist/usePlatformApi-3faabc82.js.map +0 -1
|
@@ -1,669 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React$1 = require('react');
|
|
4
|
-
var Download = require('@bigbinary/neeto-icons/Download');
|
|
5
|
-
var Button = require('@bigbinary/neetoui/Button');
|
|
6
|
-
var Modal = require('@bigbinary/neetoui/Modal');
|
|
7
|
-
var Typography = require('@bigbinary/neetoui/Typography');
|
|
8
|
-
var reactI18next = require('react-i18next');
|
|
9
|
-
var reactQuery = require('@tanstack/react-query');
|
|
10
|
-
var axios = require('axios');
|
|
11
|
-
var constants = require('./constants.js');
|
|
12
|
-
var exportChannel = require('./exportChannel-1c3103ef.js');
|
|
13
|
-
var index = require('./index-e317e851.js');
|
|
14
|
-
var neetoCist = require('@bigbinary/neeto-cist');
|
|
15
|
-
var ramda = require('ramda');
|
|
16
|
-
var i18next = require('i18next');
|
|
17
|
-
var Tag = require('@bigbinary/neetoui/Tag');
|
|
18
|
-
var Tooltip = require('@bigbinary/neetoui/Tooltip');
|
|
19
|
-
var renderFunctions = require('./renderFunctions-621282bb.js');
|
|
20
|
-
var IdentifierButton = require('./IdentifierButton-c5f8ded9.js');
|
|
21
|
-
var index$1 = require('./index-b7badf96.js');
|
|
22
|
-
|
|
23
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
|
-
|
|
25
|
-
var Download__default = /*#__PURE__*/_interopDefaultLegacy(Download);
|
|
26
|
-
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
27
|
-
var Modal__default = /*#__PURE__*/_interopDefaultLegacy(Modal);
|
|
28
|
-
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
29
|
-
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
30
|
-
var Tag__default = /*#__PURE__*/_interopDefaultLegacy(Tag);
|
|
31
|
-
var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
|
|
32
|
-
|
|
33
|
-
const exportData = payload => axios__default["default"].post(`${constants.BASE_URL}/api/v1/razorpay/exports`, payload);
|
|
34
|
-
const exportsApi = {
|
|
35
|
-
exportData
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const useExportRazorpayData = () => reactQuery.useMutation({
|
|
39
|
-
mutationFn: exportsApi.exportData
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
const renderIdentifier = function () {
|
|
43
|
-
let {
|
|
44
|
-
identifier = "",
|
|
45
|
-
live: isLive = false
|
|
46
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
47
|
-
return /*#__PURE__*/React.createElement(renderFunctions.CopyButtonWrapper, {
|
|
48
|
-
content: identifier
|
|
49
|
-
}, /*#__PURE__*/React.createElement(IdentifierButton.IdentifierButton, {
|
|
50
|
-
href: index.buildStripeTransactionLink(identifier, isLive),
|
|
51
|
-
label: identifier
|
|
52
|
-
}));
|
|
53
|
-
};
|
|
54
|
-
ramda.curry((type, kind) => /*#__PURE__*/React.createElement(Tooltip__default["default"], {
|
|
55
|
-
content: i18next.t(`neetoPayments.tooltipContent.${type}.${kind}`),
|
|
56
|
-
position: "top"
|
|
57
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
className: "w-fit"
|
|
59
|
-
}, /*#__PURE__*/React.createElement(Tag__default["default"], {
|
|
60
|
-
label: i18next.t(`neetoPayments.tagLabels.${type}.${kind}`),
|
|
61
|
-
style: "secondary"
|
|
62
|
-
}))));
|
|
63
|
-
const renderSplitIdentifier = _ref => {
|
|
64
|
-
let {
|
|
65
|
-
identifier,
|
|
66
|
-
live: isLive
|
|
67
|
-
} = _ref;
|
|
68
|
-
return identifier ? /*#__PURE__*/React.createElement(renderFunctions.CopyButtonWrapper, {
|
|
69
|
-
content: identifier
|
|
70
|
-
}, /*#__PURE__*/React.createElement(IdentifierButton.IdentifierButton, {
|
|
71
|
-
href: index.buildStripeSplitLink(identifier, isLive),
|
|
72
|
-
label: identifier
|
|
73
|
-
})) : /*#__PURE__*/React.createElement(Tooltip__default["default"], {
|
|
74
|
-
content: i18next.t("neetoPayments.tooltipContent.identifierUnavailable"),
|
|
75
|
-
position: "top"
|
|
76
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
77
|
-
className: "text-center"
|
|
78
|
-
}, /*#__PURE__*/React.createElement(Typography__default["default"], {
|
|
79
|
-
style: "body2"
|
|
80
|
-
}, i18next.t("neetoPayments.common.notAvailable"))));
|
|
81
|
-
};
|
|
82
|
-
const renderTransferIdentifier = function () {
|
|
83
|
-
let {
|
|
84
|
-
identifier = "",
|
|
85
|
-
account = {},
|
|
86
|
-
live: isLive = false
|
|
87
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
88
|
-
return identifier ? /*#__PURE__*/React.createElement(renderFunctions.CopyButtonWrapper, {
|
|
89
|
-
content: identifier
|
|
90
|
-
}, /*#__PURE__*/React.createElement(IdentifierButton.IdentifierButton, {
|
|
91
|
-
label: identifier,
|
|
92
|
-
href: identifier.startsWith("py") ? index.buildStripeTransferLink(identifier, account?.identifier, isLive) : index.buildStripeTransactionLink(identifier, isLive)
|
|
93
|
-
})) : /*#__PURE__*/React.createElement("div", {
|
|
94
|
-
className: "text-center"
|
|
95
|
-
}, /*#__PURE__*/React.createElement(Tooltip__default["default"], {
|
|
96
|
-
position: "top",
|
|
97
|
-
content: i18next.t("neetoPayments.tooltipContent.connectedTransactionUnavailable")
|
|
98
|
-
}, /*#__PURE__*/React.createElement(Typography__default["default"], {
|
|
99
|
-
style: "body2"
|
|
100
|
-
}, i18next.t("neetoPayments.common.notAvailable"))));
|
|
101
|
-
};
|
|
102
|
-
const renderPlatformIdentifier = ramda.curry((setPaneStatus, data) => /*#__PURE__*/React.createElement(renderFunctions.CopyButtonWrapper, {
|
|
103
|
-
content: data?.identifier
|
|
104
|
-
}, /*#__PURE__*/React.createElement(Button__default["default"], {
|
|
105
|
-
label: data?.identifier,
|
|
106
|
-
size: "small",
|
|
107
|
-
style: "link",
|
|
108
|
-
onClick: () => setPaneStatus({
|
|
109
|
-
transactionId: data?.id,
|
|
110
|
-
isOpen: true
|
|
111
|
-
})
|
|
112
|
-
})));
|
|
113
|
-
const renderAccountIdentifier = _ref2 => {
|
|
114
|
-
let {
|
|
115
|
-
identifier = "",
|
|
116
|
-
live: isLive = false
|
|
117
|
-
} = _ref2;
|
|
118
|
-
return /*#__PURE__*/React.createElement(renderFunctions.CopyButtonWrapper, {
|
|
119
|
-
content: identifier
|
|
120
|
-
}, /*#__PURE__*/React.createElement(IdentifierButton.IdentifierButton, {
|
|
121
|
-
href: index.buildStripeAccountLink(identifier, isLive),
|
|
122
|
-
label: identifier
|
|
123
|
-
}));
|
|
124
|
-
};
|
|
125
|
-
const renderSplitDate = date => neetoCist.isPresent(date) ? renderFunctions.renderDate(date) : /*#__PURE__*/React.createElement(Tooltip__default["default"], {
|
|
126
|
-
content: i18next.t("neetoPayments.tooltipContent.dateUnavailable"),
|
|
127
|
-
position: "top"
|
|
128
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
129
|
-
className: "text-center"
|
|
130
|
-
}, /*#__PURE__*/React.createElement(Typography__default["default"], {
|
|
131
|
-
style: "body2"
|
|
132
|
-
}, i18next.t("neetoPayments.common.notAvailable"))));
|
|
133
|
-
const renderRefundIdentifier = function () {
|
|
134
|
-
let {
|
|
135
|
-
identifier = "",
|
|
136
|
-
live: isLive = false
|
|
137
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
138
|
-
return /*#__PURE__*/React.createElement(renderFunctions.CopyButtonWrapper, {
|
|
139
|
-
content: identifier
|
|
140
|
-
}, /*#__PURE__*/React.createElement(IdentifierButton.IdentifierButton, {
|
|
141
|
-
href: index.buildStripeRefundLink(identifier, isLive),
|
|
142
|
-
label: identifier
|
|
143
|
-
}));
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const generateSpecialColumns = _ref => {
|
|
147
|
-
let {
|
|
148
|
-
setPaneStatus
|
|
149
|
-
} = _ref;
|
|
150
|
-
return [{
|
|
151
|
-
title: i18next.t("neetoPayments.common.platformTransaction"),
|
|
152
|
-
dataIndex: "paymentIntent",
|
|
153
|
-
key: "paymentIntent",
|
|
154
|
-
width: "290px",
|
|
155
|
-
position: 9,
|
|
156
|
-
render: renderPlatformIdentifier(setPaneStatus)
|
|
157
|
-
}];
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
const COLUMNS = [{
|
|
161
|
-
title: i18next.t("neetoPayments.common.id"),
|
|
162
|
-
dataIndex: "id",
|
|
163
|
-
key: "id",
|
|
164
|
-
width: "72px",
|
|
165
|
-
position: 0,
|
|
166
|
-
isHidable: false
|
|
167
|
-
}, {
|
|
168
|
-
title: i18next.t("neetoPayments.common.identifier"),
|
|
169
|
-
dataIndex: "identifier",
|
|
170
|
-
key: "identifier",
|
|
171
|
-
width: "300px",
|
|
172
|
-
render: renderIdentifier,
|
|
173
|
-
position: 1,
|
|
174
|
-
isHidable: false
|
|
175
|
-
}, {
|
|
176
|
-
title: i18next.t("neetoPayments.common.identifier"),
|
|
177
|
-
dataIndex: "identifier",
|
|
178
|
-
key: "splitIdentifier",
|
|
179
|
-
width: "300px",
|
|
180
|
-
render: renderSplitIdentifier,
|
|
181
|
-
position: 1,
|
|
182
|
-
isHidable: false
|
|
183
|
-
}, {
|
|
184
|
-
title: i18next.t("neetoPayments.common.identifier"),
|
|
185
|
-
dataIndex: "identifier",
|
|
186
|
-
key: "refundIdentifier",
|
|
187
|
-
width: "300px",
|
|
188
|
-
render: renderRefundIdentifier,
|
|
189
|
-
position: 1,
|
|
190
|
-
isHidable: false
|
|
191
|
-
}, {
|
|
192
|
-
title: i18next.t("neetoPayments.common.identifier"),
|
|
193
|
-
dataIndex: "identifier",
|
|
194
|
-
key: "transferIdentifier",
|
|
195
|
-
width: "300px",
|
|
196
|
-
render: renderTransferIdentifier,
|
|
197
|
-
position: 1,
|
|
198
|
-
isHidable: false
|
|
199
|
-
}, {
|
|
200
|
-
title: i18next.t("neetoPayments.common.status"),
|
|
201
|
-
dataIndex: "status",
|
|
202
|
-
key: "status",
|
|
203
|
-
width: "150px",
|
|
204
|
-
render: renderFunctions.renderStatus("transaction"),
|
|
205
|
-
sorter: true,
|
|
206
|
-
position: 2,
|
|
207
|
-
isHidable: false
|
|
208
|
-
}, {
|
|
209
|
-
title: i18next.t("neetoPayments.common.amount"),
|
|
210
|
-
dataIndex: "amount",
|
|
211
|
-
key: "amount",
|
|
212
|
-
width: "150px",
|
|
213
|
-
sorter: true,
|
|
214
|
-
position: 3
|
|
215
|
-
}, {
|
|
216
|
-
title: i18next.t("neetoPayments.common.platformShare"),
|
|
217
|
-
dataIndex: "platformShare",
|
|
218
|
-
key: "platformShare",
|
|
219
|
-
width: "280px",
|
|
220
|
-
position: 3
|
|
221
|
-
}, {
|
|
222
|
-
title: i18next.t("neetoPayments.common.paymentTime"),
|
|
223
|
-
dataIndex: "paymentAt",
|
|
224
|
-
key: "paymentTime",
|
|
225
|
-
width: "220px",
|
|
226
|
-
render: renderFunctions.renderDate,
|
|
227
|
-
sorter: true,
|
|
228
|
-
position: 5
|
|
229
|
-
}, {
|
|
230
|
-
title: i18next.t("neetoPayments.common.refundTime"),
|
|
231
|
-
dataIndex: "refunds",
|
|
232
|
-
key: "refundsTime",
|
|
233
|
-
width: "220px",
|
|
234
|
-
render: function () {
|
|
235
|
-
let refunds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
236
|
-
return renderFunctions.renderDate(refunds[0]?.updatedAt);
|
|
237
|
-
},
|
|
238
|
-
position: 6
|
|
239
|
-
}, {
|
|
240
|
-
title: i18next.t("neetoPayments.common.status"),
|
|
241
|
-
dataIndex: "status",
|
|
242
|
-
width: "150px",
|
|
243
|
-
key: "refundStatus",
|
|
244
|
-
render: renderFunctions.renderStatus("refund"),
|
|
245
|
-
sorter: true,
|
|
246
|
-
position: 3,
|
|
247
|
-
isHidable: false
|
|
248
|
-
}, {
|
|
249
|
-
title: i18next.t("neetoPayments.common.paymentAmount"),
|
|
250
|
-
dataIndex: "paymentAmount",
|
|
251
|
-
key: "paymentAmount",
|
|
252
|
-
width: "240px",
|
|
253
|
-
sorter: true,
|
|
254
|
-
position: 4
|
|
255
|
-
}, {
|
|
256
|
-
title: i18next.t("neetoPayments.common.refundAmount"),
|
|
257
|
-
dataIndex: "amount",
|
|
258
|
-
key: "refundAmount",
|
|
259
|
-
width: "200px",
|
|
260
|
-
sorter: true,
|
|
261
|
-
position: 3
|
|
262
|
-
}, {
|
|
263
|
-
title: i18next.t("neetoPayments.common.refundTime"),
|
|
264
|
-
dataIndex: "updatedAt",
|
|
265
|
-
key: "refundTime",
|
|
266
|
-
width: "220px",
|
|
267
|
-
render: renderFunctions.renderDate,
|
|
268
|
-
sorter: true,
|
|
269
|
-
position: 9
|
|
270
|
-
}, {
|
|
271
|
-
title: i18next.t("neetoPayments.common.status"),
|
|
272
|
-
dataIndex: "status",
|
|
273
|
-
key: "splitStatus",
|
|
274
|
-
width: "150px",
|
|
275
|
-
render: renderFunctions.renderStatus("split"),
|
|
276
|
-
sorter: true,
|
|
277
|
-
position: 3,
|
|
278
|
-
isHidable: false
|
|
279
|
-
}, {
|
|
280
|
-
title: i18next.t("neetoPayments.common.transferTime"),
|
|
281
|
-
key: "splitTime",
|
|
282
|
-
dataIndex: "paymentAt",
|
|
283
|
-
width: "220px",
|
|
284
|
-
render: renderSplitDate,
|
|
285
|
-
sorter: true,
|
|
286
|
-
position: 7
|
|
287
|
-
}, {
|
|
288
|
-
title: i18next.t("neetoPayments.common.paymentIdentifier"),
|
|
289
|
-
key: "refundPaymentIdentifier",
|
|
290
|
-
dataIndex: "transaction",
|
|
291
|
-
width: "300px",
|
|
292
|
-
render: renderTransferIdentifier,
|
|
293
|
-
position: 8
|
|
294
|
-
}, {
|
|
295
|
-
title: i18next.t("neetoPayments.common.connectedTransaction"),
|
|
296
|
-
dataIndex: "connectedPayment",
|
|
297
|
-
key: "connectedPayment",
|
|
298
|
-
width: "300px",
|
|
299
|
-
render: renderTransferIdentifier,
|
|
300
|
-
position: 9
|
|
301
|
-
}, {
|
|
302
|
-
title: i18next.t("neetoPayments.common.accountIdentifier"),
|
|
303
|
-
dataIndex: "account",
|
|
304
|
-
key: "destinationAccount",
|
|
305
|
-
width: "160px",
|
|
306
|
-
render: renderAccountIdentifier,
|
|
307
|
-
position: 10
|
|
308
|
-
}];
|
|
309
|
-
const COLUMN_METADATA = {
|
|
310
|
-
identifier: {
|
|
311
|
-
isHidden: {
|
|
312
|
-
split: true,
|
|
313
|
-
transfer: true,
|
|
314
|
-
refund: true
|
|
315
|
-
}
|
|
316
|
-
},
|
|
317
|
-
amount: {
|
|
318
|
-
isHidden: {
|
|
319
|
-
refund: true
|
|
320
|
-
}
|
|
321
|
-
},
|
|
322
|
-
paymentTime: {
|
|
323
|
-
isHidden: {
|
|
324
|
-
refund: true,
|
|
325
|
-
split: true
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
|
-
splitIdentifier: {
|
|
329
|
-
isHidden: {
|
|
330
|
-
platform: true,
|
|
331
|
-
refund: true,
|
|
332
|
-
connected: true,
|
|
333
|
-
transfer: true,
|
|
334
|
-
pending: true
|
|
335
|
-
}
|
|
336
|
-
},
|
|
337
|
-
transferIdentifier: {
|
|
338
|
-
isHidden: {
|
|
339
|
-
platform: true,
|
|
340
|
-
split: true,
|
|
341
|
-
connected: true,
|
|
342
|
-
refund: true
|
|
343
|
-
}
|
|
344
|
-
},
|
|
345
|
-
platformShare: {
|
|
346
|
-
isHidden: {
|
|
347
|
-
platform: true,
|
|
348
|
-
connected: true,
|
|
349
|
-
transfer: true,
|
|
350
|
-
refund: true
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
status: {
|
|
354
|
-
isHidden: {
|
|
355
|
-
refund: true,
|
|
356
|
-
split: true,
|
|
357
|
-
declined: true,
|
|
358
|
-
pending: true,
|
|
359
|
-
successful: true,
|
|
360
|
-
refunded: true
|
|
361
|
-
}
|
|
362
|
-
},
|
|
363
|
-
refundStatus: {
|
|
364
|
-
isHidden: {
|
|
365
|
-
platform: true,
|
|
366
|
-
split: true,
|
|
367
|
-
connected: true,
|
|
368
|
-
transfer: true,
|
|
369
|
-
failed: true,
|
|
370
|
-
pending: true,
|
|
371
|
-
successful: true
|
|
372
|
-
}
|
|
373
|
-
},
|
|
374
|
-
refundAmount: {
|
|
375
|
-
isHidden: {
|
|
376
|
-
platform: true,
|
|
377
|
-
split: true,
|
|
378
|
-
connected: true,
|
|
379
|
-
transfer: true
|
|
380
|
-
}
|
|
381
|
-
},
|
|
382
|
-
refundTime: {
|
|
383
|
-
isHidden: {
|
|
384
|
-
platform: true,
|
|
385
|
-
split: true,
|
|
386
|
-
connected: true,
|
|
387
|
-
transfer: true
|
|
388
|
-
}
|
|
389
|
-
},
|
|
390
|
-
splitStatus: {
|
|
391
|
-
isHidden: {
|
|
392
|
-
platform: true,
|
|
393
|
-
refund: true,
|
|
394
|
-
connected: true,
|
|
395
|
-
transfer: true,
|
|
396
|
-
declined: true,
|
|
397
|
-
pending: true,
|
|
398
|
-
successful: true,
|
|
399
|
-
cancelled: true
|
|
400
|
-
}
|
|
401
|
-
},
|
|
402
|
-
splitTime: {
|
|
403
|
-
isHidden: {
|
|
404
|
-
platform: true,
|
|
405
|
-
refund: true,
|
|
406
|
-
connected: true,
|
|
407
|
-
transfer: true
|
|
408
|
-
}
|
|
409
|
-
},
|
|
410
|
-
paymentIntent: {
|
|
411
|
-
isHidden: {
|
|
412
|
-
platform: true,
|
|
413
|
-
refund: true,
|
|
414
|
-
connected: true,
|
|
415
|
-
transfer: true
|
|
416
|
-
}
|
|
417
|
-
},
|
|
418
|
-
connectedPayment: {
|
|
419
|
-
isHidden: {
|
|
420
|
-
platform: true,
|
|
421
|
-
refund: true,
|
|
422
|
-
connected: true,
|
|
423
|
-
transfer: true,
|
|
424
|
-
pending: true
|
|
425
|
-
}
|
|
426
|
-
},
|
|
427
|
-
refundPaymentIdentifier: {
|
|
428
|
-
isHidden: {
|
|
429
|
-
platform: true,
|
|
430
|
-
split: true,
|
|
431
|
-
connected: true,
|
|
432
|
-
transfer: true
|
|
433
|
-
}
|
|
434
|
-
},
|
|
435
|
-
refundIdentifier: {
|
|
436
|
-
isHidden: {
|
|
437
|
-
platform: true,
|
|
438
|
-
split: true,
|
|
439
|
-
connected: true,
|
|
440
|
-
transfer: true
|
|
441
|
-
}
|
|
442
|
-
},
|
|
443
|
-
destinationAccount: {
|
|
444
|
-
isHidden: {
|
|
445
|
-
platform: true,
|
|
446
|
-
refund: true,
|
|
447
|
-
connected: true,
|
|
448
|
-
transfer: true
|
|
449
|
-
}
|
|
450
|
-
},
|
|
451
|
-
paymentAmount: {
|
|
452
|
-
isHidden: {
|
|
453
|
-
platform: true,
|
|
454
|
-
split: true,
|
|
455
|
-
connected: true,
|
|
456
|
-
transfer: true
|
|
457
|
-
}
|
|
458
|
-
},
|
|
459
|
-
refundsTime: {
|
|
460
|
-
isHidden: {
|
|
461
|
-
split: true,
|
|
462
|
-
all: true,
|
|
463
|
-
declined: true,
|
|
464
|
-
pending: true,
|
|
465
|
-
successful: true
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
};
|
|
469
|
-
const FILTER_COLUMNS = [{
|
|
470
|
-
key: "amount",
|
|
471
|
-
label: i18next.t("neetoPayments.common.amount"),
|
|
472
|
-
node: "amount",
|
|
473
|
-
type: "decimal",
|
|
474
|
-
showRuleSelector: true
|
|
475
|
-
}, {
|
|
476
|
-
key: "payment_amount",
|
|
477
|
-
label: i18next.t("neetoPayments.common.paymentAmount"),
|
|
478
|
-
node: "payment_intent.amount",
|
|
479
|
-
model: "NeetoPaymentsEngine::Stripe::Transaction",
|
|
480
|
-
type: "decimal",
|
|
481
|
-
showRuleSelector: true
|
|
482
|
-
}, {
|
|
483
|
-
key: "refund_amount",
|
|
484
|
-
label: i18next.t("neetoPayments.common.refundAmount"),
|
|
485
|
-
node: "amount",
|
|
486
|
-
type: "decimal",
|
|
487
|
-
showRuleSelector: true
|
|
488
|
-
}, {
|
|
489
|
-
key: "payment_time",
|
|
490
|
-
label: i18next.t("neetoPayments.common.paymentTime"),
|
|
491
|
-
node: "payment_at",
|
|
492
|
-
type: "date",
|
|
493
|
-
showRuleSelector: true
|
|
494
|
-
}, {
|
|
495
|
-
key: "refund_time",
|
|
496
|
-
label: i18next.t("neetoPayments.common.refundTime"),
|
|
497
|
-
node: "updated_at",
|
|
498
|
-
type: "date",
|
|
499
|
-
showRuleSelector: true
|
|
500
|
-
}, {
|
|
501
|
-
key: "split_time",
|
|
502
|
-
label: i18next.t("neetoPayments.common.transferTime"),
|
|
503
|
-
node: "payment_at",
|
|
504
|
-
type: "date",
|
|
505
|
-
showRuleSelector: true
|
|
506
|
-
}];
|
|
507
|
-
|
|
508
|
-
const isPlatformKind = ramda.equals(index$1.KIND.platform);
|
|
509
|
-
const isConnectedKind = ramda.equals(index$1.KIND.connected);
|
|
510
|
-
const isSplitKind = ramda.equals(index$1.KIND.split);
|
|
511
|
-
const isTransferKind = ramda.equals(index$1.KIND.transfer);
|
|
512
|
-
const isRefundKind = ramda.equals(index$1.KIND.refund);
|
|
513
|
-
const buildPaymentColumns = _ref => {
|
|
514
|
-
let {
|
|
515
|
-
tab,
|
|
516
|
-
kind,
|
|
517
|
-
payableEntityColumns = [],
|
|
518
|
-
specialColumnArguments = {}
|
|
519
|
-
} = _ref;
|
|
520
|
-
return ramda.sortBy(ramda.prop("position"), COLUMNS.concat(generateSpecialColumns(specialColumnArguments)).filter(_ref2 => {
|
|
521
|
-
let {
|
|
522
|
-
key
|
|
523
|
-
} = _ref2;
|
|
524
|
-
return !(COLUMN_METADATA[key]?.isHidden?.[kind] || COLUMN_METADATA[key]?.isHidden?.[tab]);
|
|
525
|
-
}).concat(payableEntityColumns.filter(_ref3 => {
|
|
526
|
-
let {
|
|
527
|
-
isHidden
|
|
528
|
-
} = _ref3;
|
|
529
|
-
return !(isHidden?.[tab] || isHidden?.[kind]);
|
|
530
|
-
})));
|
|
531
|
-
};
|
|
532
|
-
const buildFilterColumns = function (tab, kind) {
|
|
533
|
-
let payableEntityColumns = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
534
|
-
const filterColumns = FILTER_COLUMNS.filter(_ref4 => {
|
|
535
|
-
let {
|
|
536
|
-
key
|
|
537
|
-
} = _ref4;
|
|
538
|
-
return !COLUMN_METADATA[neetoCist.snakeToCamelCase(key)]?.isHidden?.[kind];
|
|
539
|
-
});
|
|
540
|
-
return ramda.concat(filterColumns, ramda.map(ramda.prop("filterProps"), neetoCist.filterBy({
|
|
541
|
-
isFilterable: true,
|
|
542
|
-
isHidden: isHidden => !(isHidden?.[tab] || isHidden?.[kind])
|
|
543
|
-
}, payableEntityColumns)));
|
|
544
|
-
};
|
|
545
|
-
const processResponse = (data, kind) => {
|
|
546
|
-
if (isSplitKind(kind)) return data?.splits;
|
|
547
|
-
if (isRefundKind(kind)) return data?.refunds;
|
|
548
|
-
return data?.transactions;
|
|
549
|
-
};
|
|
550
|
-
const modifySearchProps = _ref5 => {
|
|
551
|
-
let {
|
|
552
|
-
searchProps,
|
|
553
|
-
kind
|
|
554
|
-
} = _ref5;
|
|
555
|
-
return ramda.evolve({
|
|
556
|
-
node: ramda.concat(index$1.APPENDABLE_SEARCH_PROPS[kind]?.node),
|
|
557
|
-
model: ramda.concat(index$1.APPENDABLE_SEARCH_PROPS[kind]?.model)
|
|
558
|
-
}, searchProps);
|
|
559
|
-
};
|
|
560
|
-
|
|
561
|
-
const ExportModal = _ref => {
|
|
562
|
-
let {
|
|
563
|
-
showExportModal,
|
|
564
|
-
setShowExportModal,
|
|
565
|
-
kind,
|
|
566
|
-
tab,
|
|
567
|
-
filters,
|
|
568
|
-
holdableId,
|
|
569
|
-
sortProperties = {}
|
|
570
|
-
} = _ref;
|
|
571
|
-
const {
|
|
572
|
-
t
|
|
573
|
-
} = reactI18next.useTranslation();
|
|
574
|
-
const [downloadUrl, setDownloadUrl] = React$1.useState("");
|
|
575
|
-
const [isGenerating, setIsGenerating] = React$1.useState(false);
|
|
576
|
-
const {
|
|
577
|
-
mutate: exportRazorpayPaymentsCsv,
|
|
578
|
-
isPending: isRazorpayLoading
|
|
579
|
-
} = useExportRazorpayData();
|
|
580
|
-
const {
|
|
581
|
-
mutate: exportCsv,
|
|
582
|
-
isPending
|
|
583
|
-
} = exportChannel.useExportData();
|
|
584
|
-
const isFileLoading = isPending || isGenerating || isRazorpayLoading;
|
|
585
|
-
const token = React$1.useMemo(() => `${kind}-report-${index.uuidV4()}`, [kind]);
|
|
586
|
-
const receivedCallback = data => {
|
|
587
|
-
if (!data.download_url) return;
|
|
588
|
-
setDownloadUrl(data.download_url);
|
|
589
|
-
setIsGenerating(false);
|
|
590
|
-
};
|
|
591
|
-
const handleGenerateClick = () => {
|
|
592
|
-
const payload = {
|
|
593
|
-
kind: isTransferKind(kind) ? "connected" : kind,
|
|
594
|
-
token,
|
|
595
|
-
filters,
|
|
596
|
-
tab,
|
|
597
|
-
holdableId,
|
|
598
|
-
...sortProperties
|
|
599
|
-
};
|
|
600
|
-
if (kind === "razorpayPayment") {
|
|
601
|
-
return exportRazorpayPaymentsCsv(payload, {
|
|
602
|
-
onSuccess: () => {
|
|
603
|
-
setDownloadUrl("");
|
|
604
|
-
setIsGenerating(true);
|
|
605
|
-
}
|
|
606
|
-
});
|
|
607
|
-
}
|
|
608
|
-
return exportCsv(payload, {
|
|
609
|
-
onSuccess: () => {
|
|
610
|
-
setDownloadUrl("");
|
|
611
|
-
setIsGenerating(true);
|
|
612
|
-
}
|
|
613
|
-
});
|
|
614
|
-
};
|
|
615
|
-
React$1.useEffect(() => {
|
|
616
|
-
if (showExportModal) {
|
|
617
|
-
const channel = exportChannel.exportChannel(token, receivedCallback);
|
|
618
|
-
setDownloadUrl("");
|
|
619
|
-
setIsGenerating(false);
|
|
620
|
-
return () => {
|
|
621
|
-
channel.disconnected();
|
|
622
|
-
};
|
|
623
|
-
}
|
|
624
|
-
return undefined;
|
|
625
|
-
}, [showExportModal, token]);
|
|
626
|
-
const onClose = () => setShowExportModal(false);
|
|
627
|
-
return /*#__PURE__*/React.createElement(Modal__default["default"], {
|
|
628
|
-
onClose,
|
|
629
|
-
isOpen: showExportModal
|
|
630
|
-
}, /*#__PURE__*/React.createElement(Modal__default["default"].Header, null, /*#__PURE__*/React.createElement(Typography__default["default"], {
|
|
631
|
-
style: "h2"
|
|
632
|
-
}, t(`neetoPayments.export.title.${kind}`))), /*#__PURE__*/React.createElement(Modal__default["default"].Body, null, isFileLoading ? /*#__PURE__*/React.createElement(Typography__default["default"], {
|
|
633
|
-
style: "body2"
|
|
634
|
-
}, t("neetoPayments.export.pleaseWait")) : /*#__PURE__*/React.createElement(Typography__default["default"], {
|
|
635
|
-
style: "body2"
|
|
636
|
-
}, downloadUrl ? t("neetoPayments.export.fileReady") : t(`neetoPayments.export.download.${kind}`))), /*#__PURE__*/React.createElement(Modal__default["default"].Footer, {
|
|
637
|
-
className: "space-x-2"
|
|
638
|
-
}, downloadUrl ? /*#__PURE__*/React.createElement(Button__default["default"], {
|
|
639
|
-
href: downloadUrl,
|
|
640
|
-
icon: Download__default["default"],
|
|
641
|
-
label: t("neetoPayments.common.download"),
|
|
642
|
-
onClick: onClose
|
|
643
|
-
}) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button__default["default"], {
|
|
644
|
-
disabled: isFileLoading,
|
|
645
|
-
label: t("neetoPayments.common.cancel"),
|
|
646
|
-
style: "tertiary",
|
|
647
|
-
onClick: onClose
|
|
648
|
-
}), /*#__PURE__*/React.createElement(Button__default["default"], {
|
|
649
|
-
disabled: isFileLoading,
|
|
650
|
-
label: t("neetoPayments.common.export"),
|
|
651
|
-
loading: isFileLoading,
|
|
652
|
-
onClick: handleGenerateClick
|
|
653
|
-
}))));
|
|
654
|
-
};
|
|
655
|
-
|
|
656
|
-
exports.ExportModal = ExportModal;
|
|
657
|
-
exports.buildFilterColumns = buildFilterColumns;
|
|
658
|
-
exports.buildPaymentColumns = buildPaymentColumns;
|
|
659
|
-
exports.isConnectedKind = isConnectedKind;
|
|
660
|
-
exports.isPlatformKind = isPlatformKind;
|
|
661
|
-
exports.isRefundKind = isRefundKind;
|
|
662
|
-
exports.isSplitKind = isSplitKind;
|
|
663
|
-
exports.isTransferKind = isTransferKind;
|
|
664
|
-
exports.modifySearchProps = modifySearchProps;
|
|
665
|
-
exports.processResponse = processResponse;
|
|
666
|
-
exports.renderIdentifier = renderIdentifier;
|
|
667
|
-
exports.renderRefundIdentifier = renderRefundIdentifier;
|
|
668
|
-
exports.renderSplitIdentifier = renderSplitIdentifier;
|
|
669
|
-
//# sourceMappingURL=ExportModal-b94a33bf.js.map
|