Discourse Subscriptions - user not removed from group when subscription cancelled

AI-generated summary

In a support discussion about Discourse Subscriptions, Jonathan5 reported that users aren’t being removed from groups after subscription cancellation, whether done via Discourse or Stripe. maiki suggested verifying Stripe webhook configuration, which turned out to be the issue: Jonathan5 had not entered the correct webhook secret in Discourse. After trying the “Signing secret” (starting with whsec_) instead of the we_ code, webhooks began working. Additionally, Jonathan5 clarified that user-initiated cancellation only stops auto-renewal and does not immediately remove the user from the group — this behavior is intentional. The issue was resolved by correctly configuring the webhook secret, and the topic was moved to Product Support.

Continuing the discussion from Discourse Subscriptions:

Possible bug: A user is added to the Discourse group when a subscription starts, but the user is not removed when the subscription is cancelled.

I’ve cancelled via Discourse (logged in as the user) and cancelled via Stripe’s website, but in neither case was the test user removed from the group. Perhaps it is relevant that I am still in Stripe test mode.

I’m putting this in the “bug” category but if I’m missing something then feel free to move it elsewhere.

To confirm, have you configured the webhooks in Stripe? That’s the place I would check. From your logs, is your site receiving those webhooks?

I looked at the logs on Stripe for the webhooks and they were all 422 ERR (“No signatures found matching the expected signature for payload”).

I hadn’t entered the discourse subscriptions webhook secret on Discourse!

There are two codes on Stripe’s /test/webhooks/ page. I first tried the one on the top right (beginning we_) but it still got a 422 error. Then I tried the one called “Signing secret” (beginning whsec_, presumably for webhook secret – seems obvious now) and it worked!

Thanks for the help. I’ve moved this to Support.

As an aside, the user (as opposed to the admin) cancelling only cancels auto-renewal, so isn’t meant to remove the user from the group immediately. I found this out by looking at the responses on the webhooks page and experimenting: see Discourse Subscriptions - clarify "Cancel at end of cycle" - #2 by Jonathan5.