#paulocoronado

1 messages · Page 1 of 1 (latest)

fast timberBOT
restive moon
#

Both should get triggered

dusty frost
#

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

restive moon
#

Is your webhook set up to listen to customer.subscription.paused events?

dusty frost
#

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}`);
restive moon
#

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?

dusty frost
#

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

restive moon
#

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

dusty frost
#

Sorry, but how can I monitor the pause/running status via event.data.object? What field should I monitor? pause_collection field?

restive moon
#

Exactly

dusty frost
#

Humm, got! It is a little strange tbh, but it is what it is 😆

#

Thanks so much Duchess!