I am having some issues currently wrapping my head around the process of adding a customer to a plan.
A very broad idea of the payment type is to think Twitch Streaming. You can follow users for free but pay a small fee to "subscribe" to them.
Currently, when the user fills out the payment form, i create a source in the frontend through react-stripe-elements and then pass the source.id to my backend.
This is where things start to fall apart for me.
- Should I create a different product per user so I can very easily view from the stripe dashboard which user/product is doing the best?
A way to go about this is when a user creates an account, my backend automatically creates a product for that specific user as well as a plan and then store the plan_id into the user model.
So when a user subscribes to another user, I can pull out the plan_id and create the subscription that way.
- Currently, I create a source whenever a user submits the payment form.
let attach_source = async ( customer_id, source_id ) => {
await stripe.customers.createSource( customer_id, {
source: source_id
} )
}
Do I check if an error happened and see if the error is duplicate source? Or does Stripe take care of everything.
- I am also curious how Stripe handles multiple subscriptions on the same customer from different credit cards. I don't see anywhere that states that a subscription takes from a specific source.
Thank you for taking your time to read this. Appreciate the help!