#mustapha-checkout

1 messages · Page 1 of 1 (latest)

tardy shell
#

Hi! If I understand correctly, you want to create a Checkout Session with multiple recurring price and different billing periods?

regal nimbus
#

yes thats what i want, i created multiple subscriptions and each subscription gives me client_secret and stripe element accept just one client_secret i don't know how to pass multiple client_secret to stripe element

tardy shell
regal nimbus
#

yes you are right

tardy shell
devout horizon
#

In this scenario, would you create the customer, attach the paymentMethod and then setup 2 subscriptions?

#

What about if the customer also needed o make a one off payment?

#

During the setup of the 2 subscriptions?

regal nimbus
#

i create a customer without paymentmethod and If he chooses more than one subscription, he must pay all subscriptions

timid cradle
#

hmm ok. So first, are you sure you need multiple subscriptions specifically?

regal nimbus
#

the option 1 not work for me because i have different billing period for each subscription

timid cradle
#

would one subscription with multiple products work for you?

#

ok then, no

#

then really what I would do is :

  • write code to calculate the initial cost of all the subscriptions you intend to create
  • create a standalone PaymentIntent for that amount
  • process that payment
  • when that succeeds, create all the subscriptions through the API. Use trial_end so that trial periods are added to skip the first payment of each subscription(to avoid them charging again since you just did the first payment already).
regal nimbus
#

In my case it is the customer who chooses the duration for each subscription

#

but how can i charge the customer for all subscriptions after the payment succeed ??

timid cradle
#

what do you mean by 'charge the customer'?

#

in my example you already charged them

#

i.e you are creating two subscriptions, one for $50 a month and one for $100 a year. You create a PaymentIntent for $150 and charge that upfront now, which "activates" those subscriptions. You then create the two actual subscription objects in Stripe, and use trial periods on each of them to skip the first month, and year, respectively.

regal nimbus
#

i understand now thank you so much for your help