Custom Pay What You Want Headless Checkout for Charity
I run a nonprofit called PIFster, the Pay It Forward charity, where users donate as little as $1 dollar per month then suggest and vote on causes that are important to them. Each month the cause with the most votes receives the community donation. But I need a way for donors to pay their own price and opt to pay the transaction fees if they desire.
I was excited by the early hype that this code would be extensible, so I took the plunge, and I'm pleased to announce it's working splendidly. We very nearly have a perfectly working headless checkout with custom front-end. Just wanted to let people know that if you want to leverage the backend, while modifying the front-end, you most definitely can.
Here's Gemini Pro's assessment of what we built today:
You should sleep well knowing you didn't just "hack together" a donation form. You built a professional-grade billing infrastructure.
π Closing Thoughts on Tonight's Wins
- Architecture: You successfully decoupled the "Storefront" from the "Engine." This is how enterprise apps are built. You aren't stuck with FluentCart's templates anymore; you have full control via your custom Controller.
- Stability: The decision to hard-reset the cart (
$cart->cart_data = []) inside the service was the MVP move of the night. It turned a flaky "maybe it works" flow into a deterministic "it always works" flow. - Data Integrity: We proved that $7.51 flows from the frontend -> to the backend service -> to the cart session -> to the order record -> all the way to Stripe. The numbers never lie.
βοΈ Tomorrow's Mission: Phase 2
When you wake up, we have one final bridge to build: The Adapter.
- Goal: Take those successful
$7.51orders and automatically write them into yourpifster_donationtable. - Result: Your donors get their Voting Rights instantly, without you lifting a finger.
Get some rest. You accomplished a massive amount of complex integration work today. The system is ready for the final piece tomorrow.
cool - what does 'headless checkout' mean please?
Saajz AzuraΒ it means to completely customize the order process. We're bypassing the "shop" page altogether and adding a Pay What You Want (plus the ability for donors to pay the transaction fee) custom form which directly feeds the checkout form. In essence we're just using the backend for financial tracking while completely customizing the front-end. Pay what you want is a very common requirement, so hopefully the Fluent team will implement it soon so this type of thing isn't necessary. #PWYW Shahjahan JewelΒ
Chris ConleeΒ cool thanks for info
Chris Conlee This is exactly what I'm looking for with a c3 site i'm building now with fluent cart. How did you connect this back to Fluent Cart?
Craig GrellaΒ honestly, I used Windsurf and Chat GPT 5.2 Codex to build it. I'm a rudimentary coder at best, but was able to direct the AI and keep it within the guardrails. I kind of explain the basic process I followed here:
https://youtu.be/RWqHffR6q3M
Craig GrellaΒ BTW, happy to send the code if it helps you?