#numbafye

1 messages · Page 1 of 1 (latest)

glossy ravineBOT
tame sail
#

hello! how are you redirecting the the Stripe Checkout URL?

thin aspen
#

using this in a function i call on a checkout button: const response = await axios.post(
"http://localhost:4242/stripe/create-checkout-session",
{
items,
}
);

  // Redirect the user to Stripe Checkout
  const { id } = response.data;
  window.location = `https://checkout.stripe.com/pay/${id}`;
} catch (error) {
  console.error("Error:", error);
  if (error.response) {
    console.error("Response data:", error.response.data);
    setMessage(error.response.data.error.message);
  } else {
    setMessage("An error occurred");
  }
}

};

tame sail
#

not contruct your own url with the id