How to cancel a Stripe Plan after subscription period ends?

I have two paid plans: Quarterly and Annually.

If a user subscribes to the Quarterly plan and cancels 1 month in, I want to keep allowing them access for the remaining 2 months of their plan, and then have their access revoked.

The way I have done this is in 3 parts:

  1. A yes/no field in each User data entry called “Active Subscription”.

  2. A yes/no field in each User data entry called “Cancelled Subscription”

  3. A date field called “Plan Renewal Date” that is set via the Stripe.js plugin when a user signs up/their plan renews.

I have a Stripe webhook set up that changes “Cancelled Subscription” to “yes” when a user cancels their Stripe plan.

I have then set up a Recurring Workflow that does the following:

  • Make changes to Current User: “Active Subscription” = “no”
  • ONLY WHEN Current date/time > Current User’s Plan Renewal date AND Current User’s Cancelled Subscription is yes

I then have Workflows set to on page load that redirect to the landing page if Current User’s Active Subscription is “no”.

I am on the Professional Plan, which should have daily recurring workflows working

Unfortunately, this doesn’t seem to work at all; Active Subscription stays on “yes” for all Users.

My guesses as to the problem:

  • Bubble can’t find a “Current User” in Recurring Workflows? I’ve set up “run a search for Users with Cancelled Subscription = yes” but it resolves to a list, not a particular user.

I’m absolutely stumped, have been for weeks. Bubble hasn’t responded to my support request emails so I’m very much hoping one of you might have the answer :pray:

Screenshots of my setup here:

Bumping. Apologies for bumping, but Bubble’s paid email support just keeps telling me to ask this question here instead of helping me via the email support I am paying for. Hopefully someone has come across this problem before and can help out

@jamesdaly, you should be able to manage the bulk of this through Stripe. Set up your subscriptions so they cancel at the end of the subscription period.

When a client cancels their subscription, Stripe will keep it active through the end of their current billing period (month, quarter, year, however you have it set up) and will cancel their subscription when that period is over.

At that point in time, Stripe will fire the subscription cancelled web-hook and you can let it do its work in your app without the constraints of a Renewal Date and a Cancelled Subscription toggle.

1 Like

Hey @eli! Thanks very much for replying :smile:

I thought this as well, this would be ideal. However, I can’t seem to find how to set up my subscriptions so that they cancel at the end of the subscription period.

The customer.subscription.deleted webhook happens immediately, as soon as the user clicks “cancel my plan” and the Stripe.js workflow occurs, and there doesn’t seem to be a subscription.canceled webhook to trigger instead.

Do you happen to have an example workflow set up that shows how a user can cancel their subscription and Stripe keeping it acting through the end of their current billing period?

Thanks in advance, this would be perfect, and it would mean I could get rid of all the mess of my Renewal Date and Cancelled Subscription toggles

(This would be perfect if it still existed in the app: All I want for christmas is to Cancel Stripe Subscription at Period End)

To address you’re concern. Check Stripes documentation for pro rated cancellations.

You can use data events or webhooks to trigger certain actions.

Thanks @nocodeventure, I just read through the documentation for prorated cancellations, but I couldn’t find where it applied in this case, it seemed to deal with refunds based on the amount of time left, unless I’m missing something?

This seems to be what I’m looking for, setting the cancel_at_period_end value to “true”, however not sure how to do this from Bubble’s/Stripe.js’s end:

Use the test version to check your log for what happens when you cancel a plan.

When your app triggers a Stripe action. Stripe creates a log which you can see on the customer tab scroll all the way down. If you study this log you will see which event is triggered and the body content of the event.

It’s hard but once you figure it out it’s a 5 minute job.

This topic was automatically closed after 70 days. New replies are no longer allowed.