Hi,
I’m currently trying out this plugin for future usage on my instance and had an issue.
My Stripe account is new and not verified which means it’s using test data that I can wipe on the Stripe dashboard > Developers.
The issue is that wiping the data on Stripe doesn’t delete the same data on the forum instance. This can result in a crash of the Billing > Payment page of a user.
Step to reproduce
- Create a subscription plan
- Subscribe a user to the plan. Stripe will give him a
customer_id
such ascus_abcd1234567890
- Wipe the data on the Stripe dashboard
- Retry to open the user’s Billing page will result to a crash while loading
/s/user/payment
with the following response text in the web browser console:
{\"errors\":[\"No such customer: 'cus_abcd1234567890'\"]}
After exploring the database of my instance, I can find previous data from multiple wipes I did in the following tables:
-
discourse_subscriptions_customers
: causes a crash for user billing page discourse_subscriptions_products
discourse_subscriptions_subscriptions
The last 2 tables don’t seem to trigger a crash. However, they still contain expired data.
Manually deleting the problematic row(s) in discourse_subscriptions_customers
fixes the crash of the user. But having to do it via SQL request is complicated and dangerous, especially for inexperienced users.
It can be also noted that this issue doesn’t occur when manually deleting the user info from Stripe dashboard. Stripe still keep archived info about him and mark him as “permanently deleted”.
Proposed solutions
If possible, make a way for Stripe to let Discourse know that the test data was wiped, and it should delete the data in those tables.
Or,
In the plugin options, create a button to “wipe the test data” with a big red warning label to make sure the admin knows what he’s doing.