我正在实现条带订阅,但在 api 文档中找不到如何在创建结账会话时指定订阅持续时间的信息。这是我到目前为止所拥有的:
const customer = await stripe.customers.create({
description: "My First Test Customer (created for API docs)",
email: "some.email@gmail.com",
address: {
city: 'Toronto',
country: 'CA',
line1: "Some Address",
line2: "Some unit number",
postal_code: "M5G0V1",
state: "ON",
},
name: "Some Name",
phone: "Some Number",
});
const price = await stripe.prices.create({
unit_amount: 599,
currency: 'cad',
recurring: {interval: 'month', interval_count: '1'},
product: 'prod_KZfHFK4nfCqlGS',
});
const subscriptionSchedule = await stripe.subscriptionSchedules.create({
customer: customer.id,
start_date: 'now',
end_behavior: 'cancel',
phases: [
{
items: [
{
price: price.id, …Run Code Online (Sandbox Code Playgroud)