#tbhaxor - subscription
1 messages · Page 1 of 1 (latest)
subscription schedule
sub_1LGMBNHn3Zy4ma8uRgoudwdA
check this
Bundle item is clear. This payment method is not clear to me
const subscription = await this.stripe.subscriptions.retrieve(id);
if (subscription.schedule) {
throw new NotAcceptableException([
{
message: 'Subscription is already scheduled for items transition.',
field: '$stripe.subscription.schedule',
currentValue: subscription.schedule,
type: 'FIELD_NOT_NULL',
},
]);
}
const schedule = await this.stripe.subscriptionSchedules.create({ from_subscription: id });
return this.stripe.subscriptionSchedules.update(schedule.id, {
proration_behavior: 'create_prorations',
phases: [
{
start_date: subscription.current_period_start,
end_date: subscription.current_period_end,
items: subscription.items.data.map((item) => ({ price: item.price.id, quantity: item.quantity })),
},
{
start_date: subscription.current_period_end,
items: items,
},
],
});
This is the source code of the function I am using to create schedules
subscription schedule
But where is this screenshot from? the Stripe dashboard, your own application, or something else?
Yes
dashboard :/
I thought from the design system it was clear 🤦♂️. https://dashboard.stripe.com/test/subscriptions/sub_1LGMBNHn3Zy4ma8uRgoudwdA
Thanks for the info! We are not really familiar with the dashboard here on Discord, we prefer using APIs 🙂
At least looking at the code you shared, this shouldn't change the payment method of the subscription.
But for this types of things I recommend doing some tests with test clocks: https://stripe.com/docs/billing/testing/test-clocks
This way you can move forward in time and make sure that the invoice are being paid.
Yeah, please check the code
I have implemented this with the API
Could you let cj handle this?
Yeah, please check the code
I already did, and it looks fine to me. I don't see how that could would change the payment method for the subscription. But if you want to double check, I recommend using test clock as mentioned in my previous message.
Cool will do. Just in case if this thread is locked by the bot, how can I ask to open the same thread.
It would be required for providing context later on
You can simply post a message in dev-help asking for someone to reopen the previous thread, with a link to this thread.
Will do, glad you could sort things out!