#neil-Subscription
1 messages · Page 1 of 1 (latest)
Hi there, the easiest way is to use subscription mode Checkout session. Checkout can help you to create the payment method and attach it to the customer/subscription .
Ah well i'm building my own integration, so i'm not using Checkout
Got it. No worries, let me tell you the steps for PaymentElement integration
Since you are offering a free trial, the first invoice doesn't require payment and that's why there's no payment_intent. Instead you should using the pending_setup_intent of the subscription (https://stripe.com/docs/api/subscriptions/object?lang=php#subscription_object-pending_setup_intent) and pass its client_secret to your webpage to render the PaymentElement
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
That's what i have currently implemented. My issue is creating the subscription, getting the pending_setup_intent's client_secret to render the PaymentElement, will give the customer the chance to not fill in the payment form and still have an active subscription
One thought i had was basically create an independent SetupIntent, have the user input PaymentElement, confirm that setup, then create the subscription with free trial after that is successful, and set the default payment method as the one that the user just entered. My only question in this solution would be if it's okay to not use the SetupIntent that is generated by the creation of the subscription with free trial?
That's exactly what free trial is about, your customer can enjoy the subscription without payment or even setting up a payment method.
Yes, it's OK to a seperate SetupIntent to collect the payment method and use it for subscription
Ok. Maybe i'll try that solution then, thanks.
I feel like most services/products require payment method even when setting up a free trial. I mostly want to just avoid having to capture the payment method at a later time
It really depends on your business. You can use SetupIntent to collect the payment method upfront if it meets your business need.
ok great, thanks for confirming that. Appreciate the help!
No problem!