#merino_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/1334608046550417518
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there ๐ can you share the ID of a Checkout Session where you saw this behavior? I'd like to look at what actual URLs you provided us when your variables resolved.
Can you also elaborate on this question a bit:
and Iโm wondering if I should be getting all new input from Stripe via webhooks
If this is regarding order fulfillment, then we strongly recommend using a webhook endpoint. Relying on your customer fully loading the next page could put your fulfillment process at risk if they unexpectedly lose connection and never load that page.
Yeah 1sec
So right now I'm redirecting to a dev enviroment VM, so here's the session url and the success url I'm building afterwards
Pulling out the ID of the Checkout Session:
cs_test_a1Q5NFWcpAI66ls6obr74kZpo3mIPWAYowOWOBrlYHLkNnudxKOrHMhece
Hm, looks like those URLs would work
I'm quite sure I'm doing something wrong ๐คฃ
I'm using vue + vue router and nodejs for page indexing
I have a
app.get("/success", (req, res) => {
res.sendFile(path.join(__dirname + "/built/index.html"));
});
clause in node js
Which I think could be the problem, should I have a success.html file from you guys?
Sorry, I'm not sure how to route those requests correctly in Vue.
I'd suggest adding logging to that endpoint to confirm it's getting hit as expected, then work on iterating on how you're responding to those requests.
I see, no problem
On any case I was looking up some older codes I have where I used stripe successfully and oddly enough I do the exact same proccess and it used to work lmao
I shouldn't need any "success.html" and "cancel.html" files right?
I'm not sure, I'm not familiar with the web server stack you're using.
Regardless of the stack I'm using, is the correct thing to do is to use webhooks to get the information generated at the end of the checkout?
Or should I get a response directly from the API when the process ends?
Are you using it to populate a page you're showing to your customer, or are you using it to trigger order fulfillment/other downstream processes?
I'm populating a page for my customers but afterwards I'll need this data to start an order fulfillment process
Gotcha, for the page contents I would probably suggest retrieving the Checkout Session when rendering the page and pulling the details from that object. Similar to what we show here:
https://docs.stripe.com/payments/checkout/custom-success-page?payment-ui=stripe-hosted&lang=node#create-the-success-page
For automatically triggering order fulfillment, I'd recommend using webhooks.
When I hit "Pay" should I get any data that my order was fulfilled or the only response is to redirect the customer to success/cancel page?
That page is hosted by us, so you don't have any code running on that page to receive data. The redirect to your pages is indication that the checkout session was completed or canceled.
When a Checkout Session is completed, a checkout.session.completed Event is also generated and sent to any webhook endpoints listening for that type of Event.
https://docs.stripe.com/api/events/types#event_types-checkout.session.completed
We discuss this in our guide for automatic order fulfillment with checkout:
https://docs.stripe.com/checkout/fulfillment?payment-ui=stripe-hosted
Got it, thank you for your time Toby