#bibek_code
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/1300386661846487071
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- bibek_api, 4 days ago, 31 messages
- bibek_api, 5 days ago, 63 messages
- bibek_code, 5 days ago, 12 messages
- bibek_code, 5 days ago, 47 messages
- bibek_code, 6 days ago, 41 messages
- bibek_api, 6 days ago, 23 messages
after the date is modified from stripe dashboard using simulation, and when checked in the invoices there were two invoice generated
could you check for this customer or subscription sub_1QCtwJGiCCUNo8Cbuex4fgCr and cus_R544S5ZxeM1KRH
How did you pick the end date of the current phase?
this is how i create the ScheduleSubscription :
`schedule = stripe.SubscriptionSchedule.create(
from_subscription=current_subscription.id,
)
first_phase = {
'items': [{
'price': schedule.phases[0].get('items')[0].price,
'quantity': schedule.phases[0].get('items')[0].quantity,
}],
'start_date': schedule.phases[0].start_date,
'end_date': schedule.phases[0].end_date,
}
if current_subscription.status == 'trialing':
first_phase['trial_end'] = schedule.phases[0].end_date
second_phase = {
'items': [{
'price_data': {
'currency': price.currency.code_for_stripe,
'product': current_app.config['STRIPE_PRODUCTS']['tier-product'],
'recurring': {
'interval': interval
},
'unit_amount': price.price,
},
}],
}
stripe.SubscriptionSchedule.modify(
schedule.id,
phases=[first_phase, second_phase],
)`
Still looking...
I only see 1 upcoming Invoice on this Schedule: https://dashboard.stripe.com/test/subscription_schedules/sub_sched_1QDFDnGiCCUNo8Cb6oFxYuEI
Where do you see the 2 Invoices?
there are the invoices 1CAC733B-0003 and 1CAC733B-0002
Could you please share the Invoice IDs? in_xxx
i got these invoice numbers from manage billing dashboard
please give me a minute
sure
I'm terribly sorry for keeping you waiting
on the dashboard were exactly are you seeing this screenshot? could you send me the URL?
no not these URLs
I'm talking about the dashboard URL where you took this screenshot from
let's step back for a second here
are you creating a Customer Billing Portal Session for your customer to choose if they want to downgrade?
No
how the downgrade is being requested by the customer?
there is just a button from front end part after clicking it calls this code
`schedule = stripe.SubscriptionSchedule.create(
from_subscription=current_subscription.id,
)
first_phase = {
'items': [{
'price': schedule.phases[0].get('items')[0].price,
'quantity': schedule.phases[0].get('items')[0].quantity,
}],
'start_date': schedule.phases[0].start_date,
'end_date': schedule.phases[0].end_date,
}
if current_subscription.status == 'trialing':
first_phase['trial_end'] = schedule.phases[0].end_date
second_phase = {
'items': [{
'price_data': {
'currency': price.currency.code_for_stripe,
'product': current_app.config['STRIPE_PRODUCTS']['tier-product'],
'recurring': {
'interval': interval
},
'unit_amount': price.price,
},
}],
}
stripe.SubscriptionSchedule.modify(
schedule.id,
phases=[first_phase, second_phase],
)`
this user has 2 different subscriptions
https://dashboard.stripe.com/test/subscriptions/sub_1QCtwJGiCCUNo8Cbuex4fgCr and https://dashboard.stripe.com/test/subscriptions/sub_1QDGQ0GiCCUNo8Cb7cRwkKZz
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
that's why you can see 2 different invoices
isn't that due to the downgrade ?
no
it means downgrade functional part is okey.
you need to use test clocks to advance the time and see how the subscription is changed after a month
the downgrade plan which is in the 2nd item of the phase will last forever until the subscription is canceled right ?
yes
and you can set the end_behavior of the subscription schedule to be release so that you no longer need to deal with that type of object in the future
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
if i set end_behavior to release and no iterations set what will happen, does it will return to initial subscription type and schedule is canceled or something else ?
hi! I'm taking over this thread.
the Schedule will stop, and the Subscription itself will continue with no changes
I recommend testing this in test mode to see how this works.
you can use Test Clocks for this: https://docs.stripe.com/billing/testing/test-clocks
if there is no iteration in the last phase after how much time interval it will release ?