#Vatsal
1 messages · Page 1 of 1 (latest)
If you're using stripe-dotnet: https://stripe.com/docs/api/checkout/sessions/retrieve?lang=dotnet
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I have tried from that doc
Ok, and are you seeing an error?
Which version of stripe-dotnet are you using?
Stripe.Checkout
okay I previously I imported billing portal. maybe error was because of that
thank you for the help
np
Depends, do you have other logic that depends on the response? If so you likely wait to make it async and await the response yes
one more query is that,
can I get the subscription duration in response, as currently I am not able to get that duration
currently this pricing model is being used
and after successful payment I am redirecting it to my website with a session ID
ok
Which response?
session response
if user has chosen 3 months subscription, how to get it from this session response
Why are you creating a session if you're using the pricing table?
how can I make it async await in .net
to store subscription duration in my DB. I need something in return
what's the best way to combine with pricing-table
The pricing table takes care of the session creation – you don't need to create that.
then you'd listen for checkout.session.completed events: https://stripe.com/docs/payments/checkout/fulfill-orders
I am retrieving that session in controller to store subscription duration and paid amount in my DB
But there's no guarantee that the session is event completed/paid when retrieving
It's better to rely on async webhooks for fulfilment
that would be possible with pricing-table ?
Would what be possible?
checkout.session.completed implementation
Yep, pricing table uses Checkout under the hood so all related events fire: https://stripe.com/docs/payments/checkout/pricing-table#handle-fulfillment-with-the-stripe-api
okay trying