#ctodan-subscriptiontrial-ios
1 messages · Page 1 of 1 (latest)
@minor vigil What exactly isn't working?
Like this doc is to accept a one-time payment. If your trial is a "Free trial" with no payment then what you'd do is confirm the SetupIntent on the Subscription, the one in https://stripe.com/docs/api/subscriptions/object#subscription_object-pending_setup_intent
ctodan-subscriptiontrial-ios
ok so right now (with no trial), I return an object that looks like this:
const latestInvoice: Stripe.Invoice = subscription.latest_invoice as Stripe.Invoice
const paymentIntent = latestInvoice.payment_intent as Stripe.PaymentIntent
return {
publishableKey: config.STRIPE_PUBLISHABLE_KEY,
paymentIntentClientSecret: paymentIntent.client_secret,
customerId: customerId,
ephemeralKey: ephemeralKey.secret,
}
if i had a trial, what would i send instead of the payment_intent.client_secret?
You would use the pending_setup_intent property on the Subscription object rather than payment_intent on the Invoice object
ok but then im noticing that if you create the subscription with a trial, it looks like the subscription kind of starts right?
like even if there is no payment attached?
i only want the trial to start really once the user confirms the setup intent
Our subscriptions don't support that behavior directly so to do that you would want to create a separate SetupIntent and only create the Subscription after the setup intent was confirmed
are there any guides for doing that?
Does that mean im basically collecting the customers payment details separately, and then i create the subscription after?
Correct
Stripe subscriptions will start trialing as soon as you make them, there is no configuration to get them to wait. So the idea would be to collect a PM separately and then create the subscription after https://stripe.com/docs/payments/save-and-reuse