#praveen-soni_code

1 messages ¡ Page 1 of 1 (latest)

quaint heartBOT
#

👋 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.

topaz blade
#

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();

vapid anchor
#

Hi, what's your question exactly?

topaz blade
#

Partial delete user - cancel subscription partially
Undo user deletion - resume subscription
Permanent user deletion - cancel subscription permanently

vapid anchor
#

I've seen this message.
Could you please elaborate what you mean by this?

topaz blade
vapid anchor
#

What do you want me to do with this requirement?

topaz blade
#

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();

vapid anchor
#

We don't write code for you here, sorry. If you have any specific questions, I will be happy to answer.

topaz blade
#

I'm not asking you complete code

#

I'm asking you what should I use to resume cancel and permanent cancel subscription

vapid anchor
#

There's no way to "partially cancel" a Subscription. You can only cancel it permanently and create a new one when needed.

topaz blade
#

I know that. Is there any alternate solution?

#

I don't want to create a new subscription

vapid anchor
#

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?

topaz blade
#

I want it to start from the date when I resume it and keep running as it was before

vapid anchor
#

keep running as it was before
Do you mean you want the next billing date to be as it was before it was "paused"?

topaz blade
#

suppose

  • in mid if I do then it start for remaining days
  • If days are over then it should start from new billing cycle
vapid anchor
#

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.
topaz blade
#

but in this case subscription will show as active

vapid anchor
#

Which is correct because the customer already paid for this period.

topaz blade
#

can we make subscription active or inactive instead?

vapid anchor
#

No, that's not possible, unfortunately.

quaint heartBOT
topaz blade
#

Can we change the status of the subscription through code