#ctodan-subscriptiontrial-ios

1 messages · Page 1 of 1 (latest)

keen gateBOT
languid zealot
#

@minor vigil What exactly isn't working?

keen gateBOT
languid zealot
#

ctodan-subscriptiontrial-ios

minor vigil
#

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?

daring phoenix
#

You would use the pending_setup_intent property on the Subscription object rather than payment_intent on the Invoice object

minor vigil
#

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

daring phoenix
#

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

minor vigil
#

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?

daring phoenix
#

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

minor vigil
#

I see, are you able to use that same front end PaymentSheet for this?

#

or do we need to implement our own UI to collect the card details?