#jennifer_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1245681935024656507
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
my code:
schedule = stripe.SubscriptionSchedule.create(from_subscription=stripe_current_sub_id,) updated_schedule = stripe.SubscriptionSchedule.modify( schedule.id, phases=[ { 'items': [{ 'price': schedule.phases[0].items[0].price, 'quantity': schedule.phases[0].items[0].quantity, }], 'start_date': schedule.phases[0].start_date, 'end_date': schedule.phases[0].end_date, }, { 'items': [{ # 'id': schedule.phases[0].items[0].id, 'price': new_price_id, 'quantity': 1, }], 'iterations': 1, }, ], )
hi! do you know which exact line is throwing that error?
also if you remove the , from from_subscription=stripe_current_sub_id,) on the first line, does that help?
i tried without comma, modify method gave same answer
you have to replace .items with ['items'] like this
'price': schedule.phases[0]['items'][0].price,
on every place it's used
updated_schedule = stripe.SubscriptionSchedule.modify(
schedule.id,
phases=[
{
'items': [{
'price': schedule.phases[0]['items'][0].price,
'quantity': schedule.phases[0]['items'][0].quantity,
}],
'start_date': schedule.phases[0].start_date,
'end_date': schedule.phases[0].end_date,
},
{
'items': [{
# 'id': schedule.phases[0]['items'][0].id,
'price': 'price_xxx',
'quantity': 1,
}],
'iterations': 1,
},
],
)