I’m using Stripe API plug in and have set up my web hooks and API keys to allow users to create/manage subscriptions.
When a user subscribes to the service, the payment is completed in stripe, I can see the event in my webhooks, but the users account is not updated to the new plan. When I select “Resend” on the webhook event in Stripe, the users account is automatically updated in bubble to the new plan.
I’ve tried waiting to see if it will update automatically over time, but nothing happens unless I manually Resend the webhook event from Stripe.
Any recommendations on how to get the event to automatically update in bubble when the payment is completed and the new plan is authorized?
My guess is that the webhook is triggered before bubble has a chance to receive the customer ID from stripe. You can check the server logs to verify this. What you can do is create an api workflow with all the actions you want to take when the webhook is triggered. In the webhook api workflow you remove all actions and schedule the api workflow immediately if you find a user with the customer id or with a 5 second delay if no user is found with that customer id
I know this is super late but I was searching this so hope it can help someone else. Bubble does have a delay updating the customer stripe id compared to webhook for the first time. How I resolved this is for the first time a user is interacting whether it be checkout or subscription I do a result of that step and it usually has a checkout id or subscription id native to the bubble plugin. I use those ids with a custom api call to stripe (bubble api plugin) with a get api for either the checkout or the subscription id. This allow me to pull all the fields I would need for the webhook. In the future the webhook works it’s just the first time the stripe ID isn’t updated fast enough.
Alternatively if you’re unsure how to do a custom api to stripe using bubbles api plug in you can create a separate API workflow and call that with a time delay and pass the key information you need from the original webhook in case you don’t need a realtime update.