File size: 378 Bytes
b59aa07
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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;
    },
  });