#Nadiya-subscriptions
1 messages ยท Page 1 of 1 (latest)
hello @torn jewel, i think what you're looking for is https://stripe.com/docs/billing/subscriptions/multiple-products?
you can add multiple products to a subscription which would generate a single invoice and hence PaymentIntent
so, for different billing cycle, is it possible to achieve with a single purchase button?
i saw this, but is it achievable with single card element - button?
i was using the paymentIntent and confirmPayment for single product purchase
Hi @torn jewel I'll take over this thread ๐
You can only associate one subscription in a Checkout Session. So I'd suggest you to create another Checkout Session to manage the other subscription so that you have the flexibility with a different billing cycle.
sorry, then what's the above Screenshot is about?
"Multiple subscriptions for a customer"
This is an example of creating multiple subscriptions, which is not directly related to Stripe Checkout.
Technically Stripe Checkout in subscription mode is just a shortcut for you to create a Subscription + Payment in one flow. If you want to minimize the user actions involved for creating two subscriptions. I've another proposal for you to consider.
- Use Checkout setup mode to create a SetupIntent for a customer, once the SetupIntent is completed and the Payment Method is confirmed (you can listen to the webhook event
setup_intent.succeeded), set this payment method to the customer'sinvoice_settings.default_payment_method(https://stripe.com/docs/api/customers/create#create_customer-invoice_settings-default_payment_method) -> The payment method that the customer setup through this Checkout Session can be reused in the subsequent subscriptions. - Call the Subscription creation API (as shown in the screenshot) to create multiple subscriptions for the user.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
i'm not using stripe checkout
You can use Payment Element with SetupIntent as well.
So you just need to replace the Checkout with Payment Element in Step 1.
sorry, can you please elaborate 2?
i can't use webhook either for some reason
oh was it the continuation of step 1? i thought it was another option
Let me rephrase
- Create a SetupIntent from your backend, and pass the clientSecret to your front-end, and use your existing card element to confirm the setupIntent
- Call the Subscription creation API (as shown in the screenshot) to create multiple subscriptions for the user.
You might want to set the payment method as customer's default payment method in the success callback upon SetupIntent confirmation
in the frontend. However, there's always a possibility that the frontend code might miss the callback (i.e., network issues). I'd strongly recommend you to use webhook to listen to setup_intent.succeeded event, and set this payment method to the customer's invoice_settings.default_payment_method in the webhook event handling.
i see.. understood. Thank you so much for the detailed instruction