#praal_best-practices

1 messages ¡ Page 1 of 1 (latest)

vapid echoBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1401991883022139484

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

chilly hornet
#

To provide more context, before we added free trial, we used the automatic tax calculation on the invoice to present the checkout itemization/totals before they enter their card. If we were to change to creating a SetupIntent not a Subscription at checkout, is there an alternative way to give them a preview of their future charges?

stone rover
#

So I understand correctly, you want to collect the customer's payment details prior to beginning the free trial?

chilly hornet
#

Yes. We only want to activate the trial if they complete checkout providing payment details. But we want to tell them what they will be charged (later) before they enter payment details.

stone rover
chilly hornet
#

So if I understand this correctly we would:

When presenting the checkout page:

  • create a SetupIntent with usage = 'off_session'
  • create InvoicePreview to display future charges/taxes
  • present Elements using SetupIntent's secret

After the customer completes the payment details via Elements:

  • create a subscription w/ trial_period_days and set default_payment_method to the payment method received after the SetupIntent
vapid echoBOT
noble river
#

Hello
That sounds about right but I'd recommend trying it out in a sandbox to make sure this works as expected

chilly hornet
#

Alright. Yeah, we're testing everything in a sandbox first. Thank you very much for pointing me in the right direction