#Maniac - .NET Subscriptions

1 messages · Page 1 of 1 (latest)

open whale
umbral monolith
#

I want to keep it simple so I was hoping to use stripe checkout and then stripe customer dashboard to let them make changes.

open whale
#

Do I have to CREATE CUSTOMER first, get their ID, and then I can call the checkout page for the subscription ?
Re. the above: if you're using Stripe Checkout, then you don't have to worry about creating a customer, as Checkout does that for you when it collects the customer's information.

umbral monolith
#

That is what is throwing me for a loop... some pages tell me to create the customer first... then other pages don't mention it... I wasn't sure if I should ASSUME that I need to create customer first. Or if checkout does it for me.

#

One note on that page would be helpful... like ps: you don't have to create a customer if you use this method. lol

#

ok, I'm reading that page now. Thanks!

#

But if I need to store that customer in my database, so that I can find that customer again, do I save the CHECKOUT_SESSION_ID which gets returned to me from Stripe Checkout?

open whale
#

When you say 'store that customer in my database' do you just mean the customer's contact details and relevant Customer object properties? What are you wanting to store specifically?

umbral monolith
#

It must be staring at me, but I don't see it. When I call checkout what do I use to link my customer record to stripe's customer record

#

because later, I want to direct the customer back to the Stripe Dashboard if they want to change their card, or subscription, etc. So I believe I need a stripe customerID to pass them to the dashboard portal

#

(Sorry for all the questions, and thanks for helping me out!)

open whale
#

No worries! Give me just a minute to kind of gather a good response

umbral monolith
#

I see step 6 indicates: "Create a portal SessionServer
Define an endpoint that creates the customer portal session for your frontend to call. Here CUSTOMER_ID refers to the customer ID created by a Checkout Session that you saved while processing the checkout.session.completed webhook.

open whale
#

Can you link the docs you're looking at?

umbral monolith
open whale
#

And you're using the 'Low code' section?

umbral monolith
#

The Checkout doc you showed me does'nt explicitly say to save the CustomerID after checkout is succesfull. That is why I am confuse / over thinking it. If payment is successfull, isn't it important for me (and everyone) to save the customer ID at that point ?

umbral monolith
open whale
#

I see! Okay. Yes. So, you'll want to set up your integration to listen to the checkout.session.completed Event.

#

You will have to code an event handler on the webhook endpoint to store the date internally when that Event fires. It will send details about the checkout session, including the customer ID, to your server, which you can either store as-is, or use to make subsequent API calls to get more data (e.g. subscription IDs)

umbral monolith
#

Ah yes. I see step 4: 4 Provision and monitor subscriptionsServer

After the subscription signup succeeds, the customer returns to your website at the success_url, which initiates a checkout.session.completed webhooks. When you receive a checkout.session.completed event, you can provision the subscription.

#

I must be slow because it doesn't anywhere say "when you receive checkout.session.complete you need to save the customer ID now"

open whale
#

Yup! Exactly

umbral monolith
#

thanks for your help. I will look into that area more "provision the subscription"... I guess I just hvae to figure out the proper resource to pull the customer ID from.

#

I thought it was such a common step that it would be one of the main steps listed like "STEP 5 - record the STRIPE Customer ID so that you can use it later"

#

Are you with Stripe or just a volunteer ?

open whale
#

I thought it was such a common step that it would be one of the main steps listed like "STEP 5 - record the STRIPE Customer ID so that you can use it later"
I feel like the docs could be a little more clear here that you are essentially going to need a pretty robust number of Event handlers on your webhook endpoints to manage subscriptions.

#

It's easy to gloss over some of the sentences that are most key. I've definitely done it myself before (and will likely do it again)

#

Are you with Stripe or just a volunteer ?
I'm a Stripe internal

#

I must be slow because it doesn't anywhere say "when you receive checkout.session.complete you need to save the customer ID now"
It's definitely not just you. You wouldn't actually read this unless you read all the commented lines in the code example from step 4, so it's easy to gloss over

umbral monolith
#

haha, yes there it is. That should definitely be a bold text in the documentation not just in the code comments (I rarely read those)

#

I also assumed the code snippet would contain everything you need... like a copy, edit, and go. but I see that's not the case.

#

Do you know if there is a fully complete project or code anywhere? If it saves me 1 hour of reading & coding will just copy it. But if not then I will insert those pieces my self.