#rafal-subscriptions
1 messages · Page 1 of 1 (latest)
@opal garden hi! If it's for a trial, you would create a Subscription, it doesn't need a payment method. As you mention, there is a pending_setup_intent returned on that object that you can use in a payment form to then add a payment method to the customer for the subscription.
It can be a bit weird yes since you create the Subscription upfront and then ask for the payment details but that's how it's designed. You don't have to do it that way though, you could manually create a SetupIntent and have the customer enter their info, and then after that completes, create the subscription on the backend, that's totally an option as well.
Overall my answer would be quite simply : just use Checkout, it sets everything up properly for you and it supports trials. https://stripe.com/docs/billing/subscriptions/checkout
Thank you for answer.
I thought about creating SetupIntet manually, could you give me any advice or link to documentation on how to implement this flow?
And what about "pending_setup_intent" on the subscription, if I create SetupIntent manually, there will be no duplicates of the object?
it won't create a pending_setup_intent if there's already an attached payment method that was set up
there isn't a full document for the exact flow no
can I ask why you don't use Checkout?
but basically :
- it's https://stripe.com/docs/payments/save-and-reuse?platform=web to create and complete the SetupIntent
- create the Subscription directly in the API, and also you need to pass either https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method or set https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method so that the method from the SetupIntent is used for future payments on the Subscription
sure, we don't use the Checkout form because checkout is redirected to an external stripe URL and we are not able to put it on the iframe.
We would like to keep our web URL
fair enough! it does add a lot of development work and maintenance to build this yourself, but is it possible! hopefully the above helps