#Bas

1 messages ยท Page 1 of 1 (latest)

brave ospreyBOT
faint cove
#

Hi there, releasing a schedule will leave the subscription in place, why do you need to create a new schedule? what's the new schedule for?

olive glade
#

If I want to schedule a downgrade on a released schedule, that's not possible. I need to create a new one then. If I just leave it open, I can add phases to it later on.

faint cove
#

I still don't quite understand the problem that you want to solve. Why do you want to leave a schedule open if it has already done its job and get released?

olive glade
#

I will try to explain myself better.

After the schedule has done its job, and the end user has its current subscription active, he might do another downgrade or upgrade. In that case, I want the schedule to 'resume' by adding a phase to it.
However, at this stage, the schedule has been released already. So in that case I'm creating a 'new' schedule and putting the new phase (the downgrade) after the current phase. It would be easier if the schedule would not release and I would be able to mutate the 'current' schedule instead of creating a new one.

#

Creating a new one is a bit error-prone

faint cove
#

Why error prone?

olive glade
#

Because I'm losing some metadata as well

#

But I reckon it's not possible to have a schedule running indefinitely?

faint cove
#

Not possible. And you might want to consider set the metdata on the subscription object instead.

olive glade
#

Yes, but if the schedule starts in the future, I cannot add metadata to the subscription (because it's not active). But ok, I'll circumvent the problem ๐Ÿ™‚ Thanks

#

Could I ask you one more thing?

faint cove
#

sure

brave ospreyBOT
shrewd sequoia
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

olive glade
#

I'm trying to use a Checkout Session to let the user pay at front for a 3 months subscription. Right after that, I'm setting a schedule to start after 3 months. This works great. However, it seems I cannot use the entered payment details (credit card details) to later charge the customer. For this I should use a SetupIntent (?). But with a SetupIntent I cannot do a charge (of the initial period) AND at the same time gathering payment information to later charge the customer.

#

Is it possible to use a checkout session to charge the customer and gather his/her payment details to later charge the customer once the subscription starts and payment is due?

shrewd sequoia
#

with off_session mode

faint cove
olive glade
#

Thanks.

#

@shrewd sequoia I'm already using the off_session mode. But it doesn't seem to work well

shrewd sequoia
#

I think there's another way to achieve the same result you're looking for but with a much easier integeration path

olive glade
#

Great!

shrewd sequoia
#

I would create a Checkout Session in subscription mode

#

add the main subscription items

#

just give me a sec, I need to test something first

olive glade
#

Yeah, I've been looking into that. But my use case is a bit out of the ordinary.
I want to use the Checkout Session to let the user pay for 3 months at a discount. After these three months, I want the subscription to have a monthly interval and a different amount to charge the customer. So the first Checkout Session is more like a one-off payment, granting the user access for three months AND at the same time gathering payment info so we can charge the customer after the subscription starts.

shrewd sequoia
#

what I did here is create the subscription with the additional 2 months

#
{
  mode: "subscription",
  line_items: [{
    price_data: {
      currency: "eur",
      product_data: {
        name: "monthly sub",
      },
      recurring: {
        interval: "month",
        interval_count: 1,
      },
      unit_amount: 1000
    },
    quantity: 1
  }, {
    price_data: {
      currency: "eur",
      product_data: {
        name: "monthly sub upfront",
      },
      unit_amount: 1000
    },
    quantity: 2
  }],
  success_url: // your success url 
}
#

these are the options I used

#

what this will do is collect 30โ‚ฌ and automatically create the subscription for you

#

you just need to do one more step

#

create a subscription schedule from the subscription and fix the phases as you please

#

does that make sense?