#zeke_webhooks

1 messages ¡ Page 1 of 1 (latest)

grave scrollBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1344424745071935629

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

true bloom
#

Hello there

raw bramble
#

Hi!

#

I cant do such because it wont take a localhost....

grave scrollBOT
true bloom
#

If you are just testing using the CLI then you don't actually need to set up an endpoint yet.

#

What CLI command are you using?

raw bramble
#

hmmm

#

Stripe listen?

#

is that what you are asking?

true bloom
#

Yep and are you using --forward-to?

raw bramble
#

no!

true bloom
#

Gotcha well that would be the issue!

waxen stream
#

Hi there. Taking over for my colleague here, who needs to step away

raw bramble
#

Sounds great!

#

I just ran the webhook and got a error lets see.

waxen stream
#

Okay, what steps exactly from the guide that my colleague shared did you take?

raw bramble
waxen stream
#

And is your webhook endpoint code handling that event type? I would expect not from the 500 error

raw bramble
#

What I am trying to accomplish is the corralation/connection between when my authenticated user on my application purchases a subscription through stripe. when I get redirected after a succesful purchase the authenticated accound does not have the new subscription attached.

waxen stream
#

What does "when I get redirected after a succesful purchase the authenticated accound does not have the new subscription attached" mean? Do you mean that you're trying to understand what webhook event to find the Subscription id on?

raw bramble
#

Great question! When the authenticated account on my website for example my gmail gets sent to the checkout page and completes the purchase it gets re-directed back to my application, correct. I have made some code that shows the subscriptions and when I finishs the purcahse it re-directs me to that code and it never changes, even after the purcahses it says saying "Free subscription" when it should display whichever subscription I just made.

#

This tells me that there is no correlation/connection from when my user is completing the checkout process and the authenticated accounts on my page .

#

Does this make sense?

waxen stream
#

So I guess my question is "what does the code that shows the Subscriptions" do? My understanding is that your problem is that you aren't displaying the information about the Subscription that you want to be

#

Also, what products are you using? I am assuming you mean Checkout

raw bramble
#

yes checkout.

here is the code showcasing the subscription.

<div className="space-y-1">
<p className="text-sm font-medium leading-none">
{user?.fullName}
</p>
<p className="text-xs text-muted-foreground">
{user?.emailAddresses[0].emailAddress}
</p>
<span
className={ inline-flex items-center px-2.5 py-0.5 mt-1 rounded-full text-xs font-medium ${subscription?.tier === 'PRO' ? 'bg-gradient-to-r from-indigo-500 to-purple-500 text-white' : subscription?.tier === 'STARTER' ? 'bg-blue-100 text-blue-800' : 'bg-gray-100 text-gray-800'} }
>
{subscription ? subscription.tier : "FREE"} Plan
</span>
</div>

#

The problem is not with this code though.

waxen stream
#

How so? I'm not sure if I understand yet where you're getting the Subscription information that you're displaying

#

Correct me if I'm wrong but my understanding of your problem is "After paying for a Subscription, when Stripe Checkout redirects back to my application, I am displaying Subscription information, but it is not the information of the Subscription that I just paid for"

raw bramble
#

Yes!

#

You are correct!

waxen stream
#

Okay! Now, how are you getting that Subscription?

raw bramble
waxen stream
#

Sure. Your code displays some information about the Subscription - I assume that you are taking that information from a Stripe Subscription. How do you get that Subscription information? Do you, for example, retrieve the Subscription from the API?

If you described what you're doing to me and asked me how to build it, I would tell you that a common approach would be to listen for a checkout.session_completed webhook event, take the Subscription id, and retrieve that Subscription from the API and pass it to the client

raw bramble
#

Interesting. Like this ID?

si_RqaCtjGqegyjy5

waxen stream
#

No, that's a Subscription item

#

a Subscription is sub_abc123

raw bramble
#

sub_1Qwt26IYhOvByvWrqQxUYQqV

#

?

waxen stream
#

Yep. So in the event I just linked, the Subscription is sub_1QwsSPIYhOvByvWrxjcEWxTJ

raw bramble
#

Interesting so would I make and endpoint that would listen for the checkout.session_completed and then take the Subscription id from the API?

waxen stream
raw bramble
#

amazing ill check it out

waxen stream
#

Yeah, I highly recommend our integration guides. They are generally really useful