invertase / stripe-firebase-extensions

Repository of Firebase Extensions built by Stripe.
https://firebase.google.com/products/extensions
Apache License 2.0
435 stars 164 forks source link

Subscriptions sub collection not being created in Firebase #630

Open JacksonRossiDev opened 3 months ago

JacksonRossiDev commented 3 months ago

Bug report

firestore-stripe-payments

Describe the bug

When a user successfully pays for their subscription, only a 'checkout_sessions' subcollection is created in Firestore. There is supposed to be a 'subscriptions' and a 'payments' subcollection that is created when a user succesfully pays for a subscription. I am not the only user experiencing this issue.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Follow instructions provided
  2. Log in and pay for subscription
  3. Check Firestore
Screenshot 2024-06-08 at 4 02 23 PM
maderesponsively commented 3 months ago

Hi,

I experienced the same issue with the firestore-stripe-payments setup. Here's how I resolved it:

  1. Check Stripe Webhook Posts: I started by examining the Stripe webhook posts to understand the issue better. In my case, I found an error (see attached image for reference). Screenshot 2024-06-15 at 14 59 06

  2. Review Cloud Function Logs: Next, I reviewed the Cloud Function logs to pinpoint the exact problem. The logs indicated there was an issue with the Stripe key.

Screenshot 2024-06-15 at 14 59 27

To resolve the problem, I deleted the existing Stripe key and created a new one. After updating my configuration with the new Stripe key, the issue was fixed and the 'subscriptions' and 'payments' subcollections were created successfully when a user paid for their subscription.

I recommend following these steps:

Please let me know what errors you find, and I'll be happy to help diagnose and resolve them.