As the Discourse Subscriptions plugin matures I want to start planning for moving my existing memberships from WooCommerce Subscriptions to Discourse Subscriptions. The process below should apply to other WP membership/subscription plugins, not just WooCommerce.
There are three elements of this transition that need to be addressed:
Creating subscriptions in Stripe
Linking the Stripe subscription to the user in Discourse
Reversing SSO so that Discourse becomes the SSO provider and WordPress the client
(1) Creating subscriptions in Stripe
It looks like creating the subscriptions in Stripe for existing users is a manual process at the moment. My members are already in Stripe, so the workflow would look something like this:
Export all subscribers and data from WooCommerce Subscriptions
Create a subscription in Stripe for a user from the customer Stripe dashboard and schedule the first payment to match the expiration date of the existing WooCommerce subscription.
Cancel the user’s subscription in WooCommerce.
Disable WooCommerce Subscriptions when done with all users.
(2) Linking the Stripe subscription to the user in Discourse
Once the user is set up with a subscription in Stripe, how can we add this existing user to a subscription plan in Discourse? This is needed to give the user the ability to cancel the subscription and to remove the user from the group if the Stripe payment fails.
(3) Reversing SSO to use Discourse as provider and WP as client
Yeah this isn’t something the plugin will be able to help with, however, you might be able to use the Stripe API to automate some of this if you have any programming skills. If not, the manual method might be the only way to go.
Just so I’m clear on your problem: you’ve created the subscriptions in Stripe and you want to backfill the access in Discourse? Is that correct?
I think there should be a way to do this via the rake task, but it’s not something I’m going to be able to tackle soon unfortunately. It would be pr-welcome though You’d have to create a DiscourseSubscriptions::Customer record with all the appropriate information and then add the user to the group.
You could even run this manually from console, too:
Yes. This will happen after the steps from (1) are complete, when the customer in Stripe is assigned a new subscription.
The customer exists in Stripe already (in my case) because WooCommerce Subscriptions creates a customer in Stripe with a membership purchase, so the relevant data exists - including the credit card info.
Could this be fed a csv file instead of doing it one by one?
I think this will be a big barrier for anyone with an established membership-based community, therefore we’ll see only new communities taking it up.
Perfect - thanks Justin. I understand and look forward to future developments. I’m planning this as a winter project because it would take a lot of manual steps in any case.
Congratulations, Justin! This is a huge accomplishment! I started playing with it yesterday and can’t wait to start using it. I’ll also start looking at ways to help migration folks from things like WooCommerce. It’s not clear at this point whether it could be a “simple” (ha!) rake task or whether it’lll be more like a forum migration in which every job is a snowflake (I expect it’ll be the latter).
The trick is going to be getting customer information from Stripe into the Customer table in the plugin and matching it up. From there, it’s largely just adding group membership. But you’re probably right in that it’ll be unique each time.
In addition to the email address, Stripe and WooCommerce Subscriptions also share the customer ID: cus_ABCdefxyz and the card ID: src_1234ABxyzasdf and transaction ID: ch_0123ABCDefgh
IIRC PMPro also shares the same.
The way to go in my opinion is to export a table from both apps and confirm they match up in a spreadsheet, then use that csv file as the source.
I’m curious if this ended up working out. I’m looking at helping a customer move from MemberPress and it seems like I’ll need to do something similar. I’d love to learn from anyone who has tried something similar.