#rangermillze_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/1268863991082385448
๐ 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.
- rangermillze_api, 1 day ago, 9 messages
- rangermillze_3ds-payment-element, 2 days ago, 5 messages
- rangermillze_code, 2 days ago, 34 messages
- rangermillze_code, 2 days ago, 19 messages
๐ happy to help
This all works great, however when the paymentIntent.status = succeeded I need to execute a nuber of automation scripts to build my users local environment.
you should do that asynchronously using webhooks
not on the client-side
my platform uses automated scripts to build an environment and notifies the customer of its progress it makes sense to handle this during checkout.
even if that's the case, that doesn't mean you can't do it using webhooks
Ok, so at this point in the script I am showing the user a progress bar with their cloud environment setup progress. Can I see from this point what the webhook is doing?
you can create a websocket with your backend, and then when you receive the webhook event you fire a job that sends updates to the frontend
but this is not really related to stripe
exactly, what i need to know is how can i get the subscription details at this point to complete my setup process.
you would listen to the invoice.paid event
and once you receive it you launch your job
ah, so invoice.paid contains the subscription details?
awesome, i think I understand.
basically when you receive the invoice.paid event you will get the susbcription ID on the invoice
and then you can send that ID to your job
which would then retrieves the subscription and fulfill the order
thanks!
hi, invoice.paid is a webhook event - is there a way to capture this in my js checkout script?
@keen socket as I explained, this should not be handled in your client-side application
what if your customer "accidently" closes the browser tab
it's unreliable and should never be used as a way to provide access to a service
I agree, we use webhook to update our databases but this is just the initial setup. once the payment is made the environment is built whether the user closes the browser or not. Its just the progress indicators we want to show the user.
I could just put a message out and say thankyou for the subscription then build the environment with the webhook. I'd just tell the user to login after they recieve an email.
thinking about it , i think i'll do that.
I take it a webhook is only fired once, so it if fails then thats it
thanks for your help, I already captured the subscription id when it was created in php doh.