stripe-firebase-extensions
stripe-firebase-extensions copied to clipboard
Webhook handler for Stripe event failed: User not found!
Bug report
- Extension name: [e.g.
firestore-stripe-payments]
Describe the bug
First of all thanks for the extension! I'm having some trouble persisting successful payments in the database. I have enabled user sync, so I was expecting the extension to "create users" (or at least some collection path) in Firestore after a payment is complete.
Logs:
Webhook handler for Stripe event [evt_<ID>] of type [checkout.session.completed] failed: User not found!
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Complete a payment
- Check function logs in GCP
- See error
Expected behavior
The extension should store payments, maybe under an email instead of the userID, when this is not available.
Additional context
I believe this might happen because I don't require Firebase Auth for one time payments. Not sure if this is a bug or a limitation of this extension.
We are getting the same issue @asd1495
Gotcha! checking possible solutions @jherbkersman
any updates on this?
Our issue was internal, not a bug in the SDK. We were creating a stripe ID automatically in firebase when a new user was created, then simultaneously telling stripe to create a new customer (and thus it created another separate stripe id for that customer in the stripe database). Fix was to create the customer in one location first, listen to the ID that got generated, then tell the other database to create a new customer with the existing stripe ID and not generate a new one.On Dec 29, 2023, at 10:26 AM, Kazem Abousetta @.***> wrote: any updates on this?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
@asd1495 Happy New Year! Did you get a chance to review this and think of a solution? I'm currently using another webhook for this, as a workaround.
OK, so as I understand, if set to ‘Sync’, the extension listens to new users signing up and then automatically creates a Stripe customer object and a customer record in your Cloud Firestore. If set to ‘Do not sync’ (default), the extension will create the customer object “on the fly” with the first checkout session creation.
It seems that the "Do Not Sync" step is where the error starts. Correct? If so, does using the Sync step work?
I am new to this extension and got as far as this and now I'm stuck. I'll try to reconfigure the extension to use Sync step instead of Do Not Sync step.....unless someone has a better suggestion...