---
title: "Comment by Loïc B on \"Set Up Subscription Payments With Stripe using Firebase and Next.JS\" | Hashnode"
description: "Hi, Congrats, your work is great! If you have some time, I have a question : how is managed the unsubscribing of the premium user? For example, if its credit ca"
url: "https://hashnode.com/posts/set-up-subscription-payments-with-stripe-using-firebase-and-nextjs/60ed3a16573c235ee63a235f/comment/611b88f2ac5c985f3643b85c"
---

[Discussion](https://hashnode.com/posts/set-up-subscription-payments-with-stripe-using-firebase-and-nextjs/60ed3a16573c235ee63a235f)

Comment [Set Up Subscription Payments With Stripe using Firebase and Next.JS](https://hashnode.com/posts/set-up-subscription-payments-with-stripe-using-firebase-and-nextjs/60ed3a16573c235ee63a235f)

[Loïc B](https://hashnode.com/@lbar)

[Aug 17, 2021](https://hashnode.com/posts/set-up-subscription-payments-with-stripe-using-firebase-and-nextjs/60ed3a16573c235ee63a235f/comment/611b88f2ac5c985f3643b85c)

Hi,

Congrats, your work is great!

If you have some time, I have a question : how is managed the unsubscribing of the premium user? For example, if its credit card expires, next payment will be rejected. How your application will be notified and the role attribute "premium" will be removed for the user?

Thanks

[Jarrod Watts](https://hashnode.com/@JarrodWatts)

[Aug 19, 2021](https://hashnode.com/posts/set-up-subscription-payments-with-stripe-using-firebase-and-nextjs/60ed3a16573c235ee63a235f/comment/611b88f2ac5c985f3643b85c#reply-611da742f86ef222fad178bd)

To be completely honest I am not 100% sure how this is handled.

I am hoping that this is handled by Stripe behind the scenes - I will let you know if I find out!

[Kano](https://hashnode.com/@kano0403)

[Oct 30, 2022](https://hashnode.com/posts/set-up-subscription-payments-with-stripe-using-firebase-and-nextjs/60ed3a16573c235ee63a235f/comment/611b88f2ac5c985f3643b85c#reply-635e085479c5fd3f72f400aa)

The cloud functions that add the claim also remove it using the `customer.subscription.updated` event. I just did some experimenting to make sure I understood everything correctly, and that is what I found. Also, if you do a refund make sure to cancel the subscription also, that way it doesn't charge again and they do not keep access (unless you want that of course).
