#kyrn0zofficiel_code
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1222279592455176274
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- kyrn0zofficiel_webhooks, 4 days ago, 71 messages
Hello, Is there a guide you're following for this?
redirectToCheckout function has been deprecated and shouldn't be used for new integrations
@sonic cargo please stay safe! If you're busy at the moment, I recommend contacting our Support team to continue the conversation over email/when you have time: https://support.stripe.com/contact/
You can also return to the #help channel when you're at your computer
Yeah don’t worry I’m parked know I’m on my desk in like 5min if it’s not too much
so i do this :
document.getElementById("checkoutB").addEventListener("click", function() {
stripe.redirectToCheckout({
lineItems: [
{
price: "price_1OuvO0B4fjaL5cwebjtOVW8W",
quantity: totalTshirtsOrdered,
},
],
mode: "payment",
successUrl: "https://www.google.fr/",
cancelUrl: "https://www.youtube.com/",
})
.then(function(result) {
submitFormData(result.id);
})
.catch(function(error) {
console.error("Erreur lors de la redirection vers la caisse:", error);
alert("Une erreur est survenue lors de la redirection vers la caisse. Veuillez réessayer.");
});
});
but if it is depress what do i use ?
because i want to stock my payment id to change it when a get something from the webhook
there is something similar to my code more current that i should use ?
Gotcha. I recommend following this quickstart guide: https://docs.stripe.com/checkout/quickstart
"i want to stock my payment id to change it when a get something from the webhook"
what does this mean exactly?
i have a form previsouly
like imagine it stock the name and when i want to pay i write in a file :
{
"name": "KyrN0z",
"PaymentId" : Id
"PaymentStatus": "waiting
}```
after that if the payment pass or not a get the status (200, 400, ...) from my webhook to update my file :
{
"name": "KyrN0z",
"PaymentId" : Id
"PaymentStatus": "Sucess"
}```
I don't know if it is clear
I think I understand. You should create Checkout Sessions and do a server redirect instead of redirectToCheckout. The details on how to do this are in the guide above. You can listen for checkout.session.completed events to know when something was paid: https://docs.stripe.com/payments/checkout/how-checkout-works#complete
I recommend testing this out so you get a better mental model of how it works