stripe-firebase-extensions icon indicating copy to clipboard operation
stripe-firebase-extensions copied to clipboard

Webhook handler for Stripe event failed: User not found!

Open bogdanciuca opened this issue 1 year ago • 9 comments

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:

  1. Complete a payment
  2. Check function logs in GCP
  3. 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.

bogdanciuca avatar Nov 22 '23 15:11 bogdanciuca

We are getting the same issue @asd1495

jherbkersman avatar Nov 28 '23 20:11 jherbkersman

Gotcha! checking possible solutions @jherbkersman

asd1495 avatar Nov 28 '23 20:11 asd1495

any updates on this?

kazemsami avatar Dec 29 '23 15:12 kazemsami

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: @.***>

jherbkersman avatar Dec 29 '23 16:12 jherbkersman

@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.

bogdanciuca avatar Jan 03 '24 16:01 bogdanciuca

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...

dosstx avatar Feb 06 '24 20:02 dosstx