#zeb0261_88204
1 messages · Page 1 of 1 (latest)
Hi Dingbot
if(!empty($subscription->schedule)){
$schedule = SubscriptionSchedule::retrieve($subscription->schedule);
$schedule->release();
}
$cancelled_subscription = Subscription::update(
$id->subscription_id,
['cancel_at_period_end' => true]
);
Oh okay so you are just releasing the schedule and then you are setthing the Subscription to cancel at the end of the period? Why not just use the Subscription Schedule to have the Subscription cancel at the end of the period?
Let's back up a moment
What are you trying to do exactly?
So, my subscription is canceled perfectly
but i want the users use their benefits for subscription before expiry date
customer.subscription.deleted should only fire when the Subscription is actually canceled at the period end.
so when expiry date comes which event calls
customer.subscription.deleted
i check this event call when i cancelled the subscription
but the period_End has 15 days
left
Do you have an example Event ID that I can look at where you are seeing this?
That Event should only fire when the Subscription actually moves to canceled.
So the moment i cancel the subscription
which event calls
If you update the Subscription to set cancel_at_period_end then you should see customer.subscription.updated event at that moment.
At the period end, when the Sub actually moves to canceled, you shoul see customer.subscription.deleted
thankyou let me check
customer.subscription.updated
what is the response of this
actually i want
subscription_id
and same in the
customer.subscription.deleted
Hi there! I have a question about cancel subscription with schedule
on subscription cancel, this event call 'customer.subscription.deleted'
so, when subscription date expires then which event calls
in my case the moment i cancel the subscription
this event call 'customer.subscription.deleted'
and when expiry date times end comes then again
this event call 'customer.subscription.deleted'
this is my code
So if you're cancelling at period end with cancel_at_period_end you should not get a customer.subscription.deleted event when you make that api call. You should only get customer.subscription.updated