如何使用 ASP.NET 核心将试用添加到条带结帐
How to add trial to stripe checkout using ASP.NET Core
使用 stripe checkout 向 asp core 3.1 添加试用版的语法是什么?我正在尝试将 TrialPeriodDays 分配给 SubscriptionData 以进行 7 天免费试用。
// 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",
};
...
SubscriptionData = new Stripe.Checkout.SessionSubscriptionDataOptions
{
TrialPeriodDays = 7
},
Mode = "subscription",
....
使用 stripe checkout 向 asp core 3.1 添加试用版的语法是什么?我正在尝试将 TrialPeriodDays 分配给 SubscriptionData 以进行 7 天免费试用。
// 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",
};
...
SubscriptionData = new Stripe.Checkout.SessionSubscriptionDataOptions
{
TrialPeriodDays = 7
},
Mode = "subscription",
....