@burdenoff/microfe-billing 2026.912.6 → 2026.914.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/BillingAdminRoutes.js +100 -74
- package/dist/billing/BillingAdminRoutes.js.map +1 -1
- package/dist/billing/modules/billing/hooks/useRefunds.js.map +1 -1
- package/dist/billing/modules/billing/index.js +5 -4
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +90 -87
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +240 -0
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js.map +1 -0
- package/dist/billing/modules/billing/pages/RefundsPage.js +116 -108
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/index.js +1 -0
- package/dist/billing/modules/checkout/components/OrderSummary.js +22 -19
- package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -1
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/useCheckout.js +174 -157
- package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +189 -182
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +293 -274
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +140 -250
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -1
- package/dist/billing/modules/earnings/api.js +79 -42
- package/dist/billing/modules/earnings/api.js.map +1 -1
- package/dist/billing/modules/earnings/index.js +4 -3
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +103 -310
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +545 -0
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -0
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +246 -196
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +44 -28
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +317 -270
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +153 -150
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +1 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
- package/dist/billing/modules/usage/hooks/useUsage.js +74 -48
- package/dist/billing/modules/usage/hooks/useUsage.js.map +1 -1
- package/dist/generated/global-operations.js +221 -183
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.js.map +1 -1
- package/dist/node_modules/sonner/dist/index.js +163 -0
- package/dist/node_modules/sonner/dist/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -4,398 +4,288 @@ import "../../../shared/utils/index.js";
|
|
|
4
4
|
import { useDashboardMutations as n, usePaymentProviderConfig as r } from "../hooks/useDashboard.js";
|
|
5
5
|
import "../hooks/index.js";
|
|
6
6
|
import { useCallback as i, useEffect as a, useRef as o, useState as s } from "react";
|
|
7
|
-
import { AlertCircle as c, CheckCircle2 as l, CreditCard as u, Loader2 as d, X as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { useI18n as
|
|
7
|
+
import { AlertCircle as c, CheckCircle2 as l, CreditCard as u, Loader2 as d, X as f } from "lucide-react";
|
|
8
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
9
|
+
import { useI18n as g } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
10
10
|
//#region src/billing/modules/dashboard/components/AddPaymentMethodModal.tsx
|
|
11
|
-
var
|
|
11
|
+
var _ = (e, t) => new Promise((n, r) => {
|
|
12
12
|
if (document.getElementById(t)) {
|
|
13
13
|
n();
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
let i = document.createElement("script");
|
|
17
17
|
i.id = t, i.src = e, i.async = !0, i.onload = () => n(), i.onerror = () => r(/* @__PURE__ */ Error(`Failed to load ${e}`)), document.head.appendChild(i);
|
|
18
|
-
}),
|
|
19
|
-
let { t: S } =
|
|
18
|
+
}), v = ({ isOpen: v, onClose: y, billingAccountId: b, onSuccess: x }) => {
|
|
19
|
+
let { t: S } = g(), C = (e, t) => {
|
|
20
20
|
let n = S(e);
|
|
21
21
|
return n === e ? t : n;
|
|
22
|
-
},
|
|
23
|
-
|
|
22
|
+
}, w = o(null), T = o(null), E = o(null), D = o(null), { stripeEnabled: O, stripePublishableKey: k, isLoading: A } = r(!v), { isAddingPaymentMethod: j, verifyPaymentMethod: M } = n(), N = O, [P, F] = s("select-provider"), [I, L] = s(null), [R, z] = s(null), [B, V] = s(!1), [H, U] = s(!1), [W, G] = s(""), [K, q] = s(!0), [J, Y] = s(!1), X = i((e) => {
|
|
23
|
+
L(e), F("add-card"), z(null);
|
|
24
24
|
}, []);
|
|
25
25
|
a(() => {
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
-
|
|
26
|
+
v ? (F("select-provider"), L(null), z(null), G(""), q(!0), Y(!1)) : E.current &&= (E.current.destroy(), null);
|
|
27
|
+
}, [v]), a(() => {
|
|
28
|
+
P !== "select-provider" || A || N && X("stripe");
|
|
29
29
|
}, [
|
|
30
|
-
I,
|
|
31
|
-
A,
|
|
32
|
-
F,
|
|
33
30
|
P,
|
|
34
|
-
|
|
31
|
+
A,
|
|
32
|
+
N,
|
|
33
|
+
X
|
|
35
34
|
]), a(() => {
|
|
36
|
-
if (!(
|
|
37
|
-
if (!
|
|
38
|
-
|
|
35
|
+
if (!(P !== "add-card" || I !== "stripe")) {
|
|
36
|
+
if (!k && !A) {
|
|
37
|
+
z("Stripe is not configured. Please contact support.");
|
|
39
38
|
return;
|
|
40
39
|
}
|
|
41
|
-
return
|
|
42
|
-
|
|
40
|
+
return k ? ((async () => {
|
|
41
|
+
U(!0);
|
|
43
42
|
try {
|
|
44
|
-
if (await
|
|
45
|
-
let e = window.Stripe(
|
|
46
|
-
|
|
43
|
+
if (await _("https://js.stripe.com/v3/", "stripe-js"), !window.Stripe) throw Error("Stripe SDK failed to load");
|
|
44
|
+
let e = window.Stripe(k);
|
|
45
|
+
D.current = e;
|
|
47
46
|
let n = 0;
|
|
48
|
-
for (; !
|
|
49
|
-
if (!
|
|
50
|
-
if (
|
|
47
|
+
for (; !T.current && n < 50;) await new Promise((e) => setTimeout(e, 100)), n++;
|
|
48
|
+
if (!T.current) throw Error("Card element container not found after 5 seconds");
|
|
49
|
+
if (E.current) return;
|
|
51
50
|
let r = e.elements().create("card", { style: t("system-ui, -apple-system, sans-serif") });
|
|
52
|
-
r.mount(
|
|
53
|
-
|
|
51
|
+
r.mount(T.current), E.current = r, r.on("change", (e) => {
|
|
52
|
+
Y(e.complete), e.error ? z(e.error.message) : z(null);
|
|
54
53
|
});
|
|
55
54
|
} catch (e) {
|
|
56
|
-
|
|
55
|
+
z(e instanceof Error ? e.message : "Failed to load Stripe");
|
|
57
56
|
} finally {
|
|
58
|
-
|
|
57
|
+
U(!1);
|
|
59
58
|
}
|
|
60
59
|
})(), () => {
|
|
61
|
-
if (
|
|
62
|
-
|
|
60
|
+
if (E.current) try {
|
|
61
|
+
E.current.destroy(), E.current = null;
|
|
63
62
|
} catch {}
|
|
64
63
|
}) : void 0;
|
|
65
64
|
}
|
|
66
65
|
}, [
|
|
66
|
+
P,
|
|
67
67
|
I,
|
|
68
|
-
|
|
69
|
-
O,
|
|
68
|
+
k,
|
|
70
69
|
A
|
|
71
70
|
]), a(() => {
|
|
72
71
|
let e = (e) => {
|
|
73
|
-
e.key === "Escape" &&
|
|
72
|
+
e.key === "Escape" && v && !B && y();
|
|
74
73
|
};
|
|
75
74
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
76
75
|
}, [
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
v,
|
|
77
|
+
B,
|
|
78
|
+
y
|
|
80
79
|
]);
|
|
81
|
-
let
|
|
82
|
-
if (!
|
|
83
|
-
|
|
80
|
+
let Z = i(async () => {
|
|
81
|
+
if (!D.current || !E.current) {
|
|
82
|
+
z("Stripe not initialized");
|
|
84
83
|
return;
|
|
85
84
|
}
|
|
86
|
-
if (!
|
|
87
|
-
|
|
85
|
+
if (!W.trim()) {
|
|
86
|
+
z("Please enter the cardholder name");
|
|
88
87
|
return;
|
|
89
88
|
}
|
|
90
|
-
|
|
89
|
+
V(!0), z(null);
|
|
91
90
|
try {
|
|
92
91
|
let t = await M({
|
|
93
|
-
billingAccountId:
|
|
92
|
+
billingAccountId: b,
|
|
94
93
|
currency: "USD",
|
|
95
94
|
provider: e.STRIPE,
|
|
96
|
-
setAsDefault:
|
|
95
|
+
setAsDefault: K
|
|
97
96
|
});
|
|
98
97
|
if (!t.clientSecret) throw Error("Failed to initiate card verification");
|
|
99
|
-
let { setupIntent: n, error: r } = await
|
|
100
|
-
card:
|
|
101
|
-
billing_details: { name:
|
|
98
|
+
let { setupIntent: n, error: r } = await D.current.confirmCardSetup(t.clientSecret, { payment_method: {
|
|
99
|
+
card: E.current,
|
|
100
|
+
billing_details: { name: W }
|
|
102
101
|
} });
|
|
103
102
|
if (r) throw Error(r.message);
|
|
104
103
|
if (n?.status !== "succeeded") throw Error("Card verification failed");
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
F("success"), await new Promise((e) => setTimeout(e, 2e3)), x?.(), setTimeout(() => {
|
|
105
|
+
y();
|
|
107
106
|
}, 500);
|
|
108
107
|
} catch (e) {
|
|
109
|
-
|
|
108
|
+
z(e instanceof Error ? e.message : "Failed to add payment method"), V(!1);
|
|
110
109
|
}
|
|
111
110
|
}, [
|
|
111
|
+
W,
|
|
112
112
|
K,
|
|
113
|
-
|
|
114
|
-
v,
|
|
113
|
+
b,
|
|
115
114
|
M,
|
|
116
115
|
x,
|
|
117
|
-
|
|
118
|
-
]),
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
try {
|
|
123
|
-
await h("https://checkout.razorpay.com/v1/checkout.js", "razorpay-sdk");
|
|
124
|
-
} catch {
|
|
125
|
-
V("Failed to load Razorpay SDK"), U(!1), G(!1);
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
G(!1);
|
|
129
|
-
let t = await M({
|
|
130
|
-
billingAccountId: v,
|
|
131
|
-
currency: "INR",
|
|
132
|
-
provider: e.RAZORPAY,
|
|
133
|
-
setAsDefault: J
|
|
134
|
-
});
|
|
135
|
-
if (!t.success || !t.orderId || !t.razorpayKeyId) {
|
|
136
|
-
V(t.error || "Failed to initiate verification"), U(!1);
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
if (!window.Razorpay) {
|
|
140
|
-
V("Razorpay SDK not loaded"), U(!1);
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
let n = {
|
|
144
|
-
key: t.razorpayKeyId,
|
|
145
|
-
amount: (t.amount ?? 0) * 100,
|
|
146
|
-
currency: t.currency.toUpperCase(),
|
|
147
|
-
order_id: t.orderId,
|
|
148
|
-
customer_id: t.razorpayCustomerId,
|
|
149
|
-
name: "Add Payment Method",
|
|
150
|
-
description: `₹${t.amount} verification charge (refundable)`,
|
|
151
|
-
prefill: {
|
|
152
|
-
name: t.prefillName,
|
|
153
|
-
email: t.prefillEmail,
|
|
154
|
-
contact: t.prefillContact
|
|
155
|
-
},
|
|
156
|
-
notes: {
|
|
157
|
-
purchaseType: "PAYMENT_METHOD_VERIFICATION",
|
|
158
|
-
default_method: J.toString()
|
|
159
|
-
},
|
|
160
|
-
handler: async () => {
|
|
161
|
-
L("success"), await new Promise((e) => setTimeout(e, 2e3)), x?.(), setTimeout(() => {
|
|
162
|
-
_();
|
|
163
|
-
}, 500);
|
|
164
|
-
},
|
|
165
|
-
modal: { ondismiss: () => {
|
|
166
|
-
U(!1), V("Payment cancelled");
|
|
167
|
-
} }
|
|
168
|
-
};
|
|
169
|
-
new window.Razorpay(n).open();
|
|
170
|
-
} catch (e) {
|
|
171
|
-
V(e instanceof Error ? e.message : "Failed to add payment method"), U(!1);
|
|
172
|
-
}
|
|
173
|
-
}, [
|
|
174
|
-
J,
|
|
175
|
-
v,
|
|
176
|
-
M,
|
|
177
|
-
x,
|
|
178
|
-
_
|
|
179
|
-
]), ie = i(() => {
|
|
180
|
-
R === "stripe" ? Q() : R === "razorpay" && $();
|
|
181
|
-
}, [
|
|
182
|
-
R,
|
|
183
|
-
Q,
|
|
184
|
-
$
|
|
185
|
-
]);
|
|
186
|
-
return g ? /* @__PURE__ */ m("div", {
|
|
116
|
+
y
|
|
117
|
+
]), Q = i(() => {
|
|
118
|
+
I === "stripe" && Z();
|
|
119
|
+
}, [I, Z]);
|
|
120
|
+
return v ? /* @__PURE__ */ h("div", {
|
|
187
121
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
188
122
|
role: "dialog",
|
|
189
123
|
"aria-modal": "true",
|
|
190
124
|
"aria-labelledby": "modal-title",
|
|
191
|
-
children: [/* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ m("div", {
|
|
192
126
|
className: "absolute inset-0 bg-bg-overlay backdrop-blur-sm",
|
|
193
|
-
onClick:
|
|
127
|
+
onClick: B ? void 0 : y,
|
|
194
128
|
"aria-hidden": "true"
|
|
195
|
-
}), /* @__PURE__ */
|
|
196
|
-
ref:
|
|
129
|
+
}), /* @__PURE__ */ h("div", {
|
|
130
|
+
ref: w,
|
|
197
131
|
className: "relative w-full max-w-md max-h-[90vh] mx-4 bg-bg-surface border border-border-seam rounded-card shadow-[var(--shadow-elevation-4)] flex flex-col",
|
|
198
132
|
children: [
|
|
199
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ h("header", {
|
|
200
134
|
className: "flex items-center justify-between p-4 border-b border-border-subtle flex-shrink-0",
|
|
201
|
-
children: [/* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ h("div", {
|
|
202
136
|
className: "flex items-center gap-3",
|
|
203
|
-
children: [/* @__PURE__ */
|
|
137
|
+
children: [/* @__PURE__ */ m("div", {
|
|
204
138
|
className: "size-10 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center",
|
|
205
|
-
children: /* @__PURE__ */
|
|
206
|
-
}), /* @__PURE__ */
|
|
139
|
+
children: /* @__PURE__ */ m(u, { className: "size-5 text-text-link" })
|
|
140
|
+
}), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h2", {
|
|
207
141
|
id: "modal-title",
|
|
208
142
|
className: "text-lg font-semibold text-text-primary",
|
|
209
|
-
children:
|
|
210
|
-
}), /* @__PURE__ */
|
|
143
|
+
children: P === "success" ? "Payment Method Added" : "Add Payment Method"
|
|
144
|
+
}), /* @__PURE__ */ h("p", {
|
|
211
145
|
className: "text-sm text-text-secondary",
|
|
212
146
|
children: [
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
147
|
+
P === "select-provider" && (N ? "Add card via Stripe" : "Standalone card save unavailable"),
|
|
148
|
+
P === "add-card" && "Add card via Stripe",
|
|
149
|
+
P === "processing" && "Processing...",
|
|
150
|
+
P === "success" && "Your payment method has been saved"
|
|
217
151
|
]
|
|
218
152
|
})] })]
|
|
219
|
-
}), /* @__PURE__ */
|
|
153
|
+
}), /* @__PURE__ */ m("button", {
|
|
220
154
|
type: "button",
|
|
221
|
-
onClick:
|
|
222
|
-
disabled:
|
|
155
|
+
onClick: y,
|
|
156
|
+
disabled: B,
|
|
223
157
|
className: "p-2 rounded-button hover:bg-bg-sunken text-text-secondary hover:text-text-primary transition-colors disabled:opacity-50",
|
|
224
158
|
"aria-label": "Close modal",
|
|
225
|
-
children: /* @__PURE__ */
|
|
159
|
+
children: /* @__PURE__ */ m(f, { className: "size-5" })
|
|
226
160
|
})]
|
|
227
161
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ m("div", {
|
|
229
163
|
className: "p-4 overflow-y-auto flex-1",
|
|
230
|
-
children: A ? /* @__PURE__ */
|
|
164
|
+
children: A ? /* @__PURE__ */ m("div", {
|
|
231
165
|
className: "flex items-center justify-center py-8",
|
|
232
|
-
children: /* @__PURE__ */
|
|
233
|
-
}) :
|
|
166
|
+
children: /* @__PURE__ */ m(d, { className: "size-6 animate-spin text-text-secondary" })
|
|
167
|
+
}) : P === "select-provider" ? /* @__PURE__ */ m("div", {
|
|
234
168
|
className: "space-y-3",
|
|
235
|
-
children:
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
244
|
-
className: "font-medium text-text-primary",
|
|
245
|
-
children: "Stripe"
|
|
246
|
-
}), /* @__PURE__ */ p("p", {
|
|
247
|
-
className: "text-sm text-text-secondary",
|
|
248
|
-
children: "Cards, Apple Pay, Google Pay"
|
|
249
|
-
})] })]
|
|
250
|
-
}),
|
|
251
|
-
P && /* @__PURE__ */ m("button", {
|
|
252
|
-
type: "button",
|
|
253
|
-
onClick: () => Z("razorpay"),
|
|
254
|
-
className: "w-full flex items-center gap-4 p-4 border border-border-subtle rounded-lg hover:border-border-strong hover:bg-[var(--color-accent-soft)] transition-colors text-left",
|
|
255
|
-
children: [/* @__PURE__ */ p("div", {
|
|
256
|
-
className: "size-12 rounded-lg bg-status-info-bg-subtle flex items-center justify-center",
|
|
257
|
-
children: /* @__PURE__ */ p(u, { className: "size-6 text-accent-blue" })
|
|
258
|
-
}), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
169
|
+
children: N ? /* @__PURE__ */ m("div", {
|
|
170
|
+
className: "flex items-center justify-center py-8",
|
|
171
|
+
children: /* @__PURE__ */ m(d, { className: "size-6 animate-spin text-text-secondary" })
|
|
172
|
+
}) : /* @__PURE__ */ h("div", {
|
|
173
|
+
className: "flex flex-col items-center py-8 text-center",
|
|
174
|
+
children: [
|
|
175
|
+
/* @__PURE__ */ m(c, { className: "size-12 text-status-warning-text mb-3" }),
|
|
176
|
+
/* @__PURE__ */ m("p", {
|
|
259
177
|
className: "font-medium text-text-primary",
|
|
260
|
-
children: "
|
|
261
|
-
}),
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
/* @__PURE__ */ p(c, { className: "size-12 text-status-warning-text mb-3" }),
|
|
270
|
-
/* @__PURE__ */ p("p", {
|
|
271
|
-
className: "font-medium text-text-primary",
|
|
272
|
-
children: C("billing.overview.noPaymentProviders", "No Payment Providers Available")
|
|
273
|
-
}),
|
|
274
|
-
/* @__PURE__ */ p("p", {
|
|
275
|
-
className: "text-sm text-text-secondary mt-1",
|
|
276
|
-
children: N ? "Razorpay is not configured for Indian accounts. Please contact support." : "Stripe is not configured for international accounts. Please contact support."
|
|
277
|
-
})
|
|
278
|
-
]
|
|
279
|
-
})
|
|
280
|
-
]
|
|
281
|
-
}) : I === "add-card" ? /* @__PURE__ */ m("div", {
|
|
178
|
+
children: C("billing.overview.noPaymentProviders", "No Payment Providers Available")
|
|
179
|
+
}),
|
|
180
|
+
/* @__PURE__ */ m("p", {
|
|
181
|
+
className: "text-sm text-text-secondary mt-1",
|
|
182
|
+
children: "Card saving isn't configured for this account yet. Please contact support."
|
|
183
|
+
})
|
|
184
|
+
]
|
|
185
|
+
})
|
|
186
|
+
}) : P === "add-card" ? /* @__PURE__ */ h("div", {
|
|
282
187
|
className: "space-y-4",
|
|
283
188
|
children: [
|
|
284
|
-
|
|
189
|
+
R && /* @__PURE__ */ h("div", {
|
|
285
190
|
className: "flex items-center gap-2 p-3 rounded-lg bg-status-error-bg-subtle border border-status-error-border text-status-error-text",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
191
|
+
children: [/* @__PURE__ */ m(c, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ m("p", {
|
|
287
192
|
className: "text-sm",
|
|
288
|
-
children:
|
|
193
|
+
children: R
|
|
289
194
|
})]
|
|
290
195
|
}),
|
|
291
|
-
|
|
196
|
+
I === "stripe" && /* @__PURE__ */ h("div", {
|
|
292
197
|
className: "space-y-1.5",
|
|
293
|
-
children: [/* @__PURE__ */
|
|
198
|
+
children: [/* @__PURE__ */ m("label", {
|
|
294
199
|
htmlFor: "cardholderName",
|
|
295
200
|
className: "block text-sm font-medium text-text-primary",
|
|
296
201
|
children: "Cardholder Name"
|
|
297
|
-
}), /* @__PURE__ */
|
|
202
|
+
}), /* @__PURE__ */ m("input", {
|
|
298
203
|
type: "text",
|
|
299
204
|
id: "cardholderName",
|
|
300
|
-
value:
|
|
301
|
-
onChange: (e) =>
|
|
205
|
+
value: W,
|
|
206
|
+
onChange: (e) => G(e.target.value),
|
|
302
207
|
className: "w-full px-3 py-2 border border-border-default rounded-input bg-bg-surface text-text-primary placeholder:text-text-placeholder focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-border-strong",
|
|
303
208
|
placeholder: "John Doe",
|
|
304
|
-
disabled:
|
|
209
|
+
disabled: B
|
|
305
210
|
})]
|
|
306
211
|
}),
|
|
307
|
-
|
|
212
|
+
I === "stripe" && /* @__PURE__ */ h("div", {
|
|
308
213
|
className: "space-y-1.5",
|
|
309
|
-
children: [/* @__PURE__ */
|
|
214
|
+
children: [/* @__PURE__ */ m("label", {
|
|
310
215
|
className: "block text-sm font-medium text-text-primary",
|
|
311
216
|
children: C("billing.overview.cardDetails", "Card Details")
|
|
312
|
-
}), /* @__PURE__ */
|
|
217
|
+
}), /* @__PURE__ */ h("div", {
|
|
313
218
|
className: "relative",
|
|
314
|
-
children: [/* @__PURE__ */
|
|
315
|
-
ref:
|
|
219
|
+
children: [/* @__PURE__ */ m("div", {
|
|
220
|
+
ref: T,
|
|
316
221
|
className: "p-3 border border-border-default rounded-lg bg-bg-surface min-h-[56px]"
|
|
317
|
-
}),
|
|
222
|
+
}), H && /* @__PURE__ */ h("div", {
|
|
318
223
|
className: "absolute inset-0 flex items-center justify-center bg-bg-overlay rounded-lg",
|
|
319
|
-
children: [/* @__PURE__ */
|
|
224
|
+
children: [/* @__PURE__ */ m(d, { className: "size-5 animate-spin text-text-secondary" }), /* @__PURE__ */ m("span", {
|
|
320
225
|
className: "ml-2 text-sm text-text-secondary",
|
|
321
226
|
children: "Loading Stripe…"
|
|
322
227
|
})]
|
|
323
228
|
})]
|
|
324
229
|
})]
|
|
325
230
|
}),
|
|
326
|
-
|
|
327
|
-
className: "p-3 border border-border-subtle rounded-lg bg-status-info-bg-subtle",
|
|
328
|
-
children: /* @__PURE__ */ m("p", {
|
|
329
|
-
className: "text-sm text-status-info-text",
|
|
330
|
-
children: [/* @__PURE__ */ p("strong", { children: "Verification Process:" }), " A ₹1 charge will be made to verify your payment method. This amount will be refunded immediately after verification."]
|
|
331
|
-
})
|
|
332
|
-
}),
|
|
333
|
-
/* @__PURE__ */ m("label", {
|
|
231
|
+
/* @__PURE__ */ h("label", {
|
|
334
232
|
className: "flex items-center gap-2 cursor-pointer",
|
|
335
|
-
children: [/* @__PURE__ */
|
|
233
|
+
children: [/* @__PURE__ */ m("input", {
|
|
336
234
|
type: "checkbox",
|
|
337
|
-
checked:
|
|
338
|
-
onChange: (e) =>
|
|
235
|
+
checked: K,
|
|
236
|
+
onChange: (e) => q(e.target.checked),
|
|
339
237
|
className: "size-4 rounded border-border-default text-text-link focus:ring-[var(--color-focus-ring)]",
|
|
340
|
-
disabled:
|
|
341
|
-
}), /* @__PURE__ */
|
|
238
|
+
disabled: B
|
|
239
|
+
}), /* @__PURE__ */ m("span", {
|
|
342
240
|
className: "text-sm text-text-primary",
|
|
343
241
|
children: C("billing.overview.setAsDefault", "Set as default payment method")
|
|
344
242
|
})]
|
|
345
243
|
}),
|
|
346
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ h("div", {
|
|
347
245
|
className: "flex items-center gap-2 pt-2 border-t border-border-subtle",
|
|
348
|
-
children: [/* @__PURE__ */
|
|
246
|
+
children: [/* @__PURE__ */ m("span", {
|
|
349
247
|
className: "text-xs text-text-secondary",
|
|
350
248
|
children: "Secured by"
|
|
351
|
-
}), /* @__PURE__ */
|
|
352
|
-
className:
|
|
353
|
-
children:
|
|
249
|
+
}), /* @__PURE__ */ m("span", {
|
|
250
|
+
className: "inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-accent-violet-subtle text-accent-violet",
|
|
251
|
+
children: "Stripe"
|
|
354
252
|
})]
|
|
355
253
|
})
|
|
356
254
|
]
|
|
357
|
-
}) : /* @__PURE__ */
|
|
255
|
+
}) : /* @__PURE__ */ h("div", {
|
|
358
256
|
className: "flex flex-col items-center py-8 text-center",
|
|
359
257
|
children: [
|
|
360
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ m("div", {
|
|
361
259
|
className: "size-16 rounded-full bg-status-success-bg-subtle flex items-center justify-center mb-4",
|
|
362
|
-
children: /* @__PURE__ */
|
|
260
|
+
children: /* @__PURE__ */ m(l, { className: "size-8 text-status-success-text" })
|
|
363
261
|
}),
|
|
364
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ m("p", {
|
|
365
263
|
className: "font-medium text-text-primary",
|
|
366
264
|
children: C("billing.overview.paymentMethodAdded", "Payment method added successfully!")
|
|
367
265
|
}),
|
|
368
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ m("p", {
|
|
369
267
|
className: "text-sm text-text-secondary mt-1",
|
|
370
268
|
children: "Your payment method has been securely saved."
|
|
371
269
|
})
|
|
372
270
|
]
|
|
373
271
|
})
|
|
374
272
|
}),
|
|
375
|
-
|
|
273
|
+
P !== "success" && /* @__PURE__ */ h("footer", {
|
|
376
274
|
className: "flex items-center justify-between gap-3 p-4 border-t border-border-subtle bg-bg-sunken rounded-b-lg flex-shrink-0",
|
|
377
|
-
children: [
|
|
378
|
-
type: "button",
|
|
379
|
-
onClick: () => {
|
|
380
|
-
L("select-provider"), z(null), V(null), T.current &&= (T.current.destroy(), null);
|
|
381
|
-
},
|
|
382
|
-
disabled: H,
|
|
383
|
-
className: "px-4 py-2 text-sm font-medium text-text-primary hover:text-text-link transition-colors disabled:opacity-50",
|
|
384
|
-
children: "Back"
|
|
385
|
-
}) : /* @__PURE__ */ p("div", {}), /* @__PURE__ */ m("div", {
|
|
275
|
+
children: [/* @__PURE__ */ m("div", {}), /* @__PURE__ */ h("div", {
|
|
386
276
|
className: "flex items-center gap-3",
|
|
387
|
-
children: [/* @__PURE__ */
|
|
277
|
+
children: [/* @__PURE__ */ m("button", {
|
|
388
278
|
type: "button",
|
|
389
|
-
onClick:
|
|
390
|
-
disabled:
|
|
279
|
+
onClick: y,
|
|
280
|
+
disabled: B,
|
|
391
281
|
className: "px-4 py-2 text-sm font-medium text-text-primary border border-border-subtle rounded-lg hover:bg-bg-sunken transition-colors disabled:opacity-50",
|
|
392
282
|
children: "Cancel"
|
|
393
|
-
}),
|
|
283
|
+
}), P === "add-card" && /* @__PURE__ */ m("button", {
|
|
394
284
|
type: "button",
|
|
395
|
-
onClick:
|
|
396
|
-
disabled:
|
|
285
|
+
onClick: Q,
|
|
286
|
+
disabled: B || j || H || !J,
|
|
397
287
|
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-action-primary-text bg-action-primary-bg rounded-lg hover:bg-action-primary-bgHover transition-colors disabled:opacity-50",
|
|
398
|
-
children:
|
|
288
|
+
children: B || j ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(d, { className: "size-4 animate-spin" }), "Saving..."] }) : H ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(d, { className: "size-4 animate-spin" }), "Loading…"] }) : "Add Card"
|
|
399
289
|
})]
|
|
400
290
|
})]
|
|
401
291
|
})
|
|
@@ -404,6 +294,6 @@ var h = (e, t) => new Promise((n, r) => {
|
|
|
404
294
|
}) : null;
|
|
405
295
|
};
|
|
406
296
|
//#endregion
|
|
407
|
-
export {
|
|
297
|
+
export { v as AddPaymentMethodModal };
|
|
408
298
|
|
|
409
299
|
//# sourceMappingURL=AddPaymentMethodModal.js.map
|