#Overflowz-subscription-extension

1 messages ยท Page 1 of 1 (latest)

mellow turret
#

Hello ๐Ÿ‘‹
I believe this usecase sounds like it is a better fit for Subscription Schedules.
Let me look into it

dusky copper
#

Yeah, but I'm limited to set some properties for the subscription object itself ๐Ÿ˜ฆ i.e., it's really important for me to set payment_behavior and some metadata properties into it.

mellow turret
#

I see. Looking into it

dusky copper
#

thanks a lot!

mellow turret
#

Apologies for the delay
juggling between multiple threads

dusky copper
#

no worries, take your time

mellow turret
dusky copper
#

I tried that too, but if I want to add a new phase (i.e., trial period into it) it asks gives me error saying "missing phases[0].items. even I provide it, then it asks me about "missing start_time on a phase". when I provide that, it tells me that "you cannot modify start_date of that current phase" which just drives me crazy.

mellow turret
#

are you trying to add the phase at the same time as creating the schedule from a subscription?

dusky copper
#

I mean, if I create a subscription schedule, how can I add the trial period into it (free N months for the user)?

mellow turret
dusky copper
#

I get those errors when I'm trying to update that schedule. I'll try again maybe I'm doing something wrong. thanks, I'll get back to you shortly after I confirm this.

mellow turret
#

No worries!
If the thread is archived by the time you follow up, you can ask the moderator to reopen it ๐Ÿ™‚

dusky copper
#

sure thing, I just need like 5-10 minutes to respond

mellow turret
#

ah cool

#

make sure to include current phase while updating the schedule while adding in a new phase

dusky copper
#

that's the question I have, what should I put in the current phase, just price?

#

won't it create a new subscription with that phase or just keep the existing one but only plan changes

mellow turret
#

since you'll be updating the current schedule, only the plan would change

dusky copper
#

so, something like this?:

  await stripe.subscriptionSchedules.update(schedule.id, {
    end_behavior: "release",
    phases: [
      {
        start_date: subscription.current_period_start,
        end_date: subscription.current_period_end,
        proration_behavior: "none",
        items: [
          {
            price: subscription.plan.id,
            quantity: subscription.quantity,
          },
        ],
      },
      {
        start_date: subscription.current_period_end,
        trial_end: subscription.current_period_end + 7889400, // 3 months approx
        proration_behavior: "none",
        items: [
          {
            price: subscription.plan.id,
            quantity: subscription.quantity,
          },
        ],
      },
    ],
  });
#

if I understand it correctly, it means that, it will keep the current subscription active till it's over and before starting a new cycle, it adds a trial period and then just continues with non-trial period

mellow turret
#

yup

dusky copper
#

hmm... let me think a bit about this

#

since this is an internal thing and not a really "trial period" (we don't let users know how we extend those free months) do I still have to be compliant with the notes on the page that if I'm using trial periods or coupons, I have to notify users about trial end date?

#

also, I have another question regarding to pausing/resuming subscriptions, should I start a new thread about it?

vocal sierra
#

no need for a new thread no

#

And I don't think you have to do any warnings about trials in that case since you're right you're "abusing trials" just to pause the subscription

#

If it were me, I wouldn't use schedules, I'd just put them on a trial until their next payment date and pass proration_behavior: 'none'. It's annoying because it's not a real trial, and you lose the ability to do proper proration and stuff, but it's much easier

dusky copper
#

awesome. so that would be something like set trial period to current_subscription.current_period_end + N months, with proration set to none, is that correct?

#

the tricky part will be to revert it back to whatever it was before(?) or I can just remove the trial and set the subscription.backdate_start_date = trial.start_date

vocal sierra
#

yeah it will work! And in theory you don't need to end the trial, it will just start again once the trial expires.

#

But if you want to "unpause" it's going to be ~impossible unfortunately ๐Ÿ˜ฆ

#

Like there are so many edge-cases, I think you're approaching this a bit wrong business wise (though part of it are the limitations of our subscriptions API)

#

But if I pay for a year on January 1st and you give me 3 extra months in May, the next payment should be April 1st 2023 instead of Jan 1st 2023

#

And then in October you decide to "unpause", when do I pay? Jan 1st? April 1st? Right now in October?

#

You kind of need to model all of those edge-cases and grasp when the person is going to have to pay and how much

dusky copper
#

the whole point is to increase the billing_cycle_anchor to be set to whenever the trial ends

vocal sierra
#

Yes but you just said "revert it back"

dusky copper
#

This is kinda a manual process where admins give users a free months of whatever, but if they make a mistake (i.e., picking a wrong date) they want to revert back to either original or pick a correct date.

vocal sierra
#

yeah so reverting won't be possible without hacks

#

changing the trial end to a different date though is easy

dusky copper
#

yeah, well in that case, I got another question (and it might make things easier)

#

we don't really rely on the stripe's subscription status. we only listen when subscription invoices get paid. being said, maybe pausing a payment collection would be better pick here? although I'm not certainly sure.

#

otherwise, the subscription schedules will work for sure.

vocal sierra
#

yeah pausing collection definitely works and is easy to undo

#

but if you do a yearly sub, it won't work

#

like you'll pause invoices until March. But in March we won't charge for the year. We have skipped the January one and the next one is in 2024

dusky copper
#

yeah, that was my actual concern and question.

#

I got you

#

so subscription schedules it is

#

thanks a lot to you both.