#_greggles_

1 messages · Page 1 of 1 (latest)

fathom currentBOT
#

Hello! We'll be with you shortly. 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.

elfin gulch
#

Can you elaborate? Which part is confusing?

short sail
#
$restart_date = '1704096000'; // Jan 1, 2024

// Create a subscription schedule with the existing subscription
$schedule = $stripe->subscriptionSchedules->create([
    'from_subscription' => 'sub_ERf72J8Sc7qx7D',
]);

// Update the schedule with the new phase
$stripe->subscriptionSchedules->update(
    $schedule->id,
    [
        'phases' => [
            [
                'start_date' => 'now',
                'end_date' => $restart_date,
            ],
            [
                'billing_cycle_anchor' => 'phase_start',
                'end_behavior' => 'release'
            ],
        ],
    ]
);
#

Ugh, formatting

#

Specifically, what should be in the first phase? Just a start and end date? For instance I want to start charging a paused subscription on January first.

elfin gulch
#

phase[0] would be what you want to charge immediately upon update in this case. phase[1] would be the next phase for the future state of the subscription

short sail
#

phase[0], charge nothing and continue to be paused, phase[1] charge the normal subscription rate

#

Hello?

elfin gulch
#

The server is busy, so we're a bit slower to respond than usual. To answer your question: yes.

short sail
#

The documentation isn't specific about this scenario so I'm asking: from the code block above, what else do I need to specify in each phase in order to take a paused subscription and transition the billing anchor to January 1st?

#

The only two things I need to change about each existing paused subscription is setting 'pause_collection' => '', and the billing date.

elfin gulch
#

Okay, so you paused the Subscription and you want to use Subscription Schedules to unpause it in the future. Am I understanding that correctly?

short sail
#

That's correct.

elfin gulch
#

I would think the above code would work. Is the behavior different from what you intend when you run it?

short sail
#

I haven't run it yet. The documentation wasn't clear for this scenario. I suppose I'd need to specify the pause_collection behavior in phase[1] as well.

elfin gulch
#

Gotcha, yeah you would want to have pause_collection: "" in phase[1] in this case

short sail
#

Thank you very much for the info and your time.

elfin gulch
#

Sure thing!