#pain - subscriptions

1 messages ยท Page 1 of 1 (latest)

bold egret
#

Hello! Just starting a thread for you -- I'll review and respond as soon as I can ๐Ÿ™‚

#

thanks, please share details here

jaunty summit
#

Thank you for opening the thread

#

So I am looking at the subscriptions, it can be integrated by using the prebuilt subscription checkout or handling the payment intent myself. Now what I am mainly confused about is how it creates a new customer every time, I have gone through bits of codes in github and everyone does it differently. I was looking at this example https://github.com/stripe-samples/subscription-use-cases/tree/master/fixed-price-subscriptions/

GitHub

Create subscriptions with fixed prices or usage based billing. - subscription-use-cases/fixed-price-subscriptions at master ยท stripe-samples/subscription-use-cases

#

I may be wrong, but am I supposed to create a customer then add a subscription to it?

#

e.g. I have an account system already and wish to integrate subscriptions for various plans (can hold multiple plans at once)

#

Just mainly looking for some guidance of what would be the best course of action to handle this, because when I am using the prebuilt checkout it seems to create a new customer every time.

bold egret
#

Which path are you trying to use?

#

You can use an existing customer in either case, certainly

#

If you already have a customer created, you'd create the subscription manually for that customer

#

if you're using checkout, you'd provide the customer id when creating the session

jaunty summit
#

Oh I see, so I should technically store the customer.id with the user account for reference.

#

But now, what if the user wishes to checkout using different details (maybe a different card under a different name) would I just update the customers data and add the card?

bold egret
#

They can enter new payment/address details at Checkout if they wish, and of course your custom flow is up to you

jaunty summit
#

I see, this makes a lot more sense now. So it's all about creating the customer once and then working with the existing customer/subscription.

#

To handle the subscription payments I would listen to the charge events, correct?

bold egret
#

but if you only use this integration pattern, the charge/payment_intent events can work too

#

Many events are emitted when a subscription renewal payment succeeds, you have to decide which are needed for your business.

jaunty summit
#

Oh I see, makes sense why I saw so many when I logged it out. This information has cleared up a path for me now, thank you for all the clarification, greatly appreciated!

bold egret
#

NP!