I skimmed the forum, tried some searches, and am hoping to get a little more clarity on what I need to do to import an already existing subscription system into Laravel Cashier.
We have a lot of subscribers. So I am going to have to sync them and their data.
We have a couple of products people can subscribe to. 2 different monthly ones, and a yearly one.
I am simply asking for a cliff notes version of what features/methods/classes to utilize to pull this off. I am familiar with Laravel, but not Cashier, and I don't know much about Stripe other than using from the front end lol. I see that Cashier can use the Stripe SDK directly.
What methods/classes am I looking for to fetch the products, and what ones do I need to use to add them into Cashier?
What methods/classes am I looking for to fetch the users and their subscription data, and what ones do I need to add them into Cashier?
Not every user of the system is found in Stripe. Only the paid subscribers are in Stripe. So a person who created a free account isn't found in Stripe, and just is a user of the Wordpress site. So during the loops, I would have to check if they are even in Stripe. - During this data rebuilding, should even the free users have a customer entry in Stripe? They just obviously wouldn't have any subscriptions. Just asking in case it's easier down the line for some case.
Outline of the process:
Products:
- Fetch all products from Stripe
- Add products to Cashier
Users:
- Fetch all the users in chunks of maybe 500
- Foreach user:
- create user
- if found in Stripe, retrieve/import their Stripe subscription (to matching product) data into Cashier
I am hoping someone can tell me the methods/classes I am going to need. Like, "You are going to need the retrieveProducts() method on the X class, loop through them and use insertProduct() to add the product into Cashier. Then for each user, use the findStripeUser() method of the Foo class then use insertUser() method from the Bar class to add them into Cashier".
I am not wanting to mess with any existing subscriptions or invoices or anything. So when adding the data into Cashier, I can't be creating a new subscription or have it sending emails to the users lol. Literally, I am just trying to copy the data. Then with the webhooks, both systems can be in synch until we rip the bandaid off and make the final swap and ditch the Wordpress system.
PS: I know it may be a bit for someone to answer. I noticed other people asking about importing and they didn't get much of a response. So answering the above might help others in the future. Cashier shouldn't be just a system you use from the start or never use it. We have to be able to import an existing setup. I am not asking Cashier to implement an "import" feature, but even if it results in a 3rd party library and/or YouTube tutorials on how to do it, it would help the community and onboarding to Cashier.