When deleting video app, change locations to Cal Video (#3022)
* tRPC endpoint to delete credentials * Replace deleted app with daily * Updated Jitisi logo * Update logo size * Update logo size * Fix type error * Remove type as prop * Add isPrismaArray to lib * Address feedback * Remove connect calednar * Expire payment sessions and cancel payment intent * Expire payment sessions and cancel payment intent * Refactor input Co-authored-by: Omar López <[email protected]> * Remove console.log Co-authored-by: Omar López <[email protected]> * Address feedback * Find connected account on Stripe * Fix type error * Add interactive transactions * Remove console.logs * Remove console.log Co-authored-by: Omar López <[email protected]>
This commit is contained in:
1 parent
67ca98018e
commit
89ef6c3f13
7 files changed
+283
-204
No files matched your search
@@ -151,6 +151,27 @@ export async function refund(
|
||||
}
|
||||
}
|
||||
|
||||
export const closePayments = async (paymentIntentId: string, stripeAccount: string) => {
|
||||
try {
|
||||
// Expire all current sessions
|
||||
const sessions = await stripe.checkout.sessions.list(
|
||||
{
|
||||
payment_intent: paymentIntentId,
|
||||
},
|
||||
{ stripeAccount }
|
||||
);
|
||||
for (const session of sessions.data) {
|
||||
await stripe.checkout.sessions.expire(session.id, { stripeAccount });
|
||||
}
|
||||
// Then cancel the payment intent
|
||||
await stripe.paymentIntents.cancel(paymentIntentId, { stripeAccount });
|
||||
return;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
async function handleRefundError(opts: { event: CalendarEvent; reason: string; paymentId: string }) {
|
||||
console.error(`refund failed: ${opts.reason} for booking '${opts.event.uid}'`);
|
||||
await sendOrganizerPaymentRefundFailedEmail({
|
||||
|
||||
Reference in new issue
Block a user