#numbafye
1 messages · Page 1 of 1 (latest)
hello! how are you redirecting the the Stripe Checkout URL?
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");
}
}
};
you should use the checkout url and redirect to that : https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-url
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
not contruct your own url with the id