@burdenoff/microfe-billing 2026.1108.2 → 2026.1112.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.
- package/dist/billing/BillingUserRoutes.js +202 -188
- package/dist/billing/BillingUserRoutes.js.map +1 -1
- package/dist/billing/hooks/useBillingVariant.d.ts +6 -0
- package/dist/billing/hooks/useBillingVariant.js +8 -0
- package/dist/billing/hooks/useBillingVariant.js.map +1 -0
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +169 -140
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +191 -156
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +160 -157
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +4 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/providers/BillingProvider.js +16 -15
- package/dist/billing/providers/BillingProvider.js.map +1 -1
- package/dist/billing/shared/components/MoneyActionDialog.d.ts +27 -0
- package/dist/billing/shared/components/MoneyActionDialog.js +53 -0
- package/dist/billing/shared/components/MoneyActionDialog.js.map +1 -0
- package/dist/billing/shared/components/index.d.ts +1 -0
- package/dist/billing/shared/components/index.js +2 -1
- package/dist/billing/shared/utils/accessRules.d.ts +16 -0
- package/dist/billing/shared/utils/accessRules.js +10 -0
- package/dist/billing/shared/utils/accessRules.js.map +1 -0
- package/dist/billing/shared/utils/directActivityGraphql.d.ts +2 -0
- package/dist/billing/shared/utils/directActivityGraphql.js +1 -1
- package/dist/billing/shared/utils/directBillingGraphql.d.ts +2 -0
- package/dist/billing/shared/utils/directBillingGraphql.js +2 -1
- package/dist/billing/shared/utils/directBillingGraphql.js.map +1 -1
- package/dist/billing/shared/utils/gatewayGraphql.d.ts +2 -0
- package/dist/billing/shared/utils/gatewayGraphql.js +2 -1
- package/dist/billing/shared/utils/gatewayGraphql.js.map +1 -1
- package/dist/billing/shared/utils/pinnedRequest.d.ts +48 -0
- package/dist/billing/shared/utils/pinnedRequest.js +63 -0
- package/dist/billing/shared/utils/pinnedRequest.js.map +1 -0
- package/dist/billing/types/index.d.ts +6 -0
- package/package.json +2 -2
|
@@ -1,67 +1,70 @@
|
|
|
1
1
|
import { PageHeader as e } from "../../../shared/components/PageHeader.js";
|
|
2
2
|
import { useBillingNavigate as t } from "../../../hooks/useBillingNavigate.js";
|
|
3
3
|
import { formatCurrency as n, formatDateTime as r } from "../../../shared/utils/format.js";
|
|
4
|
+
import { useBillingPermissions as ee } from "../../../hooks/useBillingPermissions.js";
|
|
5
|
+
import { useIsFluidgridsVariant as te } from "../../../hooks/useBillingVariant.js";
|
|
4
6
|
import "../../../shared/utils/index.js";
|
|
5
7
|
import "../../../shared/components/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
8
|
+
import { canShowRefundRequest as i } from "../../../shared/utils/accessRules.js";
|
|
9
|
+
import { useCreateRefundRecordMutation as a, useGetBillingAccountsCheckoutQuery as o, useGetRefundRecordsQuery as ne, useGetTransactionLazyQuery as re } from "../../../../generated/global-operations.js";
|
|
10
|
+
import { RefundRecordStatus as s } from "../../../../generated/global-types.js";
|
|
11
|
+
import { useEffect as c, useMemo as ie, useRef as l, useState as u } from "react";
|
|
12
|
+
import { CheckCircle as d, Clock as f, CreditCard as ae, Loader2 as p, PlusCircle as oe, Search as se, X as m, XCircle as h } from "lucide-react";
|
|
13
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
14
|
+
import { useI18n as ce } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
15
|
+
import { IllustratedEmptyState as le, PagePurpose as v } from "@burdenoff/fe-libs/ui";
|
|
13
16
|
// src/billing/modules/billing/pages/UserRefundsPage.tsx
|
|
14
|
-
var
|
|
15
|
-
[
|
|
17
|
+
var y = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, b = {
|
|
18
|
+
[s.Pending]: {
|
|
16
19
|
label: "In Review",
|
|
17
20
|
className: "bg-status-warning-bg/20 text-status-warning-text border-status-warning-border",
|
|
18
|
-
icon: ({ className: e }) => /* @__PURE__ */
|
|
21
|
+
icon: ({ className: e }) => /* @__PURE__ */ g(f, { className: e })
|
|
19
22
|
},
|
|
20
|
-
[
|
|
23
|
+
[s.Processing]: {
|
|
21
24
|
label: "Processing",
|
|
22
25
|
className: "bg-action-primary-bg/15 text-action-primary-bg border-action-primary-bg/30",
|
|
23
|
-
icon: ({ className: e }) => /* @__PURE__ */
|
|
26
|
+
icon: ({ className: e }) => /* @__PURE__ */ g(p, { className: `${e} animate-spin` })
|
|
24
27
|
},
|
|
25
|
-
[
|
|
28
|
+
[s.Completed]: {
|
|
26
29
|
label: "Refunded",
|
|
27
30
|
className: "bg-status-success-bg/20 text-status-success-text border-status-success-border",
|
|
28
|
-
icon: ({ className: e }) => /* @__PURE__ */
|
|
31
|
+
icon: ({ className: e }) => /* @__PURE__ */ g(d, { className: e })
|
|
29
32
|
},
|
|
30
|
-
[
|
|
33
|
+
[s.Failed]: {
|
|
31
34
|
label: "Failed",
|
|
32
35
|
className: "bg-status-error-bg/20 text-status-error-text border-status-error-border",
|
|
33
|
-
icon: ({ className: e }) => /* @__PURE__ */
|
|
36
|
+
icon: ({ className: e }) => /* @__PURE__ */ g(h, { className: e })
|
|
34
37
|
},
|
|
35
|
-
[
|
|
38
|
+
[s.Skipped]: {
|
|
36
39
|
label: "Closed",
|
|
37
40
|
className: "bg-bg-sunken text-text-secondary border-border-subtle",
|
|
38
|
-
icon: ({ className: e }) => /* @__PURE__ */
|
|
41
|
+
icon: ({ className: e }) => /* @__PURE__ */ g(h, { className: e })
|
|
39
42
|
}
|
|
40
43
|
};
|
|
41
|
-
function
|
|
42
|
-
let t =
|
|
44
|
+
function x({ status: e }) {
|
|
45
|
+
let t = b[e] ?? {
|
|
43
46
|
label: e,
|
|
44
47
|
className: "bg-bg-sunken text-text-secondary border-border-subtle",
|
|
45
|
-
icon: ({ className: e }) => /* @__PURE__ */
|
|
48
|
+
icon: ({ className: e }) => /* @__PURE__ */ g(f, { className: e })
|
|
46
49
|
}, n = t.icon;
|
|
47
|
-
return /* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */ _("span", {
|
|
48
51
|
className: `inline-flex items-center gap-1 px-2 py-0.5 rounded-full border text-xs font-medium ${t.className}`,
|
|
49
|
-
children: [/* @__PURE__ */
|
|
52
|
+
children: [/* @__PURE__ */ g(n, { className: "size-3" }), t.label]
|
|
50
53
|
});
|
|
51
54
|
}
|
|
52
|
-
var
|
|
53
|
-
let { t: f } =
|
|
55
|
+
var S = () => {
|
|
56
|
+
let { t: f } = ce(), h = (e, t) => {
|
|
54
57
|
let n = f(e);
|
|
55
58
|
return n === e ? t : n;
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
!
|
|
59
|
-
}, [
|
|
60
|
-
let
|
|
61
|
-
|
|
59
|
+
}, b = t(), S = ee(), C = i(te(), S.canProcessRefund), [w, T] = u(!1), [E, D] = u(""), [O, k] = u(null), [ue, A] = u(!1), [j, M] = u(""), [N, P] = u(""), [F, I] = u(null), [L, R] = u(!1), { data: z, loading: B } = o({ fetchPolicy: "cache-and-network" }), V = ie(() => z?.getBillingAccountsByOrg ?? [], [z]), [H, U] = u(void 0);
|
|
60
|
+
c(() => {
|
|
61
|
+
!H && V.length > 0 && U(V[0].id);
|
|
62
|
+
}, [V, H]);
|
|
63
|
+
let W = V.find((e) => e.id === H), [de, { data: G, loading: K, error: q }] = re({ fetchPolicy: "network-only" }), fe = l("");
|
|
64
|
+
c(() => {
|
|
62
65
|
if (K) return;
|
|
63
66
|
let e = G?.getTransaction;
|
|
64
|
-
e ? (
|
|
67
|
+
e ? (k(e), A(!1), P(String(e.amount))) : (G !== void 0 || q) && (k(null), A(!0), P(""));
|
|
65
68
|
}, [
|
|
66
69
|
G,
|
|
67
70
|
K,
|
|
@@ -69,91 +72,91 @@ var C = () => {
|
|
|
69
72
|
]);
|
|
70
73
|
let J = (e, t) => {
|
|
71
74
|
let n = `${e}::${t}`;
|
|
72
|
-
|
|
75
|
+
fe.current = n, k(null), A(!1), P(""), de({ variables: {
|
|
73
76
|
id: e,
|
|
74
77
|
billingAccountId: t
|
|
75
78
|
} });
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
}, { data:
|
|
79
|
+
}, pe = (e) => {
|
|
80
|
+
D(e), k(null), A(!1), P(""), y.test(e.trim()) && H && J(e.trim(), H);
|
|
81
|
+
}, me = (e) => {
|
|
82
|
+
U(e), k(null), A(!1), P(""), y.test(E.trim()) && J(E.trim(), e);
|
|
83
|
+
}, { data: he, loading: ge, refetch: _e } = ne({
|
|
81
84
|
variables: {
|
|
82
|
-
billingAccountId:
|
|
85
|
+
billingAccountId: H,
|
|
83
86
|
pageSize: 20,
|
|
84
87
|
page: 1
|
|
85
88
|
},
|
|
86
|
-
skip: !
|
|
89
|
+
skip: !H,
|
|
87
90
|
fetchPolicy: "cache-and-network"
|
|
88
|
-
}), Y =
|
|
91
|
+
}), Y = he?.getRefundRecords.records ?? [], [ve, { loading: X }] = a({ refetchQueries: ["GetRefundRecords"] }), Z = (e) => e ? e.stripePaymentId ? {
|
|
89
92
|
provider: "STRIPE",
|
|
90
93
|
gatewayPaymentId: e.stripePaymentId
|
|
91
94
|
} : e.razorpayPaymentId ? {
|
|
92
95
|
provider: "RAZORPAY",
|
|
93
96
|
gatewayPaymentId: e.razorpayPaymentId
|
|
94
|
-
} : null : null,
|
|
95
|
-
if (e.preventDefault(), I(null), !
|
|
97
|
+
} : null : null, ye = async (e) => {
|
|
98
|
+
if (e.preventDefault(), I(null), !O || !j.trim() || !N) {
|
|
96
99
|
I("Enter a valid transaction ID, an amount, and a reason.");
|
|
97
100
|
return;
|
|
98
101
|
}
|
|
99
|
-
let t =
|
|
102
|
+
let t = Z(O);
|
|
100
103
|
if (!t) {
|
|
101
104
|
I("No payment gateway info found for this transaction. Please contact support.");
|
|
102
105
|
return;
|
|
103
106
|
}
|
|
104
107
|
let r = parseFloat(N);
|
|
105
108
|
if (isNaN(r) || r <= 0) I("Please enter a valid amount greater than 0.");
|
|
106
|
-
else if (r >
|
|
109
|
+
else if (r > O.amount) I(`Cannot exceed the original payment amount (${n(O.amount, O.currency)}).`);
|
|
107
110
|
else try {
|
|
108
|
-
await
|
|
109
|
-
billingAccountId:
|
|
111
|
+
await ve({ variables: {
|
|
112
|
+
billingAccountId: H,
|
|
110
113
|
provider: t.provider,
|
|
111
114
|
gatewayPaymentId: t.gatewayPaymentId,
|
|
112
115
|
amount: r,
|
|
113
|
-
currency:
|
|
114
|
-
transactionId:
|
|
116
|
+
currency: O.currency ?? W?.currency ?? "USD",
|
|
117
|
+
transactionId: O.id,
|
|
115
118
|
reason: j.trim(),
|
|
116
119
|
notes: "Requested by user via billing portal"
|
|
117
|
-
} }),
|
|
120
|
+
} }), R(!0), T(!1), Q(), await _e();
|
|
118
121
|
} catch (e) {
|
|
119
122
|
I(e instanceof Error ? e.message : "Failed to submit refund request.");
|
|
120
123
|
}
|
|
121
124
|
}, Q = () => {
|
|
122
|
-
|
|
125
|
+
D(""), k(null), A(!1), M(""), P(""), I(null);
|
|
123
126
|
}, $ = () => {
|
|
124
|
-
|
|
127
|
+
T(!1), R(!1), Q();
|
|
125
128
|
};
|
|
126
|
-
return /* @__PURE__ */
|
|
129
|
+
return /* @__PURE__ */ _("div", {
|
|
127
130
|
className: "space-y-6 p-6 max-w-3xl",
|
|
128
131
|
children: [
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
title:
|
|
131
|
-
description:
|
|
132
|
-
actions: C ?
|
|
132
|
+
/* @__PURE__ */ g(e, {
|
|
133
|
+
title: h("billing.refunds.title", "Refunds"),
|
|
134
|
+
description: h("billing.refunds.description", "View your refund requests and submit new ones"),
|
|
135
|
+
actions: !w && C ? /* @__PURE__ */ _("button", {
|
|
133
136
|
type: "button",
|
|
134
137
|
onClick: () => {
|
|
135
|
-
|
|
138
|
+
T(!0), R(!1);
|
|
136
139
|
},
|
|
137
140
|
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors",
|
|
138
|
-
children: [/* @__PURE__ */
|
|
139
|
-
})
|
|
141
|
+
children: [/* @__PURE__ */ g(oe, { className: "size-4" }), h("billing.refunds.requestRefund", "Request Refund")]
|
|
142
|
+
}) : void 0
|
|
140
143
|
}),
|
|
141
|
-
/* @__PURE__ */ v
|
|
142
|
-
!
|
|
144
|
+
/* @__PURE__ */ g(v, { children: h("billing.refunds.userPurpose", "Request money back for a payment and follow where each request stands. Paste the transaction ID of the charge you want refunded, tell us how much and why, and track every request here from \"In Review\" through to \"Refunded\".") }),
|
|
145
|
+
!B && V.length > 1 && /* @__PURE__ */ _("div", {
|
|
143
146
|
className: "flex items-center gap-3",
|
|
144
147
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ g(ae, { className: "size-4 text-text-secondary shrink-0" }),
|
|
149
|
+
/* @__PURE__ */ g("label", {
|
|
147
150
|
htmlFor: "accountSwitch",
|
|
148
151
|
className: "text-sm text-text-secondary shrink-0",
|
|
149
|
-
children:
|
|
152
|
+
children: h("billing.refunds.account", "Billing account")
|
|
150
153
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ g("select", {
|
|
152
155
|
id: "accountSwitch",
|
|
153
|
-
value:
|
|
154
|
-
onChange: (e) =>
|
|
156
|
+
value: H ?? "",
|
|
157
|
+
onChange: (e) => me(e.target.value),
|
|
155
158
|
className: "flex-1 px-3 py-1.5 border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-sm scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
156
|
-
children:
|
|
159
|
+
children: V.map((e) => /* @__PURE__ */ _("option", {
|
|
157
160
|
value: e.id,
|
|
158
161
|
children: [
|
|
159
162
|
e.name,
|
|
@@ -166,216 +169,216 @@ var C = () => {
|
|
|
166
169
|
})
|
|
167
170
|
]
|
|
168
171
|
}),
|
|
169
|
-
|
|
172
|
+
L && /* @__PURE__ */ _("div", {
|
|
170
173
|
className: "flex items-center justify-between p-4 rounded-lg border border-status-success-border bg-status-success-bg/10",
|
|
171
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ _("div", {
|
|
172
175
|
className: "flex items-center gap-2",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
176
|
+
children: [/* @__PURE__ */ g(d, { className: "size-4 text-status-success-text" }), /* @__PURE__ */ g("p", {
|
|
174
177
|
className: "text-sm text-status-success-text font-medium",
|
|
175
|
-
children:
|
|
178
|
+
children: h("billing.refunds.submitted", "Refund request submitted. Our team will review it shortly.")
|
|
176
179
|
})]
|
|
177
|
-
}), /* @__PURE__ */
|
|
180
|
+
}), /* @__PURE__ */ g("button", {
|
|
178
181
|
type: "button",
|
|
179
|
-
onClick: () =>
|
|
182
|
+
onClick: () => R(!1),
|
|
180
183
|
className: "text-status-success-text hover:opacity-70",
|
|
181
|
-
children: /* @__PURE__ */
|
|
184
|
+
children: /* @__PURE__ */ g(m, { className: "size-4" })
|
|
182
185
|
})]
|
|
183
186
|
}),
|
|
184
|
-
|
|
187
|
+
w && /* @__PURE__ */ _("div", {
|
|
185
188
|
className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden",
|
|
186
|
-
children: [/* @__PURE__ */
|
|
189
|
+
children: [/* @__PURE__ */ _("div", {
|
|
187
190
|
className: "flex items-center justify-between p-4 border-b border-border-subtle bg-bg-sunken",
|
|
188
|
-
children: [/* @__PURE__ */
|
|
191
|
+
children: [/* @__PURE__ */ g("h2", {
|
|
189
192
|
className: "font-semibold text-text-primary",
|
|
190
|
-
children:
|
|
191
|
-
}), /* @__PURE__ */
|
|
193
|
+
children: h("billing.refunds.newRequest", "New Refund Request")
|
|
194
|
+
}), /* @__PURE__ */ g("button", {
|
|
192
195
|
type: "button",
|
|
193
196
|
onClick: $,
|
|
194
197
|
className: "p-1 rounded hover:bg-bg-sunken transition-colors",
|
|
195
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ g(m, { className: "size-4 text-text-secondary" })
|
|
196
199
|
})]
|
|
197
|
-
}), /* @__PURE__ */
|
|
198
|
-
onSubmit:
|
|
200
|
+
}), /* @__PURE__ */ _("form", {
|
|
201
|
+
onSubmit: ye,
|
|
199
202
|
className: "p-4 space-y-4",
|
|
200
203
|
children: [
|
|
201
|
-
F && /* @__PURE__ */
|
|
204
|
+
F && /* @__PURE__ */ g("div", {
|
|
202
205
|
className: "p-3 rounded-lg border border-status-error-border bg-status-error-bg/10",
|
|
203
|
-
children: /* @__PURE__ */
|
|
206
|
+
children: /* @__PURE__ */ g("p", {
|
|
204
207
|
className: "text-sm text-status-error-text",
|
|
205
208
|
children: F
|
|
206
209
|
})
|
|
207
210
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ _("div", { children: [
|
|
212
|
+
/* @__PURE__ */ _("label", {
|
|
210
213
|
htmlFor: "txnId",
|
|
211
214
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
212
|
-
children: [
|
|
215
|
+
children: [h("billing.refunds.transactionId", "Transaction ID"), " *"]
|
|
213
216
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ _("div", {
|
|
215
218
|
className: "relative",
|
|
216
|
-
children: [/* @__PURE__ */
|
|
219
|
+
children: [/* @__PURE__ */ g("input", {
|
|
217
220
|
id: "txnId",
|
|
218
221
|
type: "text",
|
|
219
|
-
value:
|
|
220
|
-
onChange: (e) =>
|
|
222
|
+
value: E,
|
|
223
|
+
onChange: (e) => pe(e.target.value),
|
|
221
224
|
placeholder: "Paste your transaction ID...",
|
|
222
225
|
className: "w-full pl-3 pr-9 py-2 border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-sm font-mono"
|
|
223
|
-
}), /* @__PURE__ */
|
|
226
|
+
}), /* @__PURE__ */ g("div", {
|
|
224
227
|
className: "absolute right-2.5 top-1/2 -translate-y-1/2 text-text-secondary",
|
|
225
|
-
children: K ? /* @__PURE__ */
|
|
228
|
+
children: K ? /* @__PURE__ */ g(p, { className: "size-4 animate-spin" }) : /* @__PURE__ */ g(se, { className: "size-4" })
|
|
226
229
|
})]
|
|
227
230
|
}),
|
|
228
|
-
|
|
231
|
+
O && /* @__PURE__ */ _("div", {
|
|
229
232
|
className: "mt-2 p-3 rounded-button border border-status-success-border bg-status-success-bg/10 text-sm space-y-0.5",
|
|
230
|
-
children: [/* @__PURE__ */
|
|
233
|
+
children: [/* @__PURE__ */ _("div", {
|
|
231
234
|
className: "flex items-center gap-2",
|
|
232
235
|
children: [
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ g(d, { className: "size-3.5 text-status-success-text shrink-0" }),
|
|
237
|
+
/* @__PURE__ */ g("span", {
|
|
235
238
|
className: "font-medium text-text-primary",
|
|
236
|
-
children: n(
|
|
239
|
+
children: n(O.amount, O.currency)
|
|
237
240
|
}),
|
|
238
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ g("span", {
|
|
239
242
|
className: "text-text-secondary",
|
|
240
243
|
children: "·"
|
|
241
244
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ g("span", {
|
|
243
246
|
className: "text-text-secondary",
|
|
244
|
-
children: r(
|
|
247
|
+
children: r(O.createdAt)
|
|
245
248
|
}),
|
|
246
|
-
|
|
249
|
+
O.stripePaymentId && /* @__PURE__ */ g("span", {
|
|
247
250
|
className: "text-xs text-text-secondary",
|
|
248
251
|
children: "Stripe"
|
|
249
252
|
}),
|
|
250
|
-
|
|
253
|
+
O.razorpayPaymentId && /* @__PURE__ */ g("span", {
|
|
251
254
|
className: "text-xs text-text-secondary",
|
|
252
255
|
children: "Razorpay"
|
|
253
256
|
})
|
|
254
257
|
]
|
|
255
|
-
}),
|
|
258
|
+
}), O.description && /* @__PURE__ */ g("p", {
|
|
256
259
|
className: "text-xs text-text-secondary pl-5",
|
|
257
|
-
children:
|
|
260
|
+
children: O.description
|
|
258
261
|
})]
|
|
259
262
|
}),
|
|
260
|
-
|
|
263
|
+
ue && E.length > 0 && !K && /* @__PURE__ */ g("p", {
|
|
261
264
|
className: "mt-1 text-xs text-status-error-text",
|
|
262
|
-
children:
|
|
265
|
+
children: h("billing.refunds.txnNotFound", "Transaction not found in this billing account.")
|
|
263
266
|
}),
|
|
264
|
-
!
|
|
267
|
+
!y.test(E.trim()) && E.length > 4 && /* @__PURE__ */ g("p", {
|
|
265
268
|
className: "mt-1 text-xs text-text-secondary",
|
|
266
|
-
children:
|
|
269
|
+
children: h("billing.refunds.txnIdHint", "Transaction IDs look like: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
|
|
267
270
|
})
|
|
268
271
|
] }),
|
|
269
|
-
|
|
272
|
+
O && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
270
273
|
htmlFor: "refundAmount",
|
|
271
274
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
272
|
-
children: [
|
|
273
|
-
}), /* @__PURE__ */
|
|
275
|
+
children: [h("billing.refunds.amount", "Refund Amount"), " *"]
|
|
276
|
+
}), /* @__PURE__ */ _("div", {
|
|
274
277
|
className: "flex items-center gap-2",
|
|
275
278
|
children: [
|
|
276
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ g("input", {
|
|
277
280
|
id: "refundAmount",
|
|
278
281
|
type: "number",
|
|
279
282
|
step: "0.01",
|
|
280
283
|
min: "0.01",
|
|
281
|
-
max:
|
|
284
|
+
max: O.amount,
|
|
282
285
|
value: N,
|
|
283
286
|
onChange: (e) => P(e.target.value),
|
|
284
287
|
required: !0,
|
|
285
288
|
className: "w-40 px-3 py-2 border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-sm",
|
|
286
289
|
placeholder: "0.00"
|
|
287
290
|
}),
|
|
288
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ g("span", {
|
|
289
292
|
className: "text-sm text-text-secondary",
|
|
290
|
-
children:
|
|
293
|
+
children: O.currency ?? W?.currency ?? "USD"
|
|
291
294
|
}),
|
|
292
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ _("span", {
|
|
293
296
|
className: "text-xs text-text-secondary",
|
|
294
|
-
children: ["max ", n(
|
|
297
|
+
children: ["max ", n(O.amount, O.currency)]
|
|
295
298
|
})
|
|
296
299
|
]
|
|
297
300
|
})] }),
|
|
298
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
299
302
|
htmlFor: "reason",
|
|
300
303
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
301
|
-
children: [
|
|
302
|
-
}), /* @__PURE__ */
|
|
304
|
+
children: [h("billing.refunds.reason", "Reason for refund"), " *"]
|
|
305
|
+
}), /* @__PURE__ */ g("textarea", {
|
|
303
306
|
id: "reason",
|
|
304
307
|
value: j,
|
|
305
308
|
onChange: (e) => M(e.target.value),
|
|
306
309
|
required: !0,
|
|
307
310
|
rows: 3,
|
|
308
311
|
className: "w-full px-3 py-2 border border-border-subtle rounded-button bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-sm resize-none",
|
|
309
|
-
placeholder:
|
|
312
|
+
placeholder: h("billing.refunds.reasonPlaceholder", "Describe why you are requesting a refund...")
|
|
310
313
|
})] }),
|
|
311
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ _("div", {
|
|
312
315
|
className: "flex items-center gap-3 pt-1",
|
|
313
|
-
children: [/* @__PURE__ */
|
|
316
|
+
children: [/* @__PURE__ */ g("button", {
|
|
314
317
|
type: "submit",
|
|
315
|
-
disabled:
|
|
318
|
+
disabled: X || !O || !j.trim() || !N,
|
|
316
319
|
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
317
|
-
children:
|
|
318
|
-
}), /* @__PURE__ */
|
|
320
|
+
children: X ? h("billing.refunds.submitting", "Submitting...") : h("billing.refunds.submitRequest", "Submit Request")
|
|
321
|
+
}), /* @__PURE__ */ g("button", {
|
|
319
322
|
type: "button",
|
|
320
323
|
onClick: $,
|
|
321
324
|
className: "px-4 py-2 text-sm border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
|
|
322
|
-
children:
|
|
325
|
+
children: h("billing.common.cancel", "Cancel")
|
|
323
326
|
})]
|
|
324
327
|
})
|
|
325
328
|
]
|
|
326
329
|
})]
|
|
327
330
|
}),
|
|
328
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ _("div", {
|
|
329
332
|
className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden",
|
|
330
|
-
children: [/* @__PURE__ */
|
|
333
|
+
children: [/* @__PURE__ */ g("div", {
|
|
331
334
|
className: "p-4 border-b border-border-subtle bg-bg-sunken",
|
|
332
|
-
children: /* @__PURE__ */
|
|
335
|
+
children: /* @__PURE__ */ g("h2", {
|
|
333
336
|
className: "font-semibold text-text-primary",
|
|
334
|
-
children:
|
|
337
|
+
children: h("billing.refunds.history", "Refund History")
|
|
335
338
|
})
|
|
336
|
-
}),
|
|
339
|
+
}), B || ge ? /* @__PURE__ */ g("div", {
|
|
337
340
|
className: "p-8 flex items-center justify-center",
|
|
338
|
-
children: /* @__PURE__ */
|
|
339
|
-
}) : Y.length === 0 ? /* @__PURE__ */
|
|
341
|
+
children: /* @__PURE__ */ g(p, { className: "size-5 animate-spin text-text-secondary" })
|
|
342
|
+
}) : Y.length === 0 ? /* @__PURE__ */ g(le, {
|
|
340
343
|
illustration: "empty-data",
|
|
341
|
-
title:
|
|
342
|
-
description:
|
|
343
|
-
}) : /* @__PURE__ */
|
|
344
|
+
title: h("billing.refunds.noRefunds", "No refund requests yet"),
|
|
345
|
+
description: h("billing.refunds.noRefundsHint", "If you have an issue with a payment, click \"Request Refund\" to get started.")
|
|
346
|
+
}) : /* @__PURE__ */ g("ul", {
|
|
344
347
|
className: "divide-y divide-border-subtle",
|
|
345
|
-
children: Y.map((e) => /* @__PURE__ */
|
|
348
|
+
children: Y.map((e) => /* @__PURE__ */ _("li", {
|
|
346
349
|
className: "flex items-start gap-4 p-4 hover:bg-bg-sunken transition-colors",
|
|
347
|
-
children: [/* @__PURE__ */
|
|
350
|
+
children: [/* @__PURE__ */ _("div", {
|
|
348
351
|
className: "flex-1 min-w-0",
|
|
349
352
|
children: [
|
|
350
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ _("div", {
|
|
351
354
|
className: "flex items-center gap-2 flex-wrap",
|
|
352
355
|
children: [
|
|
353
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ g("span", {
|
|
354
357
|
className: "text-sm font-medium text-text-primary",
|
|
355
358
|
children: n(e.amount, e.currency)
|
|
356
359
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
e.purchaseDetail && /* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ g(x, { status: e.status }),
|
|
361
|
+
e.purchaseDetail && /* @__PURE__ */ g("span", {
|
|
359
362
|
className: "text-xs text-text-secondary truncate",
|
|
360
363
|
children: e.purchaseDetail
|
|
361
364
|
})
|
|
362
365
|
]
|
|
363
366
|
}),
|
|
364
|
-
e.reason && /* @__PURE__ */
|
|
367
|
+
e.reason && /* @__PURE__ */ g("p", {
|
|
365
368
|
className: "text-xs text-text-secondary mt-1 line-clamp-2",
|
|
366
369
|
children: e.reason
|
|
367
370
|
}),
|
|
368
|
-
e.errorMessage && e.status ===
|
|
371
|
+
e.errorMessage && e.status === s.Failed && /* @__PURE__ */ g("p", {
|
|
369
372
|
className: "text-xs text-status-error-text mt-1",
|
|
370
373
|
children: e.errorMessage
|
|
371
374
|
})
|
|
372
375
|
]
|
|
373
|
-
}), /* @__PURE__ */
|
|
376
|
+
}), /* @__PURE__ */ _("div", {
|
|
374
377
|
className: "text-right shrink-0",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
378
|
+
children: [/* @__PURE__ */ g("p", {
|
|
376
379
|
className: "text-xs text-text-secondary",
|
|
377
380
|
children: r(e.createdAt)
|
|
378
|
-
}), e.processedAt && /* @__PURE__ */
|
|
381
|
+
}), e.processedAt && /* @__PURE__ */ _("p", {
|
|
379
382
|
className: "text-xs text-text-secondary mt-0.5",
|
|
380
383
|
children: ["Processed ", r(e.processedAt)]
|
|
381
384
|
})]
|
|
@@ -383,22 +386,22 @@ var C = () => {
|
|
|
383
386
|
}, e.id))
|
|
384
387
|
})]
|
|
385
388
|
}),
|
|
386
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ _("p", {
|
|
387
390
|
className: "text-xs text-text-secondary",
|
|
388
391
|
children: [
|
|
389
|
-
|
|
392
|
+
h("billing.refunds.footer", "Refund requests are reviewed by our team within 3–5 business days. For urgent issues, contact support."),
|
|
390
393
|
" ",
|
|
391
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ g("button", {
|
|
392
395
|
type: "button",
|
|
393
|
-
onClick: () =>
|
|
396
|
+
onClick: () => b("/transactions/" + H),
|
|
394
397
|
className: "underline hover:no-underline",
|
|
395
|
-
children:
|
|
398
|
+
children: h("billing.refunds.viewTransactions", "View all transactions")
|
|
396
399
|
})
|
|
397
400
|
]
|
|
398
401
|
})
|
|
399
402
|
]
|
|
400
403
|
});
|
|
401
404
|
};
|
|
402
|
-
export {
|
|
405
|
+
export { S as UserRefundsPage };
|
|
403
406
|
|
|
404
407
|
//# sourceMappingURL=UserRefundsPage.js.map
|