#paulocoronado
1 messages · Page 1 of 1 (latest)
Both should get triggered
Humm, so the /webhook route is called multiple times? Because in my case it is only being called one, being event.type = 'customer.subscription.update'...
Is your webhook set up to listen to customer.subscription.paused events?
This is my code:
console.log(`Event type ${event.type}\n`);
// Handle the event
switch (event.type) {
case 'customer.subscription.updated':
// Update logic
break;
case 'customer.subscription.paused':
console.log('PAUSED EVENT TRIGGERED\n'); // never gets triggered
// Pause logic
break;
default:
console.log(`Unhandled event type ${event.type}`);
Yes
No I mean is the endpoint configured to listen to customer.subscription.paused events not the code
In any case, can you share the subscription id so I can take a look?
Yes, I have set it in the dashboard. I am testing the webhook and I am pausing/resuming the same subscription and I think I got the pause event once. But after a resume, it never got triggered again...
This is the subscription_id: sub_1NgXTwLb6voSI5E7WD665TTm
Ok so customer.subscription.paused won't ever be triggered for pausing collection
And the note here:
Subscriptions with pause collection can’t move into status=paused. View Use trial periods to learn about free trials of subscriptions that enter status=paused after a trial ends without a payment method attached.
So you'll need to monitor customer.subscription.updated for both resumes and pauses
Sorry, but how can I monitor the pause/running status via event.data.object? What field should I monitor? pause_collection field?
Exactly