Skip to content
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

Cannot read properties of null (reading 'client_secret') #620

Open
SohelIslamImran opened this issue Apr 4, 2024 · 0 comments
Open

Cannot read properties of null (reading 'client_secret') #620

SohelIslamImran opened this issue Apr 4, 2024 · 0 comments

Comments

@SohelIslamImran
Copy link

SohelIslamImran commented Apr 4, 2024

Bug report

  • Extension name: firestore-stripe-payments

Describe the bug

When I'm adding checkout_sessions, it is threwing this error in the createCheckoutSession functions:

❗️[Error]: Checkout session creation failed for doc [id]: Cannot read properties of null (reading 'client_secret')

To Reproduce

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

  1. Create a Checkout Session :
const docRef = await db
  .collection("users")
  .doc(currentUser.uid)
  .collection("checkout_sessions")
  .add({
    client: "mobile",
    price: priceId,
    trial_period_days: STRIPE_TRIAL_PERIOD_DAYS,
  });

Expected behavior

It should create the Checkout Session and add ephemeralKeySecret & paymentIntentClientSecret in the checkout_sessions doc

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: Firebase Cloud Server
  • Browser (if applies) [e.g. Chrome, Safari]

Additional context

The error is throwing from here I believe :

subscription.latest_invoice.payment_intent.client_secret;

Maybe client_secret is null here somehow..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant