#neil-Subscription

1 messages · Page 1 of 1 (latest)

amber thicket
#

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 .

ashen tiger
#

Ah well i'm building my own integration, so i'm not using Checkout

amber thicket
#

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

ashen tiger
#

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?

amber thicket
#

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

ashen tiger
#

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

amber thicket
#

It really depends on your business. You can use SetupIntent to collect the payment method upfront if it meets your business need.

ashen tiger
#

ok great, thanks for confirming that. Appreciate the help!

amber thicket
#

No problem!