3

I'm currently using Firebase for my ReactJs website.

I wanted to use stripe to add a payment module. So I created an account on Stripe and added the extension "Run Payments with Stripe" on my Firebase project.

Everything works fine on this extension on my website:

  • I can make payment
  • I'm well redirected to the Stripe payment interface
  • The webhook add the payment document on my customer document on Firestore

But, I have one problem remaining : how to know which firestore document payment was concerned by the one-time payment a customer make on the current checkout session?

Firestore does not update checkout session document with the payment id, or the payment document with the checkout session id.

I tried to update manually the webhook function on Google Cloud but I don't think that's a good idea (and I don't know why but the update was not considered).

I don't want to list all payment the customer made and displayed it : I want to have this specific payment and display a summary of this order.

Does someone has clues on this?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Same problem here. A workaround could be to store a unique ID in field "metadata" of a Checkout Session document. Field "metadata" with all values will be available in the corresponding Payment document as well. – Pierre Chavaroche Jun 17 '22 at 12:59

1 Answers1

1

Yup, it appears that the function in the webhook handler does not add Checkout Session data with the associated Firestore payment document.

I'd recommend creating an issue on the GitHub repository with your feedback/request. Alternatively you can configure a 2nd webhook to update the Firestore documents as you need.

Jonathan Steele
  • 1,502
  • 4
  • 7