#DaxSnax
1 messages · Page 1 of 1 (latest)
Hi there, how do you customer pay the one-off products, via checkout session?
yes via checkout session
var mode = "subscription";
if (adhocPackage != null)
{
mode = "payment";
}
var options = new SessionCreateOptions
{
Customer = await getStripeCustomer(user),
LineItems = new List<SessionLineItemOptions>
{
new SessionLineItemOptions
{
Price = priceId,
Quantity = 1,
},
},
Mode = mode,
SuccessUrl = domain + "/success?session_id={CHECKOUT_SESSION_ID}",
CancelUrl = domain + "/cancel",
ClientReferenceId = user.FindFirstValue(ClaimTypes.Name)
};
var service = new SessionService();
Session session = await service.CreateAsync(options);
@humble sedge ^ something like this
Got it, you can listen to checkout.session.completed events (https://stripe.com/docs/api/accounts/object#account_object-charges_enabled) to get notified when you customer completed a checkout session
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.