#Bas
1 messages ยท Page 1 of 1 (latest)
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?
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.
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?
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
Why error prone?
Because I'm losing some metadata as well
But I reckon it's not possible to have a schedule running indefinitely?
Not possible. And you might want to consider set the metdata on the subscription object instead.
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?
sure
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
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?
you can use this parameter https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
with off_session mode
Before I go, @olive glade you can use this param https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases-metadata to set a metadata on the subscription that will be created in the future.
Thanks.
@shrewd sequoia I'm already using the off_session mode. But it doesn't seem to work well
I think there's another way to achieve the same result you're looking for but with a much easier integeration path
Great!
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
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.
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?