Skip to content

Commit 38947bc

Browse files
committed
[MNY-239] Payments webhooks updates
1 parent ae75073 commit 38947bc

File tree

14 files changed

+1493
-272
lines changed

14 files changed

+1493
-272
lines changed

apps/dashboard/src/@/api/universal-bridge/developer.ts

Lines changed: 221 additions & 78 deletions
Large diffs are not rendered by default.

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/PayAnalytics.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ export async function PayAnalytics(props: {
156156
client={props.client}
157157
projectClientId={props.projectClientId}
158158
teamId={props.teamId}
159+
authToken={props.authToken}
159160
/>
160161
</div>
161162
);

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/PaymentHistory.client.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export function PaymentHistory(props: {
2828
client: ThirdwebClient;
2929
projectClientId: string;
3030
teamId: string;
31+
authToken: string;
3132
}) {
3233
const [page, setPage] = useState(1);
3334
const { data: payPurchaseData, isLoading } = useQuery<
@@ -40,6 +41,7 @@ export function PaymentHistory(props: {
4041
limit: pageSize,
4142
offset: (page - 1) * pageSize,
4243
teamId: props.teamId,
44+
authToken: props.authToken,
4345
});
4446
return res;
4547
},

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/components/QuickstartSection.client.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export function QuickStartSection(props: {
1616
clientId: string;
1717
teamId: string;
1818
projectWalletAddress?: string;
19+
authToken: string;
1920
}) {
2021
return (
2122
<section>
@@ -46,6 +47,7 @@ export function QuickStartSection(props: {
4647
clientId={props.clientId}
4748
projectWalletAddress={props.projectWalletAddress}
4849
teamId={props.teamId}
50+
authToken={props.authToken}
4951
>
5052
<Button
5153
className="w-full gap-2 group text-foreground bg-background"

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/CreatePaymentLinkButton.client.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export function CreatePaymentLinkButton(
4949
clientId: string;
5050
teamId: string;
5151
projectWalletAddress?: string;
52+
authToken: string;
5253
}>,
5354
) {
5455
const [open, setOpen] = useState(false);
@@ -62,6 +63,7 @@ export function CreatePaymentLinkButton(
6263
projectWalletAddress={props.projectWalletAddress}
6364
setOpen={setOpen}
6465
teamId={props.teamId}
66+
authToken={props.authToken}
6567
/>
6668
</DialogContent>
6769
</Dialog>
@@ -73,6 +75,7 @@ function CreatePaymentLinkDialogContent(props: {
7375
teamId: string;
7476
setOpen: (open: boolean) => void;
7577
projectWalletAddress?: string;
78+
authToken: string;
7679
}) {
7780
const client = getClientThirdwebClient();
7881

@@ -125,6 +128,7 @@ function CreatePaymentLinkDialogContent(props: {
125128
amount: toUnits(values.amount.toString(), token.decimals),
126129
},
127130
title: values.title,
131+
authToken: props.authToken,
128132
});
129133

130134
return result;

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/links/components/PaymentLinksTable.client.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export function PaymentLinksTable(props: {
4444
clientId: string;
4545
teamId: string;
4646
projectWalletAddress?: string;
47+
authToken: string;
4748
}) {
4849
return (
4950
<section>
@@ -57,6 +58,7 @@ export function PaymentLinksTable(props: {
5758
clientId={props.clientId}
5859
projectWalletAddress={props.projectWalletAddress}
5960
teamId={props.teamId}
61+
authToken={props.authToken}
6062
/>
6163
</section>
6264
);
@@ -66,12 +68,14 @@ function PaymentLinksTableInner(props: {
6668
clientId: string;
6769
teamId: string;
6870
projectWalletAddress?: string;
71+
authToken: string;
6972
}) {
7073
const paymentLinksQuery = useQuery({
7174
queryFn: async () => {
7275
return getPaymentLinks({
7376
clientId: props.clientId,
7477
teamId: props.teamId,
78+
authToken: props.authToken,
7579
});
7680
},
7781
queryKey: ["payment-links", props.clientId, props.teamId],
@@ -83,6 +87,7 @@ function PaymentLinksTableInner(props: {
8387
return await Promise.all(
8488
paymentLinks.map(async (paymentLink) => {
8589
const { data } = await getPayments({
90+
authToken: props.authToken,
8691
clientId: props.clientId,
8792
teamId: props.teamId,
8893
paymentLinkId: paymentLink.id,
@@ -134,6 +139,7 @@ function PaymentLinksTableInner(props: {
134139
clientId={props.clientId}
135140
projectWalletAddress={props.projectWalletAddress}
136141
teamId={props.teamId}
142+
authToken={props.authToken}
137143
>
138144
<Button className="gap-2 rounded-full" variant="default" size="sm">
139145
<PlusIcon className="size-4" />
@@ -228,6 +234,7 @@ function PaymentLinksTableInner(props: {
228234
clientId={props.clientId}
229235
teamId={props.teamId}
230236
paymentLinkId={paymentLink.id}
237+
authToken={props.authToken}
231238
>
232239
<Button size="icon" variant="ghost">
233240
<TrashIcon className="size-4" strokeWidth={1} />
@@ -277,6 +284,7 @@ function DeletePaymentLinkButton(
277284
paymentLinkId: string;
278285
clientId: string;
279286
teamId: string;
287+
authToken: string;
280288
}>,
281289
) {
282290
const [open, setOpen] = useState(false);
@@ -287,6 +295,7 @@ function DeletePaymentLinkButton(
287295
clientId: props.clientId,
288296
teamId: props.teamId,
289297
paymentLinkId: id,
298+
authToken: props.authToken,
290299
});
291300
return null;
292301
},

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export default async function Page(props: {
5656
clientId={project.publishableKey}
5757
projectWalletAddress={projectWallet?.address}
5858
teamId={project.teamId}
59+
authToken={authToken}
5960
>
6061
<Button className="gap-1.5 rounded-full" size="sm">
6162
<PlusIcon className="size-4" />
@@ -147,13 +148,15 @@ export default async function Page(props: {
147148
clientId={project.publishableKey}
148149
projectWalletAddress={projectWallet?.address}
149150
teamId={project.teamId}
151+
authToken={authToken}
150152
/>
151153
<QuickStartSection
152154
projectSlug={params.project_slug}
153155
teamSlug={params.team_slug}
154156
clientId={project.publishableKey}
155157
projectWalletAddress={projectWallet?.address}
156158
teamId={project.teamId}
159+
authToken={authToken}
157160
/>
158161

159162
<AdvancedSection

0 commit comments

Comments
 (0)