cal/packages/lib/payment/handleRefundError.ts
Omar López 7c749299bb
Enforces explicit type imports (#7158)
* Enforces explicit type imports

* Upgrades typescript-eslint

* Upgrades eslint related dependencies

* Update config

* Sync packages mismatches

* Syncs prettier version

* Linting

* Relocks node version

* Fixes

* Locks @vitejs/plugin-react to 1.3.2

* Linting
2023-02-16 15:39:57 -07:00

17 lines
548 B
TypeScript

import { sendOrganizerPaymentRefundFailedEmail } from "@calcom/emails";
import type { CalendarEvent } from "@calcom/types/Calendar";
const handleRefundError = async (opts: { event: CalendarEvent; reason: string; paymentId: string }) => {
console.error(`refund failed: ${opts.reason} for booking '${opts.event.uid}'`);
try {
await sendOrganizerPaymentRefundFailedEmail({
...opts.event,
paymentInfo: { reason: opts.reason, id: opts.paymentId },
});
} catch (e) {
console.error(e);
}
};
export { handleRefundError };