What is that syntax for adding a trial to asp core 3.1 using stripe checkout? I'm trying to assign TrialPeriodDays to SubscriptionData for a 7 day free trial.
// Checkout Session
var options = new SessionCreateOptions
{
LineItems = new List<SessionLineItemOptions>
{
new SessionLineItemOptions
{
Price = "price_1KJSMXC...",
Quantity = 1,
},
},
// I believe I need to assign the trial to SubscriptionData below
SubscriptionData = { },
Mode = "subscription",
SuccessUrl = "https://example.com/Success",
CancelUrl = "https://example.com/Cancel",
};
CodePudding user response:
...
SubscriptionData = new Stripe.Checkout.SessionSubscriptionDataOptions
{
TrialPeriodDays = 7
},
Mode = "subscription",
....
