I'm fed up.
Paddle and Chargebee and Servicebot all want to charge me a monthly fee ON TOP of Stripe's regular card processing fees.
I know Firebase like the back of my hand, so I'm thinking of writing a drop-in Firebase back end for Stripe subscription integrations. I have two or three projects that need to start charging money. I'd rather write this sucker once and drop it into all of my SaaS apps.
Would anyone be interested in using something like this? I'd open source the code, so you could import it directly into your Firebase project, set a couple of environment variables, and deploy it.
The idea is write a series of Firebase Callable Functions. You could call these back-end functions directly from your client code using Firebase's JavaScript, Android, and iOS SDKs. Firebase handles the authentication, so you could implement your entire checkout flow with Stripe Elements on the front end and never have to mess with servers. The callable functions would update a Firestore collection, so your front end would always be in sync with the current state of your Stripe subscriptions.
Thoughts? Critiques? Suggestions???
Merchant of Record (MoR).
An MoR assumes financial responsibility for its clients, whereas a payments-only solution strictly processes payments.
Paddle's business is based on being an MoR (hence extra charge). Square can act as MoR. Not sure about PayPal, Stripe, Chargebee, Servicebot, etc.
Would be useful if anyone has a link / table summarising the landscape.
I want to use Paddle or something similar, but it feels like overkill for small SaaS apps. It looks like I'm going to be implementing Stripe now :)
Agree.
I've thought about the same thing myself Chris, if that is worth anything.
I'm also thinking of another firebase utility, but what has me hesitating is that the effort to put into it is fine, but if it proves popular, the chance that it'll simply be replaced by a Firebase extension in due course. Perhaps that is me hiding behind excuses, but I thought it worth highlighting.
I've got it up!
https://fireline.chrisesplin.com/
This is brilliant Chris. If you don't mind me asking, why aren't you thinking of productising this?
I'd love to create a managed Fireline if this takes off. That's a huge undertaking and I'm overbooked as it is... so I'll wait until the open-source version gets some traction.
Nice problem to have!
That's good to hear! If we're both thinking along similar lines, it may just be time to pull the trigger. I'll write it for both of us and you can contribute on GitHub if you're missing some functionality :)
I hope that they'll open Firebase extensions up to community authorship at some point. That feels like it should be the end game... but it's so complex I'm sure it would take a long time to implement from the Firebase side. If my extension gets enough traction I'd hope they'd let me write the official Firebase extension.
Yeah, that was my immediate reaction when they were launched. I asked Frank Van Pufflen, CodingDoug & the Programme Mgr (can't recall his name) if there was the intention to open it to the community and they said no (at the time).
Genuinely interested in following your journey Chris. Are you pure JS or TS?
I write JS at the moment, but everyone seems to want TS right now... so it's just a matter of time before I transition.
The Firebase peeps are always tight-lipped. They don't want to get anyone's hopes up. I can imagine the difficulty in opening extensions up to the community. Security concerns would be ridiculous.
Re. security - very true.
Whats your Github id?
https://github.com/deltaepsilon
What's yours?
https://github.com/AndyBrownlie
I cannot use stripe myself because I live in area where stripe is not available, however I did implement stripe for several clients and it is pretty good
for firebase integration, there's a working code available here https://github.com/firebase/functions-samples/tree/master/stripe
in one of projects I have opted to use python with appengine to integrate with stripe (javascript is not very good with numbers), I have used cloud function as trigger, then updated firestore directly collection from appengine when process is done
My code will look something like those samples, but I intend to wrap it in callable functions instead. It's a newer feature that probably didn't exist when they wrote those examples.
JavaScript does fine with integers. I've written multiple checkout flows using JavaScript. You do need to multiply the values by 100 and round them off to integers.
yes, javascript has quirks parsing numbers from string (input value), for example parseInt("07") is 7 and parseInt("08") is 0, so you have to be careful, let me know how you progress, I may help
Thanks! I'm setting up the project today. I have a feeling that the setup/marketing aspect will be the hardest part. Stripe's API isn't too tricky.
This package is published! Check out the docs site below:
https://fireline.chrisesplin.com/
I also have this problem, Chris. I would be a user of this.
Great! I'm working on it now:
https://github.com/deltaepsilon/fireline
It's going to take a bit to be useable.
The subscription-status subscription (lol) is a very nice touch
Thanks! I'm trying to make it super easy to use.
A fully drop-in integration is probably a bit ambitious at the moment... but a developer can dream :)
I think its possible with some configuration on the user’s end
Theoretically in the long term this could be handled by a UI that comes with the deployment (similar to the firebase CMS frameworks out there)
A json object should do the trick though!
Hey Chris,
I would love to see this. I'm a novice developer and I spent last week trying to integrate stripe into my application with firebase functions and React. It was a nightmare.
So yes, this would be amazing, please do it 🙂 and let me know when it's ready to go.
Thanks for the encouragement!
I just started committing code to https://github.com/deltaepsilon/fireline
Go ahead and follow the repo and/or follow my IndieHackers account. I'll post again once I have something usable.
Brilliant, really looking forward to seeing what you create.
@epsilon, I've once again wasted a day pulling my hair out over this. How are you getting on?
I have it published to NPM!
https://fireline.chrisesplin.com/
Unreal! That is super impressive! Let's get it integrated! :) If I get it up and running and it makes some $$, expect some to go your way!
w00t!
Let me know how the integration goes. I've done one myself, but I wrote it... so I'm interested in your experience.
Hey Chris, I've ran into some trouble already. The demo isn't working - the actual card element isn't showing up and there is an error in the console - Uncaught (in promise) IntegrationError: Invalid value for Stripe(): apiKey should be a string. You specified: undefined.
I'll walk through the integration now and let you know if I come across any other issues.
I have a fix in place. Let me know when you run into something else :)
@Rory127 Let's do this via chat. Hit me up on Twitter at @ChrisEsplin.
I suspect you don't have your Firebase SDK loaded onto the page and initialized, which is why it can't ready
firebase.auth().Ok, so I've installed the cloud functions side of this which seems to work fine - functions are deployed.
The example card-form.js throws errors:
Cannot read property 'auth' of undefined.
I think it has to do with importing {useAuth, useFunctions, useStripePromise} from @quiver/fireline because my ide shows a message that it can't resolve those symbols.
On a side note, would you be up for a zoom call to walk through this with me? Happy to compensate you for your time.
Brilliant, working my way through it now. :)
Thank you! I know exactly what's happening. I'll get it fixed first thing tomorrow morning.
I've got the module working, but I'm still fighting to get the exports right. The goal is to get this done today???
The tricky stuff is managing Cloud Functions environments and getting the exports right for both the front-end hooks and the back-end Cloud Functions exports. I'm super close to being able to publish!!!
That sounds like a great idea. I use firebase as well but have not integrated with Stripe just yet as we're in beta phase and haven't started accepting payments yet but we will be doing that soon. I can definitely provide feedback if you're planning on developing this.
I'm at a similar spot. My app is all built out, but I haven't done the subscription integration yet.
I've actually integrated with Stripe a couple of times, but it's been years since I've done any subscription-based apps... so it's time to get that sorted out!
I'll post again when I've got something to demo to the world.
Looking forward to it. Keep us posted!
I've got my first draft up! I've started my own integration to make sure that it's all exported correctly. It'll be a while before I can finish that integration... but let me know what you think!
https://fireline.chrisesplin.com/
Hey, thanks for getting in touch. It's not the best time for me right now as we're in the middle of doing some demos. I'll have to get back to this soon. Thanks again.