Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update retry-failed-paypal-payouts.ts

Kiran Ke063bbb67532
diff --git a/apps/web/lib/actions/partners/retry-failed-paypal-payouts.ts b/apps/web/lib/actions/partners/retry-failed-paypal-payouts.ts
index 8fc3646b55..babe547a77 100644
--- a/apps/web/lib/actions/partners/retry-failed-paypal-payouts.ts
+++ b/apps/web/lib/actions/partners/retry-failed-paypal-payouts.ts
@@ -80,7 +80,7 @@ export const retryFailedPaypalPayoutsAction = authPartnerActionClient.action(
payouts,
}));
- await Promise.allSettled(
+ const results = await Promise.allSettled(
payoutsByInvoiceId.map(({ invoiceId, payouts }) =>
createPayPalBatchPayout({
program: payouts[0].program,
@@ -89,5 +89,22 @@ export const retryFailedPaypalPayoutsAction = authPartnerActionClient.action(
}),
),
);
+
+ await Promise.all(
+ results.map((res, idx) => {
+ const { invoiceId } = payoutsByInvoiceId[idx];
+
+ if (res.status === "fulfilled") {
+ console.log(
+ `[PayPal] Retry of payout invoice ${invoiceId} succeeded`,
+ );
+ } else {
+ console.error(
+ `[PayPal] Retry of payout invoice ${invoiceId} failed:`,
+ res.status,
+ );
+ }
+ }),
+ );
},
);