#zeb0261_88204

1 messages · Page 1 of 1 (latest)

arctic slateBOT
potent hinge
#

Hi Dingbot

alpine magnet
#

Hello there

#

What is the end_behavior of your Subscription Schedule?

potent hinge
#

if(!empty($subscription->schedule)){
$schedule = SubscriptionSchedule::retrieve($subscription->schedule);
$schedule->release();
}
$cancelled_subscription = Subscription::update(
$id->subscription_id,
['cancel_at_period_end' => true]
);

alpine magnet
#

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?

potent hinge
#

So, my subscription is canceled perfectly
but i want the users use their benefits for subscription before expiry date

alpine magnet
#

customer.subscription.deleted should only fire when the Subscription is actually canceled at the period end.

potent hinge
#

so when expiry date comes which event calls

potent hinge
#

left

alpine magnet
#

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.

arctic slateBOT
potent hinge
#

So the moment i cancel the subscription
which event calls

alpine magnet
#

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

potent hinge
#

thankyou let me check

potent hinge
#

customer.subscription.updated
what is the response of this
actually i want
subscription_id

and same in the
customer.subscription.deleted

midnight stone
#

I don't understand the question

#

Can you rephrase

potent hinge
#

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

midnight stone
#

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