# Discourse Subscriptions - user not removed from group when subscription cancelled

**URL:** https://meta.discourse.org/t/discourse-subscriptions-user-not-removed-from-group-when-subscription-cancelled/246478
**Category:** Support
**Tags:** subscriptions
**Created:** [November 22, 2022, 10:01pm UTC](https://meta.discourse.org/t/discourse-subscriptions-user-not-removed-from-group-when-subscription-cancelled/246478 "2022-11-22T22:01:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [November 22, 2022, 10:01pm UTC](https://meta.discourse.org/t/discourse-subscriptions-user-not-removed-from-group-when-subscription-cancelled/246478/1 "2022-11-22T22:01:41Z")

</div>

Continuing the discussion from [Discourse Subscriptions](https://meta.discourse.org/t/discourse-subscriptions/140818):

> [@Discourse Subscriptions Plugin](https://meta.discourse.org/t/discourse-subscriptions-plugin/140818/1):
>
> Add/remove users from plan groups as they subscribe/cancel

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

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [November 22, 2022, 10:11pm UTC](https://meta.discourse.org/t/discourse-subscriptions-user-not-removed-from-group-when-subscription-cancelled/246478/2 "2022-11-22T22:11:06Z")

</div>

> [@Discourse Subscriptions Plugin](https://meta.discourse.org/t/discourse-subscriptions-plugin/140818/1):
>
> 💣 Webhooks are **required to make subscription cancellations work fully.** Be sure you have them configured correctly.

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?

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [November 22, 2022, 10:34pm UTC](https://meta.discourse.org/t/discourse-subscriptions-user-not-removed-from-group-when-subscription-cancelled/246478/3 "2022-11-22T22:34:48Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [November 22, 2022, 10:59pm UTC](https://meta.discourse.org/t/discourse-subscriptions-user-not-removed-from-group-when-subscription-cancelled/246478/4 "2022-11-22T22:59:11Z")

</div>

> [@Jonathan5](#):
>
> 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.

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](https://meta.discourse.org/t/discourse-subscriptions-allow-cancel-at-end-of-cycle/246389/2).

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [December 22, 2022, 11:00pm UTC](https://meta.discourse.org/t/discourse-subscriptions-user-not-removed-from-group-when-subscription-cancelled/246478/5 "2022-12-22T23:00:07Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
