#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/1329021166148653136
đ 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, 5 days ago, 39 messages
Hi
Delete user - cancel subscription partially
Undo user deletion - resume subscription
Permanent user deletion - cancel subscription permanently
$stripeSubscription = Subscription::retrieve($getsubscription['stripe_id']);
$subscription = \Stripe\Subscription::retrieve(
$getsubscription->stripe_id,
[]
);
$subscription->cancel();
Hi, what's your question exactly?
Partial delete user - cancel subscription partially
Undo user deletion - resume subscription
Permanent user deletion - cancel subscription permanently
I've seen this message.
Could you please elaborate what you mean by this?
It clearly defines the requirement
What do you want me to do with this requirement?
I need the code to fulfill the requirement
I'm using laravel stripe-php package
$stripeSubscription = Subscription::retrieve($getsubscription['stripe_id']);
$subscription = \Stripe\Subscription::retrieve(
$getsubscription->stripe_id,
[]
);
$subscription->cancel();
We don't write code for you here, sorry. If you have any specific questions, I will be happy to answer.
I'm not asking you complete code
I'm asking you what should I use to resume cancel and permanent cancel subscription
There's no way to "partially cancel" a Subscription. You can only cancel it permanently and create a new one when needed.
I know that. Is there any alternate solution?
I don't want to create a new subscription
It depends on your use case. How do you want the Subscription to behave when it's "resumed"? Do you want it to start on the date when it's resumed? Or do you want to keep the old billing cycle date?
I want it to start from the date when I resume it and keep running as it was before
keep running as it was before
Do you mean you want the next billing date to be as it was before it was "paused"?
suppose
- in mid if I do then it start for remaining days
- If days are over then it should start from new billing cycle
Generally, the best way to allow customers to cancel subscriptions is the following:
- Allow them to
cancel_at_period_end- basically, give them access to your services until the end of the period they paid for. https://docs.stripe.com/api/subscriptions/update#update_subscription-cancel_at_period_end - If they want to resume their subscription before the end of the period, you just set
cancel_at_period_end=false, and the Subscription will remain as-is. - If not, the billing cycle comes to an end and the Subscription is permanently cancelled. You stop providing your services. If the customer wants to restart the subscription, you will create a new Subscription for them, renewing on the day they restarted it.
but in this case subscription will show as active
Which is correct because the customer already paid for this period.
can we make subscription active or inactive instead?
No, that's not possible, unfortunately.
You can pause collection, however, the use case is when you temporarily want to provide your services for free. The Subscription will have status=active: https://docs.stripe.com/billing/subscriptions/pause-payment
Can we change the status of the subscription through code