#Mr Stinky Pants
1 messages · Page 1 of 1 (latest)
The created Subscription would return a Setup Intent object if there was no initial payment (i.e. free trial), via pending_setup_intent field. You can then use that with Elements to collect payment details for the future payments
so you would change it here to setup:
subscriptionOptions.AddExpand("latest_invoice.payment_intent");
SubscriptionService subscriptionService = new SubscriptionService();
Subscription subscription = subscriptionService.Create(subscriptionOptions);
ClientSecret = subscription.LatestInvoice.PaymentIntent.ClientSecret;
Yep, you'd want to expand this field too: https://stripe.com/docs/api/subscriptions/object#subscription_object-pending_setup_intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
There's only ever be a pending_setup_intent OR latest_invoice.payment_intent
so i only need this really, not latest invoice?
subscriptionOptions.AddExpand("pending_setup_intent");
i guess that invoice will be 0 anyway
and then this ClientSecret = subscription.PendingSetupIntent.ClientSecret;
Yep!
cheers
do you know this trial_period_days does it go to 12am on that day?
I find it a bit weird i get subscription payment emails through the day
I believe its the current timestamp plus n days
Should be easy enough to test
If you wanted to fix it to a specific timestamp, use trial_end instead
yes cheers