@burdenoff/microfe-devportal 2026.1107.2 → 2026.1108.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/devportal/DevportalRoutes.d.ts.map +1 -1
- package/dist/devportal/DevportalRoutes.js +27 -23
- package/dist/devportal/DevportalRoutes.js.map +1 -1
- package/dist/devportal/pages/ApplicationDetailPage.d.ts.map +1 -1
- package/dist/devportal/pages/ApplicationDetailPage.js +743 -726
- package/dist/devportal/pages/ApplicationDetailPage.js.map +1 -1
- package/dist/devportal/pages/PublisherPayoutsPage.d.ts +21 -0
- package/dist/devportal/pages/PublisherPayoutsPage.d.ts.map +1 -0
- package/dist/devportal/pages/PublisherPayoutsPage.js +657 -0
- package/dist/devportal/pages/PublisherPayoutsPage.js.map +1 -0
- package/dist/devportal/pages/PublisherProfilePage.d.ts.map +1 -1
- package/dist/devportal/pages/PublisherProfilePage.js +166 -153
- package/dist/devportal/pages/PublisherProfilePage.js.map +1 -1
- package/dist/devportal/utils/publisherPayouts.d.ts +137 -0
- package/dist/devportal/utils/publisherPayouts.d.ts.map +1 -0
- package/dist/devportal/utils/publisherPayouts.js +167 -0
- package/dist/devportal/utils/publisherPayouts.js.map +1 -0
- package/dist/devportal/utils/submitForReview.d.ts +40 -0
- package/dist/devportal/utils/submitForReview.d.ts.map +1 -0
- package/dist/devportal/utils/submitForReview.js +37 -0
- package/dist/devportal/utils/submitForReview.js.map +1 -0
- package/dist/generated/global-operations.d.ts +341 -0
- package/dist/generated/global-operations.d.ts.map +1 -1
- package/dist/generated/global-operations.js +409 -270
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +2292 -323
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/global-types.js +3 -1
- package/dist/generated/global-types.js.map +1 -1
- package/dist/translations/en.d.ts +91 -0
- package/dist/translations/en.d.ts.map +1 -1
- package/dist/translations/en.js +91 -0
- package/dist/translations/en.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
/** How often an in-progress verification is re-read while the page is open. */
|
|
4
|
+
export declare const PAYOUT_POLL_INTERVAL_MS = 15000;
|
|
5
|
+
/** Polls per page visit (about five minutes); the store keeps syncing after. */
|
|
6
|
+
export declare const PAYOUT_POLL_MAX_ROUNDS = 20;
|
|
7
|
+
/**
|
|
8
|
+
* Publisher Payouts page (BOFF-10953).
|
|
9
|
+
*
|
|
10
|
+
* Lists the publisher's payout methods with their verification state, adds
|
|
11
|
+
* new ones, and runs automatic processor onboarding: RazorpayX fund-account
|
|
12
|
+
* validation for India (the full account number is entered once and never
|
|
13
|
+
* stored) and Stripe Connect Express hosted onboarding everywhere else. Stripe
|
|
14
|
+
* sends the publisher back here with `?onboarding=return` (re-read the state)
|
|
15
|
+
* or `?onboarding=refresh` (the link expired; start again).
|
|
16
|
+
*
|
|
17
|
+
* Mounted at `/devportal/publisher/payouts`; global-store-svc's
|
|
18
|
+
* STORE_PAYOUT_ONBOARDING_URL points at this page.
|
|
19
|
+
*/
|
|
20
|
+
export declare const PublisherPayoutsPage: FC;
|
|
21
|
+
//# sourceMappingURL=PublisherPayoutsPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublisherPayoutsPage.d.ts","sourceRoot":"","sources":["../../../src/devportal/pages/PublisherPayoutsPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;AAiE3C,+EAA+E;AAC/E,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAC9C,gFAAgF;AAChF,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAqCzC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,oBAAoB,EAAE,EAmiClC,CAAC"}
|
|
@@ -0,0 +1,657 @@
|
|
|
1
|
+
import { useDevportal as e } from "../providers/DevportalProvider.js";
|
|
2
|
+
import { useTr as t } from "../utils/i18n.js";
|
|
3
|
+
import { cn as n } from "../utils/cn.js";
|
|
4
|
+
import { useAcceptMyPublisherDeveloperAgreementMutation as r, useAddMyPublisherPayoutMethodMutation as i, useGetMyPublisherPayoutsQuery as a, useRefreshMyPublisherPayoutOnboardingMutation as ee, useRemoveMyPublisherPayoutMethodMutation as te, useStartMyPublisherPayoutOnboardingMutation as ne } from "../../generated/global-operations.js";
|
|
5
|
+
import "../hooks/useGraphQL.js";
|
|
6
|
+
import { PageLayout as o, PageSection as s } from "../components/PageLayout.js";
|
|
7
|
+
import { CheckboxField as re, InputField as c, SelectField as ie } from "../components/FormField.js";
|
|
8
|
+
import { ConfirmDialog as ae } from "../components/ConfirmDialog.js";
|
|
9
|
+
import { PermissionGuard as oe } from "../components/PermissionGuard.js";
|
|
10
|
+
import "../components/index.js";
|
|
11
|
+
import { PayoutMethodType as l } from "../../generated/global-types.js";
|
|
12
|
+
import { accountLast4Of as se, canStartOnboarding as ce, methodTypesForCountry as u, methodsToPoll as le, needsBankDetails as ue, normalizeCountry as de, payoutErrorMessage as d, payoutMethodPhase as fe, readOnboardingRedirect as pe, redirectToOnboarding as me, safeOnboardingUrl as he, stripeMethodsInOnboarding as ge, supportsAutomaticOnboarding as _e, toAddPayoutMethodInput as ve, toOnboardingInput as ye, validateAddPayoutMethod as be, validateOnboarding as xe } from "../utils/publisherPayouts.js";
|
|
13
|
+
import { useCallback as Se, useEffect as f, useMemo as Ce, useRef as we, useState as p } from "react";
|
|
14
|
+
import { AlertCircle as Te, BadgeCheck as Ee, CheckCircle2 as De, ExternalLink as Oe, Info as m, Landmark as ke, Loader2 as h, Plus as Ae, RefreshCw as je, ShieldCheck as g, Trash2 as Me } from "lucide-react";
|
|
15
|
+
import { useSearchParams as Ne } from "react-router";
|
|
16
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
17
|
+
//#region src/devportal/pages/PublisherPayoutsPage.tsx
|
|
18
|
+
var Pe = 15e3, Fe = {
|
|
19
|
+
VERIFIED: "bg-status-success-bg-subtle text-status-success-text",
|
|
20
|
+
NOT_STARTED: "bg-bg-sunken text-text-primary",
|
|
21
|
+
IN_PROGRESS: "bg-status-info-bg-subtle text-status-info-text",
|
|
22
|
+
AWAITING_KYC: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
23
|
+
FAILED: "bg-status-error-bg-subtle text-status-error-text",
|
|
24
|
+
MANUAL_REVIEW: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
25
|
+
REJECTED: "bg-status-error-bg-subtle text-status-error-text",
|
|
26
|
+
SUSPENDED: "bg-status-error-bg-subtle text-status-error-text",
|
|
27
|
+
CLOSED: "bg-bg-sunken text-text-secondary"
|
|
28
|
+
}, b = {
|
|
29
|
+
type: "",
|
|
30
|
+
country: "",
|
|
31
|
+
accountHolderName: "",
|
|
32
|
+
accountNumberLast4: "",
|
|
33
|
+
bankCode: "",
|
|
34
|
+
bankName: "",
|
|
35
|
+
isDefault: !1
|
|
36
|
+
}, x = {
|
|
37
|
+
contactEmail: "",
|
|
38
|
+
contactPhone: "",
|
|
39
|
+
accountNumber: ""
|
|
40
|
+
}, S = "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:cursor-not-allowed disabled:opacity-50", C = "inline-flex items-center gap-2 rounded-md border border-border-default bg-bg-surface px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50", w = () => {
|
|
41
|
+
let w = t(), { currentUser: Ie, navigate: Le, basePath: Re } = e(), [T, E] = Ne(), ze = a({ fetchPolicy: "cache-and-network" }), { loading: Be, error: Ve, refetch: D } = ze, O = ze.data, [He, { loading: Ue }] = r(), [We, { loading: Ge }] = i(), [Ke, { loading: qe }] = te(), [Je, { loading: Ye }] = ne(), [k] = ee(), A = O?.myPublisherOnboarding, j = A?.publisher ?? null, M = A?.payoutRoute ?? null, N = Ce(() => O?.myPublisherPayoutMethods ?? [], [O?.myPublisherPayoutMethods]), Xe = A?.steps.find((e) => e.key === "DEVELOPER_AGREEMENT"), Ze = A?.steps.find((e) => e.key === "PAYOUT_METHOD"), P = Xe?.status === "COMPLETE", [F, I] = p(null), [Qe, L] = p(!1), [R, z] = p(b), [B, $e] = p({}), [et, V] = p(null), [H, U] = p(x), [W, tt] = p({}), [G, K] = p(null), [nt, rt] = p(null), it = j?.contactEmail || Ie?.email || "", at = j?.contactPhone || "", q = Se((e) => {
|
|
42
|
+
V(e), tt({}), U({
|
|
43
|
+
contactEmail: it,
|
|
44
|
+
contactPhone: at,
|
|
45
|
+
accountNumber: ""
|
|
46
|
+
});
|
|
47
|
+
}, [it, at]), J = pe(`?${T.toString()}`), Y = we(!1);
|
|
48
|
+
f(() => {
|
|
49
|
+
if (!J || Y.current || !O) return;
|
|
50
|
+
Y.current = !0;
|
|
51
|
+
let e = ge(N), t = () => {
|
|
52
|
+
let e = new URLSearchParams(T);
|
|
53
|
+
e.delete("onboarding"), E(e, { replace: !0 });
|
|
54
|
+
};
|
|
55
|
+
if (J === "refresh") {
|
|
56
|
+
let n = e[0];
|
|
57
|
+
n && q(n.id), I({
|
|
58
|
+
tone: "info",
|
|
59
|
+
text: w("devportal.payouts.linkExpired", "Your Stripe onboarding link expired. Confirm your contact email to get a fresh link.")
|
|
60
|
+
}), t();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
(async () => {
|
|
64
|
+
try {
|
|
65
|
+
await Promise.all(e.map((e) => k({ variables: { id: e.id } }))), await D(), I({
|
|
66
|
+
tone: "success",
|
|
67
|
+
text: w("devportal.payouts.returnedFromStripe", "Welcome back. We checked your Stripe account; its status is shown below.")
|
|
68
|
+
});
|
|
69
|
+
} catch (e) {
|
|
70
|
+
I({
|
|
71
|
+
tone: "error",
|
|
72
|
+
text: d(e, "refresh")
|
|
73
|
+
});
|
|
74
|
+
} finally {
|
|
75
|
+
t();
|
|
76
|
+
}
|
|
77
|
+
})();
|
|
78
|
+
}, [
|
|
79
|
+
J,
|
|
80
|
+
O,
|
|
81
|
+
N,
|
|
82
|
+
T,
|
|
83
|
+
E,
|
|
84
|
+
k,
|
|
85
|
+
D,
|
|
86
|
+
q,
|
|
87
|
+
w
|
|
88
|
+
]);
|
|
89
|
+
let X = le(N).map((e) => e.id).join(",");
|
|
90
|
+
f(() => {
|
|
91
|
+
if (!X) return;
|
|
92
|
+
let e = X.split(","), t = 0, n = setInterval(() => {
|
|
93
|
+
if (t += 1, t > 20) {
|
|
94
|
+
clearInterval(n);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
Promise.all(e.map((e) => k({ variables: { id: e } }))).then(() => D()).catch(() => {});
|
|
98
|
+
}, Pe);
|
|
99
|
+
return () => clearInterval(n);
|
|
100
|
+
}, [
|
|
101
|
+
X,
|
|
102
|
+
k,
|
|
103
|
+
D
|
|
104
|
+
]);
|
|
105
|
+
let ot = u(R.country || M?.country, M), st = () => {
|
|
106
|
+
L(!0), $e({});
|
|
107
|
+
let e = de(j?.country ?? M?.country), t = u(e, M);
|
|
108
|
+
z({
|
|
109
|
+
...b,
|
|
110
|
+
country: e,
|
|
111
|
+
type: t[0] ?? "",
|
|
112
|
+
accountHolderName: j?.name ?? ""
|
|
113
|
+
});
|
|
114
|
+
}, ct = async () => {
|
|
115
|
+
if (A) {
|
|
116
|
+
I(null);
|
|
117
|
+
try {
|
|
118
|
+
await He({ variables: { version: A.currentAgreementVersion } }), await D(), I({
|
|
119
|
+
tone: "success",
|
|
120
|
+
text: w("devportal.payouts.agreementAccepted", "Agreement accepted. You can now add a payout method.")
|
|
121
|
+
});
|
|
122
|
+
} catch (e) {
|
|
123
|
+
I({
|
|
124
|
+
tone: "error",
|
|
125
|
+
text: d(e, "agreement")
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}, lt = async (e) => {
|
|
130
|
+
e.preventDefault();
|
|
131
|
+
let t = be(R, M);
|
|
132
|
+
if ($e(t), !(Object.keys(t).length > 0)) {
|
|
133
|
+
I(null);
|
|
134
|
+
try {
|
|
135
|
+
let e = (await We({ variables: { input: ve(R) } })).data?.addMyPublisherPayoutMethod;
|
|
136
|
+
await D(), L(!1), z(b), e && _e(e.type) ? (q(e.id), I({
|
|
137
|
+
tone: "success",
|
|
138
|
+
text: w("devportal.payouts.addedVerifyNext", "Payout method added. Verify it automatically below so payouts can be sent to it.")
|
|
139
|
+
})) : I({
|
|
140
|
+
tone: "success",
|
|
141
|
+
text: w("devportal.payouts.addedManualReview", "Payout method added. The marketplace team verifies bank transfers, usually within two business days.")
|
|
142
|
+
});
|
|
143
|
+
} catch (e) {
|
|
144
|
+
I({
|
|
145
|
+
tone: "error",
|
|
146
|
+
text: d(e, "add")
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}, ut = async (e, t) => {
|
|
151
|
+
t.preventDefault();
|
|
152
|
+
let n = xe(e.type, H, se(e.maskedDetails));
|
|
153
|
+
if (tt(n), !(Object.keys(n).length > 0)) {
|
|
154
|
+
I(null);
|
|
155
|
+
try {
|
|
156
|
+
let t = await Je({ variables: {
|
|
157
|
+
id: e.id,
|
|
158
|
+
input: ye(e.type, H)
|
|
159
|
+
} });
|
|
160
|
+
U(x);
|
|
161
|
+
let n = t.data?.startMyPublisherPayoutOnboarding, r = he(n?.onboardingUrl);
|
|
162
|
+
if (e.type === "STRIPE_CONNECT" && r) {
|
|
163
|
+
I({
|
|
164
|
+
tone: "info",
|
|
165
|
+
text: w("devportal.payouts.redirectingToStripe", "Taking you to Stripe to finish setting up your account...")
|
|
166
|
+
}), me(r);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
V(null), await D(), I(n?.method.status === "VERIFIED" ? {
|
|
170
|
+
tone: "success",
|
|
171
|
+
text: w("devportal.payouts.verified", "Your payout method is verified. Payouts will be sent to it.")
|
|
172
|
+
} : {
|
|
173
|
+
tone: "info",
|
|
174
|
+
text: w("devportal.payouts.verificationStarted", "Verification started. This page updates on its own when the processor confirms your account.")
|
|
175
|
+
});
|
|
176
|
+
} catch (e) {
|
|
177
|
+
U((e) => ({
|
|
178
|
+
...e,
|
|
179
|
+
accountNumber: ""
|
|
180
|
+
})), I({
|
|
181
|
+
tone: "error",
|
|
182
|
+
text: d(e, "start")
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}, dt = async (e) => {
|
|
187
|
+
rt(e.id), I(null);
|
|
188
|
+
try {
|
|
189
|
+
await k({ variables: { id: e.id } }), await D();
|
|
190
|
+
} catch (e) {
|
|
191
|
+
I({
|
|
192
|
+
tone: "error",
|
|
193
|
+
text: d(e, "refresh")
|
|
194
|
+
});
|
|
195
|
+
} finally {
|
|
196
|
+
rt(null);
|
|
197
|
+
}
|
|
198
|
+
}, ft = async () => {
|
|
199
|
+
if (G) try {
|
|
200
|
+
await Ke({ variables: { id: G.id } }), K(null), et === G.id && V(null), await D(), I({
|
|
201
|
+
tone: "success",
|
|
202
|
+
text: w("devportal.payouts.removed", "Payout method removed.")
|
|
203
|
+
});
|
|
204
|
+
} catch (e) {
|
|
205
|
+
K(null), I({
|
|
206
|
+
tone: "error",
|
|
207
|
+
text: d(e, "remove")
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}, pt = (e) => {
|
|
211
|
+
let t = (Re ?? "").replace(/\/$/, "");
|
|
212
|
+
Le?.(`${t}/${e}`);
|
|
213
|
+
}, Z = w("devportal.payouts.title", "Payouts"), Q = w("devportal.payouts.description", "Choose where the marketplace sends your earnings");
|
|
214
|
+
if (Be && !O) return /* @__PURE__ */ v(o, {
|
|
215
|
+
title: Z,
|
|
216
|
+
description: Q,
|
|
217
|
+
children: /* @__PURE__ */ v("div", {
|
|
218
|
+
className: "flex items-center justify-center py-20",
|
|
219
|
+
role: "status",
|
|
220
|
+
"aria-label": w("devportal.payouts.loading", "Loading payout methods"),
|
|
221
|
+
children: /* @__PURE__ */ v(h, { className: "h-8 w-8 animate-spin text-text-secondary" })
|
|
222
|
+
})
|
|
223
|
+
});
|
|
224
|
+
if (Ve && !O) return /* @__PURE__ */ v(o, {
|
|
225
|
+
title: Z,
|
|
226
|
+
description: Q,
|
|
227
|
+
children: /* @__PURE__ */ y("div", {
|
|
228
|
+
className: "flex flex-col items-center justify-center gap-4 py-20",
|
|
229
|
+
children: [
|
|
230
|
+
/* @__PURE__ */ v(Te, { className: "h-12 w-12 text-status-error-text" }),
|
|
231
|
+
/* @__PURE__ */ v("p", {
|
|
232
|
+
className: "text-text-secondary",
|
|
233
|
+
children: w("devportal.payouts.loadFailed", "Your payout methods could not be loaded.")
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ v("button", {
|
|
236
|
+
onClick: () => void D(),
|
|
237
|
+
className: S,
|
|
238
|
+
children: w("devportal.retryButton", "Retry")
|
|
239
|
+
})
|
|
240
|
+
]
|
|
241
|
+
})
|
|
242
|
+
});
|
|
243
|
+
let mt = (e) => {
|
|
244
|
+
switch (e) {
|
|
245
|
+
case "VERIFIED": return w("devportal.payouts.phase.verified", "Verified");
|
|
246
|
+
case "NOT_STARTED": return w("devportal.payouts.phase.notStarted", "Not verified yet");
|
|
247
|
+
case "IN_PROGRESS": return w("devportal.payouts.phase.inProgress", "Verification in progress");
|
|
248
|
+
case "AWAITING_KYC": return w("devportal.payouts.phase.awaitingKyc", "Waiting for publisher verification");
|
|
249
|
+
case "FAILED": return w("devportal.payouts.phase.failed", "Verification failed");
|
|
250
|
+
case "MANUAL_REVIEW": return w("devportal.payouts.phase.manualReview", "In manual review");
|
|
251
|
+
case "REJECTED": return w("devportal.payouts.phase.rejected", "Rejected");
|
|
252
|
+
case "SUSPENDED": return w("devportal.payouts.phase.suspended", "Suspended");
|
|
253
|
+
case "CLOSED": return w("devportal.payouts.phase.closed", "Closed");
|
|
254
|
+
}
|
|
255
|
+
}, ht = (e, t) => {
|
|
256
|
+
switch (t) {
|
|
257
|
+
case "NOT_STARTED": return w("devportal.payouts.hint.notStarted", "Verify this method automatically so payouts can be sent to it.");
|
|
258
|
+
case "IN_PROGRESS": return e.type === "STRIPE_CONNECT" ? w("devportal.payouts.hint.inProgressStripe", "Finish the Stripe onboarding form. If you closed it, continue to get a fresh link.") : w("devportal.payouts.hint.inProgressRazorpay", "RazorpayX is validating your bank account. This usually takes a few minutes.");
|
|
259
|
+
case "AWAITING_KYC": return w("devportal.payouts.hint.awaitingKyc", "The processor confirmed your account. It is verified as soon as your publisher verification (KYC) is approved.");
|
|
260
|
+
case "FAILED": return w("devportal.payouts.hint.failed", "The processor could not verify this account. Check the details and verify again, or remove it and add a new one.");
|
|
261
|
+
case "MANUAL_REVIEW": return w("devportal.payouts.hint.manualReview", "The marketplace team verifies bank transfers by hand, usually within two business days.");
|
|
262
|
+
default: return null;
|
|
263
|
+
}
|
|
264
|
+
}, $ = (e) => {
|
|
265
|
+
switch (e) {
|
|
266
|
+
case l.RazorpayX: return w("devportal.payouts.type.razorpayX", "RazorpayX (India, INR)");
|
|
267
|
+
case l.StripeConnect: return w("devportal.payouts.type.stripeConnect", "Stripe Connect");
|
|
268
|
+
case l.BankTransfer: return w("devportal.payouts.type.bankTransfer", "Bank transfer");
|
|
269
|
+
default: return e;
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
return /* @__PURE__ */ v(oe, {
|
|
273
|
+
authOnly: !0,
|
|
274
|
+
children: /* @__PURE__ */ y(o, {
|
|
275
|
+
title: Z,
|
|
276
|
+
description: Q,
|
|
277
|
+
backLink: "publisher/profile",
|
|
278
|
+
backLabel: w("devportal.payouts.backToProfile", "Publisher profile"),
|
|
279
|
+
purpose: w("devportal.payouts.purpose", "Paid listings pay out monthly to a verified payout method. In India payouts go through RazorpayX in INR; everywhere else through Stripe Connect in USD, with an international bank transfer as the alternative."),
|
|
280
|
+
actions: j && P && !Qe ? /* @__PURE__ */ y("button", {
|
|
281
|
+
onClick: st,
|
|
282
|
+
className: S,
|
|
283
|
+
children: [/* @__PURE__ */ v(Ae, { size: 16 }), w("devportal.payouts.addMethod", "Add payout method")]
|
|
284
|
+
}) : void 0,
|
|
285
|
+
children: [
|
|
286
|
+
F && /* @__PURE__ */ y("div", {
|
|
287
|
+
role: F.tone === "error" ? "alert" : "status",
|
|
288
|
+
className: n("flex gap-3 rounded-lg border border-border-subtle p-4 text-sm", {
|
|
289
|
+
success: "bg-status-success-bg-subtle text-status-success-text",
|
|
290
|
+
info: "bg-status-info-bg-subtle text-status-info-text",
|
|
291
|
+
error: "bg-status-error-bg-subtle text-status-error-text"
|
|
292
|
+
}[F.tone]),
|
|
293
|
+
children: [F.tone === "error" ? /* @__PURE__ */ v(Te, {
|
|
294
|
+
size: 16,
|
|
295
|
+
className: "mt-0.5 flex-shrink-0"
|
|
296
|
+
}) : F.tone === "success" ? /* @__PURE__ */ v(De, {
|
|
297
|
+
size: 16,
|
|
298
|
+
className: "mt-0.5 flex-shrink-0"
|
|
299
|
+
}) : /* @__PURE__ */ v(m, {
|
|
300
|
+
size: 16,
|
|
301
|
+
className: "mt-0.5 flex-shrink-0"
|
|
302
|
+
}), /* @__PURE__ */ v("p", { children: F.text })]
|
|
303
|
+
}),
|
|
304
|
+
j ? /* @__PURE__ */ y(_, { children: [
|
|
305
|
+
!P && A && /* @__PURE__ */ v(s, {
|
|
306
|
+
title: w("devportal.payouts.agreementTitle", "Accept the Marketplace & Developer Agreement"),
|
|
307
|
+
description: w("devportal.payouts.agreementDescription", "Payout methods can be added once you accept the current agreement."),
|
|
308
|
+
children: /* @__PURE__ */ y("div", {
|
|
309
|
+
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
310
|
+
children: [/* @__PURE__ */ y("p", {
|
|
311
|
+
className: "text-sm text-text-secondary",
|
|
312
|
+
children: [
|
|
313
|
+
Xe?.reason === "AGREEMENT_OUTDATED" ? w("devportal.payouts.agreementOutdated", "The agreement has changed since you accepted it. Review version {{version}} to continue.", { version: A.currentAgreementVersion }) : w("devportal.payouts.agreementBody", "Version {{version}}. Your share of net sales is {{share}}%.", {
|
|
314
|
+
version: A.currentAgreementVersion,
|
|
315
|
+
share: A.revenueSharePercent
|
|
316
|
+
}),
|
|
317
|
+
" ",
|
|
318
|
+
/* @__PURE__ */ y("a", {
|
|
319
|
+
href: A.agreementUrl,
|
|
320
|
+
target: "_blank",
|
|
321
|
+
rel: "noopener noreferrer",
|
|
322
|
+
className: "inline-flex items-center gap-1 font-medium text-primary hover:underline",
|
|
323
|
+
children: [w("devportal.payouts.readAgreement", "Read the agreement"), /* @__PURE__ */ v(Oe, { size: 12 })]
|
|
324
|
+
})
|
|
325
|
+
]
|
|
326
|
+
}), /* @__PURE__ */ y("button", {
|
|
327
|
+
onClick: () => void ct(),
|
|
328
|
+
disabled: Ue,
|
|
329
|
+
className: S,
|
|
330
|
+
children: [Ue ? /* @__PURE__ */ v(h, {
|
|
331
|
+
size: 16,
|
|
332
|
+
className: "animate-spin"
|
|
333
|
+
}) : /* @__PURE__ */ v(g, { size: 16 }), w("devportal.payouts.acceptAgreement", "I accept")]
|
|
334
|
+
})]
|
|
335
|
+
})
|
|
336
|
+
}),
|
|
337
|
+
M && /* @__PURE__ */ y("div", {
|
|
338
|
+
className: "flex gap-3 rounded-lg border border-border-subtle bg-status-info-bg-subtle p-4 text-sm text-status-info-text",
|
|
339
|
+
children: [/* @__PURE__ */ v(m, {
|
|
340
|
+
size: 16,
|
|
341
|
+
className: "mt-0.5 flex-shrink-0"
|
|
342
|
+
}), /* @__PURE__ */ y("p", { children: [M.processor === "RAZORPAYX" ? w("devportal.payouts.routeIndia", "Your payouts are sent through RazorpayX in {{currency}}.", { currency: M.currency }) : w("devportal.payouts.routeInternational", "Your payouts are sent through Stripe Connect in {{currency}}, or by international bank transfer.", { currency: M.currency }), Ze?.status === "COMPLETE" ? ` ${w("devportal.payouts.stepComplete", "You have a verified payout method.")}` : ` ${w("devportal.payouts.stepIncomplete", "You need a verified payout method before paid listings can be paid out.")}`] })]
|
|
343
|
+
}),
|
|
344
|
+
Qe && /* @__PURE__ */ v(s, {
|
|
345
|
+
title: w("devportal.payouts.addTitle", "Add a payout method"),
|
|
346
|
+
description: w("devportal.payouts.addDescription", "Only the last four digits and the bank code are stored. The processor holds the full account."),
|
|
347
|
+
children: /* @__PURE__ */ y("form", {
|
|
348
|
+
onSubmit: (e) => void lt(e),
|
|
349
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
350
|
+
noValidate: !0,
|
|
351
|
+
children: [
|
|
352
|
+
/* @__PURE__ */ v(c, {
|
|
353
|
+
id: "payout-country",
|
|
354
|
+
label: w("devportal.payouts.country", "Account country"),
|
|
355
|
+
value: R.country,
|
|
356
|
+
maxLength: 2,
|
|
357
|
+
required: !0,
|
|
358
|
+
hint: w("devportal.payouts.countryHint", "Two-letter code, for example IN or US"),
|
|
359
|
+
error: B.country,
|
|
360
|
+
onChange: (e) => {
|
|
361
|
+
let t = e.target.value.toUpperCase(), n = u(t, M);
|
|
362
|
+
z((e) => ({
|
|
363
|
+
...e,
|
|
364
|
+
country: t,
|
|
365
|
+
type: n.some((t) => t === e.type) ? e.type : n[0] ?? ""
|
|
366
|
+
}));
|
|
367
|
+
}
|
|
368
|
+
}),
|
|
369
|
+
/* @__PURE__ */ v(ie, {
|
|
370
|
+
id: "payout-type",
|
|
371
|
+
label: w("devportal.payouts.methodType", "Payout method"),
|
|
372
|
+
value: R.type,
|
|
373
|
+
required: !0,
|
|
374
|
+
error: B.type,
|
|
375
|
+
options: ot.map((e) => ({
|
|
376
|
+
value: e,
|
|
377
|
+
label: $(e)
|
|
378
|
+
})),
|
|
379
|
+
onChange: (e) => z((t) => ({
|
|
380
|
+
...t,
|
|
381
|
+
type: e.target.value
|
|
382
|
+
}))
|
|
383
|
+
}),
|
|
384
|
+
/* @__PURE__ */ v(c, {
|
|
385
|
+
id: "payout-holder",
|
|
386
|
+
label: w("devportal.payouts.holderName", "Account holder name"),
|
|
387
|
+
value: R.accountHolderName,
|
|
388
|
+
required: !0,
|
|
389
|
+
error: B.accountHolderName,
|
|
390
|
+
onChange: (e) => z((t) => ({
|
|
391
|
+
...t,
|
|
392
|
+
accountHolderName: e.target.value
|
|
393
|
+
}))
|
|
394
|
+
}),
|
|
395
|
+
ue(R.type) && /* @__PURE__ */ y(_, { children: [
|
|
396
|
+
/* @__PURE__ */ v(c, {
|
|
397
|
+
id: "payout-last4",
|
|
398
|
+
label: w("devportal.payouts.last4", "Last four digits of the account number"),
|
|
399
|
+
value: R.accountNumberLast4,
|
|
400
|
+
inputMode: "numeric",
|
|
401
|
+
maxLength: 4,
|
|
402
|
+
required: !0,
|
|
403
|
+
error: B.accountNumberLast4,
|
|
404
|
+
onChange: (e) => z((t) => ({
|
|
405
|
+
...t,
|
|
406
|
+
accountNumberLast4: e.target.value.replace(/\D/g, "")
|
|
407
|
+
}))
|
|
408
|
+
}),
|
|
409
|
+
/* @__PURE__ */ v(c, {
|
|
410
|
+
id: "payout-bank-code",
|
|
411
|
+
label: de(R.country) === "IN" ? w("devportal.payouts.ifsc", "IFSC") : w("devportal.payouts.swift", "SWIFT / BIC"),
|
|
412
|
+
value: R.bankCode,
|
|
413
|
+
maxLength: 11,
|
|
414
|
+
required: !0,
|
|
415
|
+
error: B.bankCode,
|
|
416
|
+
onChange: (e) => z((t) => ({
|
|
417
|
+
...t,
|
|
418
|
+
bankCode: e.target.value.toUpperCase()
|
|
419
|
+
}))
|
|
420
|
+
}),
|
|
421
|
+
/* @__PURE__ */ v(c, {
|
|
422
|
+
id: "payout-bank-name",
|
|
423
|
+
label: w("devportal.payouts.bankName", "Bank name (optional)"),
|
|
424
|
+
value: R.bankName,
|
|
425
|
+
onChange: (e) => z((t) => ({
|
|
426
|
+
...t,
|
|
427
|
+
bankName: e.target.value
|
|
428
|
+
}))
|
|
429
|
+
})
|
|
430
|
+
] }),
|
|
431
|
+
R.type === l.StripeConnect && /* @__PURE__ */ v("p", {
|
|
432
|
+
className: "text-sm text-text-secondary sm:col-span-2",
|
|
433
|
+
children: w("devportal.payouts.stripeNote", "Stripe collects your bank details and identity on its own secure page when you verify the method.")
|
|
434
|
+
}),
|
|
435
|
+
/* @__PURE__ */ v(re, {
|
|
436
|
+
id: "payout-default",
|
|
437
|
+
className: "sm:col-span-2",
|
|
438
|
+
label: w("devportal.payouts.makeDefault", "Use as my default payout method"),
|
|
439
|
+
checked: R.isDefault,
|
|
440
|
+
onChange: (e) => z((t) => ({
|
|
441
|
+
...t,
|
|
442
|
+
isDefault: e.target.checked
|
|
443
|
+
}))
|
|
444
|
+
}),
|
|
445
|
+
/* @__PURE__ */ y("div", {
|
|
446
|
+
className: "flex gap-2 sm:col-span-2",
|
|
447
|
+
children: [/* @__PURE__ */ y("button", {
|
|
448
|
+
type: "submit",
|
|
449
|
+
disabled: Ge,
|
|
450
|
+
className: S,
|
|
451
|
+
children: [Ge ? /* @__PURE__ */ v(h, {
|
|
452
|
+
size: 16,
|
|
453
|
+
className: "animate-spin"
|
|
454
|
+
}) : /* @__PURE__ */ v(Ae, { size: 16 }), w("devportal.payouts.saveMethod", "Add method")]
|
|
455
|
+
}), /* @__PURE__ */ v("button", {
|
|
456
|
+
type: "button",
|
|
457
|
+
onClick: () => L(!1),
|
|
458
|
+
className: C,
|
|
459
|
+
children: w("devportal.payouts.cancel", "Cancel")
|
|
460
|
+
})]
|
|
461
|
+
})
|
|
462
|
+
]
|
|
463
|
+
})
|
|
464
|
+
}),
|
|
465
|
+
/* @__PURE__ */ v(s, {
|
|
466
|
+
title: w("devportal.payouts.methodsTitle", "Your payout methods"),
|
|
467
|
+
children: N.length === 0 ? /* @__PURE__ */ y("div", {
|
|
468
|
+
className: "flex flex-col items-center gap-3 py-8 text-center",
|
|
469
|
+
children: [/* @__PURE__ */ v(ke, { className: "h-10 w-10 text-text-secondary" }), /* @__PURE__ */ v("p", {
|
|
470
|
+
className: "text-sm text-text-secondary",
|
|
471
|
+
children: P ? w("devportal.payouts.emptyReady", "You have not added a payout method yet.") : w("devportal.payouts.emptyNeedsAgreement", "Accept the agreement above, then add a payout method.")
|
|
472
|
+
})]
|
|
473
|
+
}) : /* @__PURE__ */ v("ul", {
|
|
474
|
+
className: "flex flex-col gap-3",
|
|
475
|
+
"aria-label": w("devportal.payouts.methodsTitle", "Your payout methods"),
|
|
476
|
+
children: N.map((e) => {
|
|
477
|
+
let t = fe(e), r = ht(e, t), i = et === e.id, a = se(e.maskedDetails);
|
|
478
|
+
return /* @__PURE__ */ y("li", {
|
|
479
|
+
"data-testid": `payout-method-${e.id}`,
|
|
480
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
481
|
+
children: [/* @__PURE__ */ y("div", {
|
|
482
|
+
className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
|
|
483
|
+
children: [/* @__PURE__ */ y("div", {
|
|
484
|
+
className: "flex flex-col gap-1",
|
|
485
|
+
children: [
|
|
486
|
+
/* @__PURE__ */ y("div", {
|
|
487
|
+
className: "flex flex-wrap items-center gap-2",
|
|
488
|
+
children: [
|
|
489
|
+
/* @__PURE__ */ v("span", {
|
|
490
|
+
className: "font-medium text-text-primary",
|
|
491
|
+
children: e.displayLabel ?? $(e.type)
|
|
492
|
+
}),
|
|
493
|
+
/* @__PURE__ */ y("span", {
|
|
494
|
+
className: n("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium", Fe[t]),
|
|
495
|
+
children: [t === "VERIFIED" && /* @__PURE__ */ v(Ee, {
|
|
496
|
+
size: 12,
|
|
497
|
+
className: "mr-1"
|
|
498
|
+
}), mt(t)]
|
|
499
|
+
}),
|
|
500
|
+
e.isDefault && /* @__PURE__ */ v("span", {
|
|
501
|
+
className: "inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
|
|
502
|
+
children: w("devportal.payouts.default", "Default")
|
|
503
|
+
})
|
|
504
|
+
]
|
|
505
|
+
}),
|
|
506
|
+
/* @__PURE__ */ y("p", {
|
|
507
|
+
className: "text-xs text-text-secondary",
|
|
508
|
+
children: [
|
|
509
|
+
$(e.type),
|
|
510
|
+
e.country ? ` · ${e.country}` : "",
|
|
511
|
+
e.currency ? ` · ${e.currency}` : ""
|
|
512
|
+
]
|
|
513
|
+
}),
|
|
514
|
+
r && /* @__PURE__ */ v("p", {
|
|
515
|
+
className: "text-sm text-text-secondary",
|
|
516
|
+
children: r
|
|
517
|
+
}),
|
|
518
|
+
e.processorFailureReason && t === "FAILED" && /* @__PURE__ */ v("p", {
|
|
519
|
+
className: "text-sm text-status-error-text",
|
|
520
|
+
children: w("devportal.payouts.failureReason", "Reason: {{reason}}", { reason: e.processorFailureReason })
|
|
521
|
+
}),
|
|
522
|
+
e.rejectionReason && t === "REJECTED" && /* @__PURE__ */ v("p", {
|
|
523
|
+
className: "text-sm text-status-error-text",
|
|
524
|
+
children: w("devportal.payouts.rejectionReason", "Reason: {{reason}}", { reason: e.rejectionReason })
|
|
525
|
+
})
|
|
526
|
+
]
|
|
527
|
+
}), /* @__PURE__ */ y("div", {
|
|
528
|
+
className: "flex flex-wrap gap-2",
|
|
529
|
+
children: [
|
|
530
|
+
ce(e) && !i && /* @__PURE__ */ y("button", {
|
|
531
|
+
onClick: () => q(e.id),
|
|
532
|
+
className: S,
|
|
533
|
+
children: [/* @__PURE__ */ v(g, { size: 16 }), t === "IN_PROGRESS" ? w("devportal.payouts.continueStripe", "Continue on Stripe") : w("devportal.payouts.verifyAutomatically", "Verify automatically")]
|
|
534
|
+
}),
|
|
535
|
+
(t === "IN_PROGRESS" || t === "AWAITING_KYC") && /* @__PURE__ */ y("button", {
|
|
536
|
+
onClick: () => void dt(e),
|
|
537
|
+
disabled: nt === e.id,
|
|
538
|
+
className: C,
|
|
539
|
+
children: [/* @__PURE__ */ v(je, {
|
|
540
|
+
size: 14,
|
|
541
|
+
className: n(nt === e.id && "animate-spin")
|
|
542
|
+
}), w("devportal.payouts.checkStatus", "Check status")]
|
|
543
|
+
}),
|
|
544
|
+
t !== "CLOSED" && t !== "REJECTED" && /* @__PURE__ */ y("button", {
|
|
545
|
+
onClick: () => K(e),
|
|
546
|
+
className: C,
|
|
547
|
+
"aria-label": w("devportal.payouts.removeLabel", "Remove {{label}}", { label: e.displayLabel ?? $(e.type) }),
|
|
548
|
+
children: [/* @__PURE__ */ v(Me, { size: 14 }), w("devportal.payouts.remove", "Remove")]
|
|
549
|
+
})
|
|
550
|
+
]
|
|
551
|
+
})]
|
|
552
|
+
}), i && /* @__PURE__ */ y("form", {
|
|
553
|
+
onSubmit: (t) => void ut(e, t),
|
|
554
|
+
className: "mt-4 grid grid-cols-1 gap-4 border-t border-border-subtle pt-4 sm:grid-cols-2",
|
|
555
|
+
"aria-label": w("devportal.payouts.verifyFormLabel", "Verify payout method"),
|
|
556
|
+
noValidate: !0,
|
|
557
|
+
children: [
|
|
558
|
+
/* @__PURE__ */ v(c, {
|
|
559
|
+
id: `contact-email-${e.id}`,
|
|
560
|
+
type: "email",
|
|
561
|
+
label: w("devportal.payouts.contactEmail", "Contact email"),
|
|
562
|
+
value: H.contactEmail,
|
|
563
|
+
required: !0,
|
|
564
|
+
autoComplete: "email",
|
|
565
|
+
error: W.contactEmail,
|
|
566
|
+
onChange: (e) => U((t) => ({
|
|
567
|
+
...t,
|
|
568
|
+
contactEmail: e.target.value
|
|
569
|
+
}))
|
|
570
|
+
}),
|
|
571
|
+
e.type === l.RazorpayX && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(c, {
|
|
572
|
+
id: `contact-phone-${e.id}`,
|
|
573
|
+
type: "tel",
|
|
574
|
+
label: w("devportal.payouts.contactPhone", "Contact phone (optional)"),
|
|
575
|
+
value: H.contactPhone,
|
|
576
|
+
autoComplete: "tel",
|
|
577
|
+
error: W.contactPhone,
|
|
578
|
+
onChange: (e) => U((t) => ({
|
|
579
|
+
...t,
|
|
580
|
+
contactPhone: e.target.value
|
|
581
|
+
}))
|
|
582
|
+
}), /* @__PURE__ */ v(c, {
|
|
583
|
+
id: `account-number-${e.id}`,
|
|
584
|
+
type: "password",
|
|
585
|
+
label: w("devportal.payouts.accountNumber", "Full account number"),
|
|
586
|
+
value: H.accountNumber,
|
|
587
|
+
required: !0,
|
|
588
|
+
autoComplete: "off",
|
|
589
|
+
inputMode: "numeric",
|
|
590
|
+
hint: a ? w("devportal.payouts.accountNumberHint", "Ends in {{last4}}. Sent to RazorpayX once for validation and never stored.", { last4: a }) : w("devportal.payouts.accountNumberHintNoLast4", "Sent to RazorpayX once for validation and never stored."),
|
|
591
|
+
error: W.accountNumber,
|
|
592
|
+
onChange: (e) => U((t) => ({
|
|
593
|
+
...t,
|
|
594
|
+
accountNumber: e.target.value
|
|
595
|
+
}))
|
|
596
|
+
})] }),
|
|
597
|
+
e.type === l.StripeConnect && /* @__PURE__ */ v("p", {
|
|
598
|
+
className: "text-sm text-text-secondary sm:col-span-2",
|
|
599
|
+
children: w("devportal.payouts.stripeRedirectNote", "You will continue on Stripe's secure page to add your bank account and confirm your identity, then come back here.")
|
|
600
|
+
}),
|
|
601
|
+
/* @__PURE__ */ y("div", {
|
|
602
|
+
className: "flex gap-2 sm:col-span-2",
|
|
603
|
+
children: [/* @__PURE__ */ y("button", {
|
|
604
|
+
type: "submit",
|
|
605
|
+
disabled: Ye,
|
|
606
|
+
className: S,
|
|
607
|
+
children: [Ye ? /* @__PURE__ */ v(h, {
|
|
608
|
+
size: 16,
|
|
609
|
+
className: "animate-spin"
|
|
610
|
+
}) : /* @__PURE__ */ v(g, { size: 16 }), e.type === l.StripeConnect ? w("devportal.payouts.continueToStripe", "Continue to Stripe") : w("devportal.payouts.startVerification", "Start verification")]
|
|
611
|
+
}), /* @__PURE__ */ v("button", {
|
|
612
|
+
type: "button",
|
|
613
|
+
onClick: () => {
|
|
614
|
+
V(null), U(x);
|
|
615
|
+
},
|
|
616
|
+
className: C,
|
|
617
|
+
children: w("devportal.payouts.cancel", "Cancel")
|
|
618
|
+
})]
|
|
619
|
+
})
|
|
620
|
+
]
|
|
621
|
+
})]
|
|
622
|
+
}, e.id);
|
|
623
|
+
})
|
|
624
|
+
})
|
|
625
|
+
})
|
|
626
|
+
] }) : /* @__PURE__ */ y(s, {
|
|
627
|
+
title: w("devportal.payouts.noPublisherTitle", "No publisher profile yet"),
|
|
628
|
+
children: [/* @__PURE__ */ v("p", {
|
|
629
|
+
className: "text-sm text-text-secondary",
|
|
630
|
+
children: w("devportal.payouts.noPublisherBody", "Your publisher profile is created when you submit your first app to the store. Once it exists you can accept the developer agreement and add a payout method here.")
|
|
631
|
+
}), /* @__PURE__ */ v("button", {
|
|
632
|
+
onClick: () => pt("apps"),
|
|
633
|
+
className: n(S, "mt-4"),
|
|
634
|
+
children: w("devportal.payouts.goToApps", "Go to my apps")
|
|
635
|
+
})]
|
|
636
|
+
}),
|
|
637
|
+
/* @__PURE__ */ v(ae, {
|
|
638
|
+
open: G !== null,
|
|
639
|
+
onOpenChange: (e) => {
|
|
640
|
+
e || K(null);
|
|
641
|
+
},
|
|
642
|
+
onConfirm: ft,
|
|
643
|
+
title: w("devportal.payouts.removeTitle", "Remove this payout method?"),
|
|
644
|
+
description: w("devportal.payouts.removeDescription", "Payouts will no longer be sent to it. You can add it again later."),
|
|
645
|
+
confirmLabel: w("devportal.payouts.remove", "Remove"),
|
|
646
|
+
cancelLabel: w("devportal.payouts.cancel", "Cancel"),
|
|
647
|
+
variant: "destructive",
|
|
648
|
+
loading: qe
|
|
649
|
+
})
|
|
650
|
+
]
|
|
651
|
+
})
|
|
652
|
+
});
|
|
653
|
+
};
|
|
654
|
+
//#endregion
|
|
655
|
+
export { w as PublisherPayoutsPage };
|
|
656
|
+
|
|
657
|
+
//# sourceMappingURL=PublisherPayoutsPage.js.map
|