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
Error installing firestore-stripe-payments in emulator #394
Comments
I'm also experiencing this issue, any update? Edit: Do you have a open billing account linked to your Google account? I'm starting to think it's related to that. The ref that isn't available is probably
|
Got the same error - a working workaround is specifying the version you want to install - the local flag does not need to be set anymore. |
HI @penx Did the above comment fix your scenario? If this is still an issue could you report it under https://github.com/firebase/firebase-tools repository as it is this package that would update this particular issue. Please see https://github.com/firebase/firebase-tools/blob/b2327da886ded6c71b991aee461c9fbd06003538/src/extensions/refs.ts for more information. |
I had the same issue, but this seemed to work: The only potential issue I see now is: I don't know what that will effect. |
I am using Stripe Test Mode. When I create a product on Stripe, or create a user in Firebase, the product gets added to the Firestore database in production, and when adding a new user, a new customer is added in Stripe. I would like to have the same communication but in my local using Emulators. After I installed this extension locally, it created a folder call "extension" with two files, firestore-stripe-payments.env and firestore-stripe-payments.secret.local. In the last file, I do have STRIPE_API_KEY, and STRIPE_WEBHOOK_SECRET fill in. I run the emulators:
Then using Stripe CLI I started to listen to events: However, when I edit a product on Stripe Test Mode, I get the following errors:
I do get mostly 500s errors, and sometimes without changing anything also 401s. I have tried to change the STRIPE_WEBHOOK_SECRET with the one that stripe-cli supply when you start listing:
but still not working either. If I go to the Stripe Dashboard event. And I look at the localhost response I can see:
My guess is that I need to add the webhook secret somewhere apart from the firestore-stripe-payments.secret.local but I do not know where or how. **Also another thing I was not expecting is that when I go to extension emulator http://127.0.0.1:4000/extensions There is no extensions there. |
This is so weird. If I try to trigger for the first time "stripe trigger product.updated" it gives me 500 error, but if I create a user using Firebase Emulator Authentication, it sends the user to Stripe and responds with 200. And after if I request the "stripe trigger product.updated" it works!!
|
@thetwentyseven did you find where to add the webhook secret key locally? i'm having the exact same issue |
@merri-ment the webhook secret is created after you install the extension. It is in a folder call extensions and in a file called firestore-stripe-payments.secret.local. Dont you have that one? |
In order to connect to the emulator database, and auth you need to do the following:
Even if you are using the Firebase v8 api syntax, as I am, you need to use the code above. You can check the example in https://github.com/stripe/stripe-firebase-extensions/blob/055d467b3aa9441dae372904818847fb222ba57d/firestore-stripe-web-sdk/test/emulator.spec.ts |
Hey @thetwentyseven, thanks for your reply. Yes All Auth, Firestore and Functions emulators are working locally too. When i update a product in Stripe and look at the Webhook log in Test Mode, i see 401 ERR - Webhook Error: Invalid Secret. This is ultimately the issue, nothing returned from Stripe SDK, which i guess is an issue with the extension webhooks.
|
okay, i missed the crucial step of spinning up the Stripe CLI locally and porting the webhook.
|
Had the same experience and lost a couple of hours because this isn't mentioned in the docs, as least as far as I can see. It looks like the docs are expecting the user to being running on the cloud based on "Here's your function's URL: ${function:handleWebhookEvents.url}" Also, if one creates a restricted key with only the permissions mentioned in the docs ( |
Yep, I'm also loosing a lot of time figuring this out... definitely worth updating the docs. |
Yea this was a headache to figure out. There should be more about emulator / stripe integration. |
Bug report
Describe the bug
When trying to install firestore-stripe-payments in the emulator, I get:
To Reproduce
Expected behavior
Should either be able to install in the emulator or receive a meaningful error message.
System information
The text was updated successfully, but these errors were encountered: