#lucas

1 messages · Page 1 of 1 (latest)

sage grailBOT
past vine
#

Hi! Let me help you with this.

#

Could you please share the Subscription ID?

robust bone
#

hello! ive been using sub_1NGhsaEk6sr5GyDhutjZFJLW

#

for the record, i think if this is a dead end, i can solve in a different way, but i'll have to explain for context

#

actually this canceled sub was probably the one i experienced the error on sub_1NDs0NEk6sr5GyDhFtrf7TOd

sage grailBOT
past vine
robust bone
#

okay, i dont want to cancel the sub, just sidestep the trial

#

we can close this thread down,

past vine
#

What would be the state if it's not a trial, but you also don't want to charge the customer?

#

Maybe if you could share your specific use case I would be able to suggest a better solution.

robust bone
#

long story long i had a previous developer that was using the trial period to move next invoice date around, i would like to use subscription schedules and phases, using that approach ended trial and charged immediately. i want to keep the customer active & not charge them till a specified date

#

end user request is - i want to get charged/shipped product earlier or later than current recurrence next upcoming invoice

#

(we charge and ship products, no proration for our use case, metered time, etc)

#

so my solution here that i think is working instead is to carry the trial with the first phase, ending it when the first phase ends. rather than try to force end it prior to setting up the phases

#

here's the relevant code

return stripe.subscriptionSchedules.update(subSchedule.id, {
    end_behavior: 'release',
    phases: [
      {
        items: subModItems,
        start_date: subSchedule.current_phase.start_date,
        end_date: Math.floor(millis / 1000),
        ...(sub.status === 'trialing' && { trial_end: Math.floor(millis / 1000) }),
        proration_behavior: 'none',
      },
      {
        items: subModItems,
        start_date: Math.floor(millis / 1000),
        proration_behavior: 'none',
        billing_cycle_anchor: 'phase_start',
      },
    ],
  });
#

...(sub.status === 'trialing' && { trial_end: Math.floor(millis / 1000) }),

#

ensures that we dont end the trial and bill

#

walked through a test clock and all seems well

viral igloo
#

👋 stepping in here

#

Give me a moment to catch up

robust bone
#

no worries i'm good, i think

viral igloo
#

Okay yeah I believe the above should work and sounds like you tested

#

Let us know if we can help any further