Stripe webhooks vs. Bubble's database triggers


I have a SaaS where I use webhooks to listen for three Stripe events to know when a user subscribes (“customer.subscription.created”), when a subscription payment succeeds (“invoice.payment_succeeded”), and when a subscription payment failed (“invoice.payment_failed”). When the webhooks are triggered, the user is sent an email for the created subscription, payment succeeded or failed.

But I realized webhooks are unnecessary because I can achieve the same with three database triggers. “When User Before Change’s Subscription is empty”, “When User Now’s Subscription status is active” and “When User Now’s Subscription status is unpaid”. Simple as that.

Am I missing something. Which one is better?

Also, what are the critical Stripe events to listen to for a SaaS?

1 Like

If you aren’t using bubble standard stripe setup or using a combo of both you need to use webhooks also it’s best practice with stripe.

Additionally since it’s payment based I have a daily check of subscriptions against our data just to verify everything is in line just in case.

Thanks, @chris.williamson1996.

What do you mean by that? I am using Bubble’s Stripe plugin and Bubble’s native actions (subscribe the user, etc.).

Can you explain this?

bubble standard stripe setup or using a combo of

If you’re using bubble standard stripe plugin (created by bubble) it fills the bubble created fields for “current user subscription” and other fields. This is where the database triggers will work.

However as I’m sure you’ve seen that stripe plug-in is fairly under featured. Many times I tend tip avoid it and opt for creating the data fields myself and using stripe.js plug-in by co pilot, my own plugins for super unique use cases or similar. This is where using database triggers for bubbles native stripe integration or a combo of the two won’t work as those fields native from bubble won’t always be filled if you preformed the action from a 3rd party plugin. (Ex started a checkout experience with 3rd party)

For this part, especially at scale, I tend to create a daily or weekly workflow that runs through our bubble data & checks against stripe. If discrepancy is found it creates a database log I call “payment alert” and sends an email. It’s very rarely off but it’s happened when webhooks break, bubble has server issues, our workflow errors or similar.

It checks for things like:
Are all subscriptions marked active in our database also active in stripe.

Are our stripe connect payout logs in sync

Are invoice status’s in sync


This part ^ probably isn’t as important if your app doesn’t rely on 3rd party services you have to pay per user. Last thing you want is to be paying overhead and have payments out of sync not bringing in revenue. App by app basis but easy to implement and can’t have too many checks on payments in my opinion

Ohh, okay. I know what you mean.

Nice, I’ve never heard from someone that does that checkup. Sounds pretty good.

Thanks for taking the time to answer, @chris.williamson1996.

This topic was automatically closed after 70 days. New replies are no longer allowed.