Problem Subscriptions, test mode and billing option

Ok, so I think I’ve fixed it (!)

In summary, using test mode seems to have left artifacts against users who tried test subscriptions, I’m guessing the subscriptions weren’t cancelled in the right or expected way. On switching into production mode, the billing tab errors.

What I’ve tried …

First, don’t take this absolutely literally, I’m mostly guessing based on other posts and these are the commands I used however I might have used literals and had to repeat a few … but this is the general gist;

./launcher enter app
rails c
u = User.find_by_username(<username>)
c = DiscourseSubscriptions::Customer.find_by(user_id: u.id)
subscription = DiscourseSubscriptions::Subscription.where(customer_id: c[:customer_id])
subscription.destroy_all
c.destroy

It seems “subscription.destroy_all” removes hanging external references to Stripe, and “c.destroy” removes the local subscription. Was this Ok, or have I broken something under the hood?

3 Likes