#ranger_subscription-trial
1 messages ¡ Page 1 of 1 (latest)
đ 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/1280553738943070211
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- rangermillze_code, 4 days ago, 65 messages
ranger_subscription-trial
@hot cradle If you start a Subscription with a trial period then there's nothing to pay upfront so the first Invoice is for $0 so it does not have an associated PaymentIntent pi_12345 at all. That's likely why it tells you the client_secret is invalid (there's none).
What you want is to look at the SetupIntent we created for you instead in pending_setup_intent as it lets you collect payment method details upfront without a payment.
So change 'expand' => ['latest_invoice.payment_intent'], to expand' => ['latest_invoice.payment_intent', 'pending_setup_intent'], to also get the SetupIntent if any
And then in your code check if there is a PaymentIntent on your Invoice and if there isn't you want the client_secret of the SetupIntent in pending_setup_intent