Instead of storing payments through webhooks: why not just call stripe API when needed?
Recommended approach is to create API endpoint on your server to which Stripe sends payments info when payments are completed. Then you store this info in database, update user status etc.
But what is wrong with this approach: every time I need to check if user has access to certain part of my app, I just get info about his payments through stripe API, and act according to acquired data.
Only problem I see with this is hitting API rate limit. is there any other thing?
EDIT: Benefits of API approach:
- Smaller database size (which implies smaller price)
- Much more error resistant (there is higher chance of my server not receiving or incorrectly processing payment event through webhook then Stripe API not working)
- No need for manual configuration in Stripe dashboard + no need to manually sync things between test mode and live mode, which is fertile ground for accidental mistakes. Everything is setup inside code and equal for both live and test mode. Generally I prefer to do as much possible setup inside code, and as little as possible in GUI. It is much more maintainable and less prone to accidental errors.