#ivan26-subscription
1 messages · Page 1 of 1 (latest)
Hi! Yes you can do that by using the pending_setup_intent on the subscription https://stripe.com/docs/api/subscriptions/object#subscription_object-pending_setup_intent
A SetupIntent has a client_secret, that you can use on the frontend with the Payment Element to collect the payment informaiton.
Okayyy thanksssss so much, but this field pending_setup_intent should be filled automatically after I create the trial period subscription??
Yes
Or I need to genereate the setup intent... I don't understand the behaviour
This is done automatically for you (if you are using a free trial)
Yes, the frontend use the pending_setup_intent.client_secret to collect payment information (without doing any charge).
Yes you could create the subscription directly with Checkout Session and with a trial period. This way Checkout will take care of collecting the payment information directly.
Happy to help 🙂
You have two option to set a trial period on a Checkout Session: subscription_data.trial_end and subscription_data.trial_period_days
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-trial_end
perfectlyy perfecttt