Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tptompkins's avatar

"Always FREE" plan in Spark

Hey guys -

I'm trying to wrap my head around the subscription process and what happens to a user's plan in the following scenario:

  • A FREE plan is configured
  • One or more paid plans are configured
  • All plans have trial days set to 0 (zero)
  1. The user registers for an account and is automatically on the FREE plan
  2. The user visits the Settings -> Subscriptions section, selects a PAID plan, and enters their credit card details to subscribe to the plan
  3. Later the user clicks to cancel their paid plan and Spark displays a message like:
You have cancelled your subscription to the Essentials (Monthly) plan.
The benefits of your subscription will continue until your current billing period ends on September 24th, 2016. 

Resume buttons are also displayed next to each of the paid plans so that the user can resume their subscription.

In the above scenario, what happens after September 24th, 2016? Will the user automatically go back on the FREE plan? At first glance, it appears that the Resume buttons will stay and the last plan that the user was subscribed to will remain assigned to the user but in an "inactive" state. If not, is there a process that will automatically remove the inactive plan from the user?

0 likes
5 replies
duellsy's avatar

To the best of my knowledge, it will behave as you've suggested. In that the user will stay on their current plan, but with it disabled.

Best workaround I can think is a daily(?) task that is run that looks for accounts that have expired, and sets them to the free plan, and emails the account owner to let them know what has happened.

jekinney's avatar

Or hook into stripes web hooks to let your app know a charge has failed and when a plan expired.

Also in the stripe table has an ends at. Could perform a check on login if plan is expired move to free.

I suggest this as you may need to do some data clean up? Easily done on all 3 examples.

tptompkins's avatar

Thanks guys. All those sound like very workable ideas. However, I'm still not exactly sure what route I should go because I'm not entirely sure what is supposed to happen after a subscription ends. Does the subscription record remain inside the subscriptions table or does that get removed by a Spark process? From looking at the SubscriptionCancelled event handler, it appears that the only thing Spark does is set the current_billing_plan to null on the users table and doesn't do anything with the actual subscription record.

It's difficult to simulate this with Stripe because I'm running Homestead so Stripe isn't able to hit any of the normal callbacks for things like when a user cancels a subscription. Maybe I need to ditch Homestead and try getting Valet up and running.

ValsiS's avatar

Hello tptompkins,

I have the same problem as you,

Did you figure out how to have a free plan by default and permanent ?

Thanks

tptompkins's avatar

@ValsiS I haven't had a chance to come back to this yet. I got side tracked with a different portion of my project but will be revisiting this soon.

Please or to participate in this conversation.