#mr-stinky-pants_api

1 messages ยท Page 1 of 1 (latest)

regal vineBOT
#

๐Ÿ‘‹ 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.

stable bison
lost sequoia
#

Hello ๐Ÿ™‚ taking a look!

stable bison
#

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;

lost sequoia
#

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");

stable bison
#

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

lost sequoia
#

I'm glad expanding solved your first issue!

#

So you're trying to get the payment intent from the latest invoice of the subscription?

stable bison
#

yes but youcant get it through invoice anymore

#

no paymentintent on invoice

#

you can see it in dashboard

#

this is in c# latest api

lost sequoia
regal vineBOT
stable bison
#

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

lost sequoia
#

Nice, hope this helps ๐Ÿคž

stable bison
#

is the idea meant to be just get the first payment in the list?

lean dirge
#

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?

stable bison
#

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

lean dirge
#

That list will be empty for trialing subscriptions, so for that I think you will still want to just check the subscription's status

stable bison
#

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")
   {

   }
lean dirge
#

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

stable bison
#

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

lean dirge
#

To confirm a payment intent you would need to use confirmPayment or confirmCardPayment

stable bison
#

but it could also be a setup intent if has a trial

#

theres not 1 function for both?

lean dirge
#

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

stable bison
#

im using the ai on stripe and it says this: If the invoice has a ConfirmationSecret, it means customer action is required, and you should pass this to the client without needing to check individual payments.

#

if thats right you dont need to go checking all these payment status etc?