#Maniac-NET-webhook

1 messages · Page 1 of 1 (latest)

paper swift
#

It's me 😅

#

I am looking around so please bear with me for a while

agile siren
#

haha no worries.

#

I feel like I am probably the millionth person to do this, so a sample project must exist so that I don't have to figure it out from scratch. But I can't find anything. And the documentation seems to be missing pieces.

paper swift
#

How about choosing .NET here

#

or click the "Download full app"

agile siren
#

Yes, I have the basics working. I can call the checkout page, when user makes a payment it calls my webhook. But that example does not capture the customer ID for me

#

#4 says Provistion and Monitor Subscriptions

#

In that example code it shows:

#

switch (stripeEvent.Type) {
case 'checkout.session.completed':
// Payment is successful and the subscription is created.
// You should provision the subscription and save the customer ID to your database.
break;
case 'invoice.paid':

#

So the comments "//you shoudl provision the sub and SAVE THE CUSTOMER ID" This is my problem. I can't figure out how to get and save the customer ID. It's only a comment in this code and I can't believe there is no code example anywhere ?

paper swift
#

var session = stripeEvent.Data.Object as Session;

#

I am not super familiar with .NET but I believe it should be something like that

#

Similar to the Doc

agile siren
#

hmm, ok I have to explore that session object link you sent

#

I guess there is no "completed" .net sample project where it is already being done?

#

All the links / documentation seem to discuss it, but no actual coded example that I can find. I'm just trying to see if I can save my brain some energy 🙂

paper swift
#

I found it!

agile siren
#

thank you sir, that looks interesting. I will examine it !

#

looks like on succesfull checkout, it will give me that session ID. So I can figure out how to use that in the Customer object I guess.

paper swift
#

It should give you a full Session object, which has quite a lot of information inside. One is the CustomerId

agile siren
#

I see. I am reading. If that object contains the customer ID then that is perfect. Thank you!

#

I am surprised they don't have a properly coded example that does this already

#

The only comment "save customer ID now" is a little misleading without showing us 😦

paper swift
#

Sorry, but hope you have a good start here to explore the object

agile siren
#

yes thank you very much for your help