#thelittlewozniak-sub-trial-payment-details
1 messages · Page 1 of 1 (latest)
Hey there!
How are you currently integrating? Your own custom flow with Elements?
Yup that's it !
I retrieve when the subscription is created a payment intent and with that, I send it to my front to a payment element
Yeah so the way you're creating subscriptions permits doing so without collecting a payment method. And, as you pointed out, in most cases there's no initial payment due (as they're within the free tier).
This is all perfectly normal. What you're going to need to do is adjust your integration to collect payment details before/at the time of when the users decides to upgrade their usage beyond the free tier (and at the point payment becomes due)
Can you share a sub_xxx ID?
Yep so there's no default payment method on either the Subscription or the related Customer object
Yes
2 options:
- Build your own payment UI to collect payment details using Stripe.js/Payment Element. This is outlined here: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#collect-payment
- Use the customer portal, which is a low-code integration path, to enable the user to add a payment method: https://stripe.com/docs/billing/subscriptions/integrating-customer-portal
Yes, I already use Payment Element when the subscription is created and it's not free
and It returns client secret to pass it to the payment element
Got it. In that case you just want to implement that same approach, but somewhere in your application logic before they upgrade
Or during the upgrade process
'You're upgrading today to X and it'll cost $Y p/m. Please provide payment details'
The first link I shared there can be adapted to fit your update flow
okay, so I need to retrieve first the details of the user without a client secret to add them inside stripe and after that, I will be able to make that
- They click upgrade
- You present the upgrade details (via invoice preview)
- Update the subscription which will create a new invoice with associated PI if payment is due
- Collect payment details with Payment Element and confirm the PI on the invoice following the upgrade
Yes, but how I receive the client secret for the payment element?
Update the subscription which will create a new invoice with associated PI if payment is due
okay thank you i will check for that!