Show HN: We built an open source, zero webhooks payment processor (opens in a new tab)github.com
405 pointsRepo: https://github.com/flowglad/flowglad
Demo video: https://www.youtube.com/watch?v=G6H0c1Cd2kU
Flowglad is a payment processor that you integrate without writing any glue code. Along with processing your payments, it tells you in real time the features and usage credit balances that your customers have available to you based on their billing state. The DX feels like React, because we wanted to bring the reactive programming paradigm to payments.
We make it easy to spin up full-fledged pricing models (including usage meters, feature gates and usage credit grants) in a few clicks. We schematize these pricing models into a pricing.yaml file that’s kinda like Terraform but for your pricing.
The result is a payments layer that AI coding agents have a substantially easier time one-shotting (for now the happiest path is a fullstack Typescript + React app).
Why we built this:
- After a decade of building on Stripe, we found it powerful but underopinionated. It left us doing a lot of rote work to set up fairly standard use cases
- That meant more code to maintain, much of which is brittle because it crosses so many server-client boundaries
- Not to mention choreographing the lifecycle of our business domain with the Stripe checkout flow and webhook event types, of which there are 250+
- Payments online has gotten complex - not just new pricing models for AI products, but also cross border sales tax, etc. You either need to handle significant chunks of it yourself, or sign up for and compose multiple services
This all feels unduly clunky, esp when compared to how easy other layers like hosting and databases have gotten in recent years.
These patterns haven’t changed much in a decade. And while coding agents can nail every other rote part of an app (auth, db, analytics), payments is the scariest to tab-tab-tab your way through. Because the the existing integration patterns are difficult to reason about, difficult to verify correctness, and absolutely mission critical.
Our beta version lets you:
- Spin up common pricing models in just a few clicks, and customize them as needed
- Clone pricing models between testmode and live mode, and import / export via pricing.yaml
- Check customer usage credits and feature access in real time on your backend and React frontend
- Integrate without any DB schema changes - you reference your customers via your ids, and reference prices, products, features and usage meters via slugs that you define
We’re still early in our journey so would love your feedback and opinions. Billing has a lot of use cases, so if you see anything that you wish we supported, please let us know!
Comments (223) 46 threads
Pasting the full root license file below: — Flowglad is fully open source.
- ./packages: MIT
- ./playground: MIT
- ./platform: AGPLv3
Re open source: the SaaS is under AGPLv3, and the rest is MIT.
Re “processor”: often when payment providers first get started they don’t fit into one of the established payment vendor categories because they need to piggyback off someone else’s infrastructure. We figured it would be better to make clear that we’re not a billing SaaS, but also providing payments processing - even if for now that’s through Stripe Connect.
Eg we are aligned with our merchants in worrying chargebacks in a way that “bring your Stripe key” billing SaaS is not, because our setup means their chargebacks are a concern for us similar to how they’re a concern for Stripe.
Since we’re the payments provider (using Stripe under the hood), we’re not currently able to support “bring your own provider” unfortunately.
Continue this thread — 3 replies
About the „processor“: IANAL, but I would assume that a payment processor has liabilities and regulations similar to that of a bank - line it’s the case for PayPal or Stripe. On the other hand, no one would raise a concern of you were forwarding transactions to Visa or some huge bank, so this is probably just a communication issue that you might want to tackle upfront.
This thread has been eye opening for revealing how much more clearly we could be explaining the funds flow story. Thank you for your feedback!
From what I can tell, any time you use this to check something like the customer's subscription state (or anything else payment-related) - either from the front end or the back end - it's going to perform an API request to Flowglad's servers. If you care about responsiveness, I'm not sure that's a good idea. Of course, you can cache that state if you need to access it frequently, but then it kind of defeats the purpose of this layer.
Stripe integration can be tricky, but if you don't want to store anything locally, you might as well just hit Stripe's APIs without the middleman. For the payment systems I've worked on, having cached state in the database is actually really nice, even if it's a bit more work. Want to do a complicated query on your customers based on payment/subscription state and a bunch of other criteria? It's just a DB query. With this, I think you'll be hoping they expose an API to query what you need and how you need it. Otherwise, you'll be stuck waiting for a thousand API requests to fetch the state of each of your customers.
We have a plan to allow you to store more of this data on the merchant's side and still benefit from the work we've done to refine our data model, and make the SDK super usable. Even if you do hit Stripe's APIs, you will need to maintain mappings of price ids to your plans, your plans to what features you grant for each, stripe customer ids to your customer ids, etc. That's the kind of grunt work and maintenance burden we'd like to eliminate.
Plus, Stripe is explicitly designed to be a write-optimized system, and discourages[0] using them as a realtime read layer. We're super early in the journey but that's the problem we want to solve: how can we give software devs the same unified money movement + value movement experience that Shopify has availed to DTC brands for nearly 20 years?
[0] https://docs.stripe.com/rate-limits
Continue this thread — 1 reply
I think you're overvaluing how much work this is. For years I just created the plans in Stripe and then manually copied them over into my database. If you're small and not changing your plans often, this is fine.
When eventually I got annoyed because I had a Stripe sandbox and my own staging environments I wanted to sync periodically, I banged out a 'sync' script in a couple hours. Could probably do it even less time with AIs these days.
> your plans to what features you grant for each
I don't understand how your service can even help with this. "Features" are necessarily part of my app, I have to define what the user is purchasing.
> stripe customer ids to your customer ids
It's one extra column.
Maybe you can call it 'grunt work' but how often are ya'all putting up new SaaS's?
Even if you can somehow keep your latency to a minimum, if you have even a second of down time, my app goes down with yours. I don't like that. Right now if Stripe goes down for a bit, nothing happens to my app. It keeps chugging along. Maybe some of my customers can't pay their monthly subscriptions for a bit but they're not locked out of the app.
This whole thing feels like a trap TBH. Feels like vendor lock-in. I am kind of locked into Stripe because it'd be a PITA to re-integrate with something else, but at least I own the data (sans credit card #s, which I don't want) and can move elsewhere if push comes to shove (well... OK, asking everyone to re-enter their card # would suck too).
> I don't understand how your service can even help with this. "Features" are necessarily part of my app, I have to define what the user is purchasing.
We let you define features that you reference using slugs that you decide, and then group those features with products. So when someone subscribes to the product, they get the features you defined and associated with that product. So to see whether they can access a feature (boolean):
useBilling().checkFeatureAccess('fast_generations')
Or to see if they have enough credits to take a usage metered action:
useBilling().checkUsageBalance('fast_generations')
The problem we're trying to address is a bit broader than just storing price ids. You use your customers' payments state to derive billing state, and you use billing state to derive app behavior (what features they can access, what usage meters what balances and whether those are sufficient to continue consumption). You need this data on your backend and your frontend. So a substantial amount of most CRUD app code is just managing, transposing, and shuttling this kinda of data around between backend and frontend.
For fun I once mapped out a vanilla SaaS checkout flow and realized that it required a developer to coordinate 15 server-client boundary hops [0]. Each one is a liability that you have to maintain. And the flow as a whole is one of the most frustrating to test. If a developer came up with this flow on their own, we'd immediately say it smells. But it's the flow required by the current best-in-class vendors.
And it's not entirely the result of complexity intrinsic to the domain. Much of it is the result of decisions made over a decade ago that haven't really been revisited. At least in React-land, we've learned a lot in that time about how gracefully different patterns for state management age in a codebase. The last time the webhook-only pattern was the frontier of DX, Redux was the considered the best state management framework for React.
I haven't seen Redux in React code in a very long time, maybe 6 years. Not because Redux is terrible - in fact it represented the community's best understanding of state management at the time. But over time we realized the limitations of Redux as a framework, and engineered our way out of them with new frameworks. This process is natural and beautiful and part of what makes technology magical. In payments, this improvement loop is significantly rate limited. Because to build a truly better solution you have to commit to all of the uphill compliance and financial services work that people have very astutely pointed out in other comments.
[0] https://x.com/agreeahmed/status/1965258666892034257/photo/1
I very much relate to the problems you're trying to solve, so much so that I have created a Stripe integration library [0] that has very similar DX to flowgrad! (not nearly as feature rich however). I've also written a blog post as to why I built it[1].
Key difference is where the final billing information is stored, our library also ships db schemas and the webhook handlers write to that local db.
You should also check out our (open source, MIT) library[1] this is built on, it could be useful for you guys!
[0]: https://fragno.dev/docs/stripe/quickstart
[1]: https://fragno.dev/blog/split-brain-stripe
[2]: https://fragno.dev/docs/fragno
As a relatively new developer, I'm curious why the dependancy on React?
Was there no way to get the UI you wanted without implementing a framework like React?
We are Svelte based, so it's frustrating for us to have to drag in React for libraries like this.
We started with React because that’s what we knew best and the community we were most embedded in.
We have no dogmatic attachment to React. We hope to support Svelte and Vue soon. We’ll start on that once we feel that our data model and flow are sufficiently nailed down that we feel comfortable committing to porting our SDK to other frontend frameworks.
E.g. most web apps have some endpoint that the client calls to initiate a checkout session by calling their payment processor’s server SDK.
How many times has the following code been implemented because no payment processor ships a route handler and a React hook (pardon my React-brainedness)?
Someone has to do the work to get that checkout request from your frontend to your payment provider and then back so you can redirect. In a just world, that your processor’s SDK would handle that work. Otherwise it falls on your plate.
Continue this thread — 2 replies
> customPreactRootRenderFunction(document.getElementById("outlet"))
To be fair, chosing Svelte over React explicitly means that - if the React installed/userbase is 10-50x as big, you will be frustrated with this a lot. But in the end I don't get the frustration, in the end react is not a framework and you can render any component into a single HTML node that is part of your Svelte system. If the external library is encapsulated well, you shouldn't even notice that is react based.
And the problem goes substantially beyond billing UI. There's all the unseen tedium that devs need to implement in order to derive proper app behavior based on their customers' billing state. Most of this work is transposing billing state (and its derivatives) and then lugging it to the client where it will be used to show upgrade buttons, gate feature access, show outstanding usage balances, etc.
All comments shown.
Couldn't load more comments. Check your connection and try again.