#Mr Stinky Pants

1 messages · Page 1 of 1 (latest)

wooden cradleBOT
balmy leaf
#

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

flint void
#

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;
balmy leaf
#

There's only ever be a pending_setup_intent OR latest_invoice.payment_intent

flint void
#

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;

balmy leaf
#

Yep!

flint void
#

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

balmy leaf
#

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

flint void
#

yes cheers