chore: update TODOs

feat/alby
Roland Bewick 2023-09-27 11:32:00 +07:00
parent d6ff14ce91
commit c98c12c01f
3 changed files with 4 additions and 1 deletions

View File

@ -123,7 +123,8 @@ export const AlbyPaymentComponent = (props: IAlbyPaymentComponentProps) => {
type PaymentCheckerProps = PaymentPageProps;
function PaymentChecker(props: PaymentCheckerProps) {
// FIXME: booking success is copied from packages/features/ee/payments/components/Payment.tsx
// TODO: move booking success code to a common lib function
// TODO: subscribe rather than polling
const searchParams = useSearchParams();
const bookingSuccessRedirect = useBookingSuccessRedirect();
const utils = trpc.useContext();

View File

@ -15,6 +15,7 @@ export default function parseInvoice(
return wh.verify(body, headers) as Invoice;
} catch (err) {
// Looks like alby might sent multiple webhooks for the same invoice but it should only work once
// TODO: remove the Alby webhook when uninstalling the Alby app
console.error(err);
}
return null;

View File

@ -99,6 +99,7 @@ function AlbySetupPage(props: IAlbySetupProps) {
const client = new Client(authClient);
const accountInfo = await client.accountInformation({});
// TODO: add a way to delete the endpoint when the app is uninstalled
const webhookEndpoint = await client.createWebhookEndpoint({
filter_types: ["invoice.incoming.settled"],
url: `${process.env.NEXT_PUBLIC_WEBAPP_URL}/api/integrations/alby/webhook`,