OpenHands / frontend /src /hooks /mutation /stripe /use-create-stripe-checkout-session.ts
Backup-bdg's picture
Upload 565 files
b59aa07 verified
raw
history blame contribute delete
378 Bytes
import { useMutation } from "@tanstack/react-query";
import OpenHands from "#/api/open-hands";
export const useCreateStripeCheckoutSession = () =>
useMutation({
mutationFn: async (variables: { amount: number }) => {
const redirectUrl = await OpenHands.createCheckoutSession(
variables.amount,
);
window.location.href = redirectUrl;
},
});