#_lordtejas

1 messages ยท Page 1 of 1 (latest)

limber siloBOT
river crag
#

๐Ÿ‘‹ happy to help

#

would you mind sharing your code?

cloud forge
#

Sure

#

lib/stripe.js

import Stripe from "stripe"

export const stripe = new Stripe(process.env.STRIPE_API_KEY, {
  // https://github.com/stripe/stripe-node
  apiVersion: '2023-08-16',
  typescript: false
})

#

The 2nd file web hook one is raising the error

limber siloBOT
little lance
#

According to the error message you are passing a null value instead of a valid String Subscirption Id

#

did you tired to debug your itnegration ?

cloud forge
#

I tried, the subscriptionId are there along with other ones, also show on the payments dashboard

#

This should be automatically generated by stripe right? rest all calls are 200

#

I can't find this variable: subscription_exposed_id in the object

little lance
#

Can you share the objectId ?

cloud forge
#

which one?

little lance
#

WHich you are getting 500 error

cloud forge
#

evt_1NibeaSIlVreXqjGAqYIUN5Q

little lance
#

In your code you have

const subscription = await stripe.subscriptions.retrieve(
            session.stripeSubscriptionId
        )
cloud forge
#

sub_1NibeVSIlVreXqjG8OUyc10I

#

instead of session.stripeSubId i need to pass just session.subscription

little lance
#

yes correct

#

Where did you find this attribut stripeSubscriptionId ?

cloud forge
#

I was going from github and other code sources on youtube, wasn't able to find a proper next js integration, Then I went to some youtube who build similar AI sass we are building

#

Let me test

#

Thanks it helped me, You are a saviour

#

Here, 2nd last one is 400 I should ignore

little lance
#

Can you copy past that eventId here ?

cloud forge
#

evt_1Nic6ISIlVreXqjG3H7x0UyE

#

I haven't activated the account yet and in developer test mode

little lance
#

Did you try to debug your integration and understand why your endpoint responded with 400 status code ?

#

The eventId youa re sharing was delivered successfully to your stripe cli

#

However your endpoint replied with 400, check your endpoint logs and try to debug it to understand why it responded with 400 and not 200

cloud forge
#

Sure, Will do

#

For now there seems no error on webhook logs

little lance
#

Cool, happy to help!

cloud forge
#

I'm not sure, my whole code executed fine, if i can live with this error then I'm fine, I had my mongo db user updated. Thanks for the help @little lance You were a saviour