#ahhim_unexpected

1 messages · Page 1 of 1 (latest)

floral frigateBOT
#

👋 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/1395680141539147898

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

proud timber
#

hi there!

#

in the latest API version, the PaymentIntent is no longer included in the Invoice object.

#

what are you trying to do exactly? get the client secret of the PaymentIntent? or get the PaymentIntent itself?

fallen pendant
#

I need the client secret to be exact. Do I not need the payment_intent object to get the client secret?😲

#

Btw thanks for answering!

proud timber
#

got it, and last question: which API version are you using?

fallen pendant
#

I am not exactly sure, but it is probably 12.2.0? As I saw this number stated as folder name. I downloaded it on 30/5/2025. Thanks!

proud timber
fallen pendant
# proud timber also it's expected you don't get a PaymentIntent if you are using a free trial. ...
       subscription = stripe.Subscription.create(             customer=customer_id,             items=[{"price": price_id}],             # collection_method="charge_automatically",             default_payment_method=payment_method_id,             # trial_period_days=trial_days,             # payment_behavior="default_incomplete",  # Use default_incomplete to handle payment authentication             expand=["latest_invoice.payment_intent"]         )  

This is how I define create subscription

proud timber
#

can yuo replace this: expand=["latest_invoice.payment_intent"] with this: expand=["pending_setup_intent"] with this? and the SetupIntent will contain a client secret.

#

since you use a trial, there's nothing to pay upfront. and if there's nothign to pay, as expected there's no PaymentIntent.

fallen pendant
proud timber
#

got it! so in this version, even if you didn't use a free trial, you wouldn't see the PaymentIntent either. you would need to expand latest_invoice.confirmation_secret instead (if you didn't use a free trial) to get the client secret.

fallen pendant
proud timber
#

can you share the Subscription ID (sub_xxx)?

fallen pendant
#

Sure just a sec.

#

sub_1Rm9gSIq5ykFnKUPsauJh9J6

#

Sorry I think I am actually using 2022-11-15 version instead of 2025-06-30 version. Really sorry for the confusion...🙇🏻

proud timber
#

okay. so you actually did use 2025-05-28.basil for that API request. however you didn't set any free trials, so there is an amount to pay on the first invoice!
so in this case there's no pending_setup_intent as expected.

#

instead you need to expand latest_invoice.confirmation_secret

fallen pendant
proud timber
fallen pendant
fallen pendant
proud timber
#

looks like you are usingthe stripe-pythong SDK version 12.2.x, which automatically set the API version to the latest version for you.

fallen pendant
#

Does this kind of changes (e.g. payment intent no longer exist under invoice) happen often? Since I plan to use it in production environment, changes like this could break the code 🤔 Is it possible for me to just keep using the same version?

proud timber
fallen pendant
#

so if I don't update my SDK, it should stay the same version even for the API, right?

proud timber
#

yes

fallen pendant
#

Thanks!

#

last question, I also want to deal with payment that require extra authenication as well. I believe I will have to return a property called "next_action" under payment_intent is legacy version, I am guessing this has been changed as well. May I ask where would it be in version 2025-05-28.basil?

proud timber
fallen pendant
#

Got it! Thanks a lot! You really are a life saver!🥹

floral frigateBOT
robust wasp
#

Hey, taking over here. Let me know if there's any follow-up Qs I can answer!

fallen pendant
#

Thanks! I am not very familiar with the latest version that I am using (as most documentation I read are for the legacy version). I would like to ask is there extra steps that are required for 3DS required cards? Soma mentioned that I do not have to do anything but how exactly does it work? Thanks in advance for answering!

robust wasp
#

You call confirmPayment via Stripe.js on the frontend and that initialises the 3Ds/auth flow if required

#

Thst's it, basically