We are currently using Stripe (via WordPress plug-in) to obtain credit card info for subscription payments for our SaaS app. Now we're going to add the option of a free trial without a credit card. Currently, when a user signs up, Stripe kicks off the account creation in our application db and in Auth0. We want to keep Stripe as step 1 in our process by using a simple form to push their name, email, and trial end date (without a payment method) to Stripe, and then desire to present them with a form in the app to supply their credit card when the free trial expires.
I've seen many products that let you sign-up for a free trial and add a payment method in the app (not via Stripe email or portal) when the trial expires, but our developers can't figure it out. I know we could email the user an invoice via the Stripe webhook after the trial expires, but would strongly prefer to have them enter info in the app. It seems like this should be simple - we know the user, can obtain their subscription ID from Stripe, and simply need to add a payment method for the recurring monthly payment. After hours of searching we've come up empty handed.
Can anyone guide me to documentation or code samples that provide this? Between my developers and I, we've spent hours search for answers and have come up empty handed. Seems like this should be easy to do. Thanks for your help!
Assuming you've created the subscription with a trial for the customer, you would want to listen for the invoice.upcoming
event [0] and check if the subscription has default_payment_method
or the customer has invoice_settings.default_payment_method
set.
Then follow https://stripe.com/docs/payments/save-and-reuse
To save a payment_method to the customer and set customer.invoice_settings.default_payment_method
[1].
If you want to collect payment details using the IOS/Android SDK, this would serve as a good reference : https://stripe.com/docs/payments/integration-builder
[0]https://stripe.com/docs/api/events/types#event_types-invoice.upcoming [1]https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method