Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The extension is abandoned #651

Open
androng opened this issue Jan 18, 2025 · 3 comments
Open

The extension is abandoned #651

androng opened this issue Jan 18, 2025 · 3 comments

Comments

@androng
Copy link

androng commented Jan 18, 2025

These things I have had to learn through personal experience in the last few months. As of 2025-01-18 they are still valid and none of the fixes are in the main branch yet, only in pull requests.

  1. There has been no commit history for over a year
  2. The extension still runs on NodeJS 14 which will be decomissioned by Google on 2025-01-30.
    Image
    Solution is to change this line to "node": "20"
  3. The extension only work on production. it references "emulator" in the repo a couple times but It has problems running on Firebase emulator. (detailed later) . no-work solution is to not use the emulator and just use a in-cloud staging environment but my entire workflow was already on the emulator so I ended up fixing the problems.
  4. createCheckoutSession just did not work on emulator OR production, fixed with FirebaseError on createCheckoutSession #304
  5. There is no support for adding a Stripe test key and test webhook secret so I added it myself
 export default {
-  stripeSecretKey: process.env.STRIPE_API_KEY,
-  stripeWebhookSecret: process.env.STRIPE_WEBHOOK_SECRET,
+  stripeSecretKey: process.env.FUNCTIONS_EMULATOR 
+    ? process.env.STRIPE_API_KEY_EMULATOR    // Use test key in emulator
+    : process.env.STRIPE_API_KEY_PROD,   // Use production key in production
+  stripeWebhookSecret: process.env.FUNCTIONS_EMULATOR
+    ? process.env.STRIPE_WEBHOOK_SECRET_EMULATOR
+    : process.env.STRIPE_WEBHOOK_SECRET_PROD,
   productsCollectionPath: process.env.PRODUCTS_COLLECTION,
   customersCollectionPath: process.env.CUSTOMERS_COLLECTION,
   stripeConfigCollectionPath: process.env.STRIPE_CONFIG_COLLECTION,
  1. The webhook just does not run on the Firebase emulator unless you change this in index.ts
    src/config.ts
-export const handleWebhookEvents = functions.handler.https.onRequest(
+export const handleWebhookEvents = functions.https.onRequest(
  1. I had trouble because I used the name "stripe_customers" instead of "customers" Firestore collection name. The extension asks you if you want to rename it but then it doesn't work. I had to hardcode the name to "stripe_customers" in the code. or just use the default names but then they're not grouped together in Firestore
  2. There is no webhook support for handling the "refund" event at all, this is personally important to me because I want refunds from Stripe Dashboard to reflect in my app so users are not encouraged to "double spend" ie get a refund and use my app anyway. Apparently this is fixed with feat(firestore-stripe-payments): Update payments collection for refunds #650
  3. There is no support for Stripe one-time-purchases (pre-pay) or pay-as-you-go (post-paid) purchases. pretty much its Stripe subscription only. I wanted pre-paid or post-paid so not having that is annoying.

Since the developers are not responding at all, i just uninstalled the extension but integrated all the Typescript files into my main project. either that or it doesn't work at all.
in retrospect I am not sure which is less work:

  • just not using the extension at all and checking Stripe every time instead of Firestore. My app is not latency sensitive and I realized I only really just need to link Firestore users to Stripe and I don't care about dynamically updating prices and products. I could have just checked Stripe for that instead of Firestore.
  • write from scratch just the few webbook events I needed.
@rayliverified
Copy link

Thank you for the evaluation!
This extension never really worked well which is very unfortunate.
The explanation is that Firebase had an "extension" as a project which is now being abandoned.

@kelsheikh
Copy link

kelsheikh commented Jan 27, 2025

After looking myself, I noticed this was migrated to invertase from Stripe and you need to remove the older Stripe extension and install their extension.

Its uses Node.js 18 and provides support for Artifact Registry. Where as the older Stripe extension was using Node.js 14.

Image

As for working with the emulator, make sure you have extension in your firebase.json as well as a directory for 'extensions' with whatever you need set in a .env file.

"extensions": {
"firestore-stripe-payments": "invertase/[email protected]"
},

@dubtor
Copy link

dubtor commented Feb 19, 2025

I have just implemented the extension for the first time; it does work (also with the emulator), but I am also running in some problems already (e.g. outdated Stripe API versions, which cause 100% coupons not to work it seems). Also the whole thing is pretty complex and overhead-heavy, with lots of cloud functions, syncing demands between Stripe and Firestore DBs, etc. -- I am not sure if it is really worth using it. Probably wouldn't use it again if I had known 6 months ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants