#mr-stinky-pants_api
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/1480564653015826534
๐ 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.
- mr-stinky-pants_api, 55 minutes ago, 19 messages
- mr-stinky-pants_api, 4 days ago, 80 messages
hi this is carrying on from https://discord.com/channels/841573134531821608/1480534897251717242
Hello ๐ taking a look!
basically trying to do something on these lines
// Check if 3DS authentication is needed
if (subscription.Status == "incomplete")
{
var secret = hasTrial ? subscription.PendingSetupIntent.ClientSecret : subscription.LatestInvoice.ConfirmationSecret.ClientSecret;
Are you creating or retrieving the subscription before this? And are you properly expanding the necessary fields on the subscription? Like subscriptionOptions.AddExpand("latest_invoice.confirmation_secret");
that might be it, ai is saying its designed for your hosted payment pages
yes just created the subscription at this time
your right it needs expanding ๐คช
my only other problem is i cant get a payment intent when subscription starts now to check its status if it needs 3ds
if theres a trial i can use subscription.PendingSetupIntent.status
but stripe makes its own payment intent if subscription has no trial
I'm glad expanding solved your first issue!
So you're trying to get the payment intent from the latest invoice of the subscription?
yes but youcant get it through invoice anymore
no paymentintent on invoice
you can see it in dashboard
this is in c# latest api
I see! You should be able to inspect latest_invoice.payments to see all PaymentIntents, these docs should help: https://docs.stripe.com/changelog/basil/2025-03-31/add-support-for-multiple-partial-payments-on-invoices#inspect-the-array-for-payment-information
right i did not see this page
sadly its saying This property cannot be expanded (payments). and payments is null
ignore that, i need to expand invoice first
Nice, hope this helps ๐ค
is the idea meant to be just get the first payment in the list?
Very likely yes, that should be the latest one, though it depends a bit on what you are trying to do. What is your overall goal in retrieving this data?
i think it should be just 1 as ive just made a new subscription
i guess this will work for with or without trial? subscription.LatestInvoice.Payments.Data[0].Status
That list will be empty for trialing subscriptions, so for that I think you will still want to just check the subscription's status
hows this then
if (subscription.Status == "incomplete")
{
string status = null;
if (hasTrial)
{
status = subscription.PendingSetupIntent.Status;
}
else
{
var payment = subscription.LatestInvoice.Payments.Data[0];
var paymentIntentService = new PaymentIntentService();
var paymentIntent = paymentIntentService.Get(payment.Payment.PaymentIntentId);
status = paymentIntent.Status;
}
if (status != null && status == "requires_action")
{
}
Ah so the goal is to check if the subscription's intent requires 3DS to complete in both modes? That makes sense as a way to do it to me
just testing that 4242 card and its wanting requires_confirmation
are we still using stripe.confirmSetup on the client for the no trial flow?
or do you have to use - stripe.confirmCardPayment(clientSecret) in that case
To confirm a payment intent you would need to use confirmPayment or confirmCardPayment
Correct, trials will use setup intents, payments will use payment intents. And no one function covers confirming both so you would need to dynamically chose the right method to call