#praveen-soni_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1329395488813875241
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- praveen-soni_code, 23 hours ago, 32 messages
- praveen-soni_code, 6 days ago, 39 messages
๐ happy to help
https://docs.stripe.com/billing/subscriptions/cancel
https://docs.stripe.com/billing/subscriptions/pause-payment
Pause collection is not working on scheduled subscription
you pause the underlying subscription on the schedule
I don't understand
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I didn't understand... can you please share code
Hi @balmy timber as I mentioned yesterday, we can't write code for you here. Please refer to the documentation to build the solution yourself.
To clarify what was mentioned above, each SubscriptionSchedule has a Subscription attached to it. You can find this Subscription ID under the parameter that my colleague shared.
Instead of pausing the collection on SubscriptionSchedule itself, you can pause collection on the attached Subscription.
Hmm, you're right. Alternatively, you could update the current phase, but it doesn't seem like there's a parameter that allows you to pause collection in phases. https://docs.stripe.com/api/subscription_schedules/update?lang=php#update_subscription_schedule-phases
It's possible that you can't pause collection on SubscriptionSchedules.
This is also not working
Yes
Any solution?
To pause collection on a SubscriptionSchedule - release the Subscription from schedule, and pause it. However, you will loose all the subsequent phases.
https://docs.stripe.com/api/subscription_schedules/release
I understand but my client want to pause it and show the pause status on stripe too
As I stated yesterday, and as the docs suggest: pausing collection is not pausing the Subscription. Subscription with paused collection will still have status=active.
https://docs.stripe.com/billing/subscriptions/pause-payment#pausing-subscription-schedules:~:text=Subscriptions with paused collection canโt move into status%3Dpaused.
Instead of this
Can we set 3 months durations of cancellation?
if (!empty($subscription->schedule)) {
// scheduled downgrade subscription
\Stripe\SubscriptionSchedule::update($subscription->schedule,['end_behavior' => 'cancel'] );
} else {
// normal subscription
\Stripe\Subscription::update($getsubscription->stripe_id, [
'cancel_at_period_end' => true,
]);
}
You want to cancel Subscription after 3 months, instead of the end of this billing cycle, right?
Yes my client's requirement is user's subscription can be paused and resumed within 3 months. After that it be permanently canceled.
Sure. Instead of cancel_at_period_end, you can use cancel_at, and provide it the exact timestamp when you want to cancel the Subscription permanently: https://docs.stripe.com/api/subscriptions/update#update_subscription-cancel_at
it will work for both subscription and scheduled subscription?
Pause the subscription for 3 months
For SubscriptionSchedules you can set end_date of the current phase to that timestamp. But make sure you don't have other phases after that: https://docs.stripe.com/api/subscription_schedules/update#update_subscription_schedule-phases-end_date
In this case payment will be collected
But the subscription needs to be paused for 3 months
and resumed again within 3 months
For Subscription you can pause collection as you did above.
But you can't pause collection for SubscriptionSchedules, as we found out today.
You will need to release the SubscriptionSchedule, and then treat it as regular Subscription.
You mean I have stop the scheduled downgrade subscription
What is "the downgrade subscription"?
I have scheduled downgrade subscription
Yes, you will loose this phase when you release SubscriptionSchedule.
Any other solution?
No, I don't think so. If the customer decides to resume, you will need to turn the Subscription back into a SubscriptionSchedule and add the downgrade phase.
\Stripe\Subscription::update($subscriptionId, [
'pause_collection' => [
'behavior' => 'mark_uncollectible',
],
]);
This will work right
Depending on what you want to achieve.