#jscripts_3ds-onsession
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/1271207347280281662
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐ what does "my purchases are no longer going through" mean? Can you share IDs of example payments or requests that show the behvaior you're referring to? Are you able to reproduce this same behavior in testmode, or is it only for livemode transactions?
const paymentIntent = await stripe.paymentIntents.update(
finalizedInvoice.payment_intent.id,
{
setup_future_usage: "on_session",
description: description,
}
);
they are all getting marked incomplete
with a 400 error on stripe
Error message
"message": "A setup_future_usage value of on_session cannot be used with one or more of the values you specified in payment_method_types. Please remove setup_future_usage or remove these types from payment_method_types: [link]."
"type": "invalid_request_error"
payment id of a failed one: pi_3PlapUHCa9cmCqg61eJka1Sj
yes it is working on test mode, just seeing this on production
jscripts_3ds-onsession
@unreal saffron so it's not about "going through" right? It's you trying to explicitly update the PaymentIntent after the fact?
i do it like this:
const finalizedInvoice = await stripe.invoices.finalizeInvoice(invoice.id, {
expand: ["payment_intent"],
});
const paymentIntent = await stripe.paymentIntents.update(
finalizedInvoice.payment_intent.id,
{
setup_future_usage: "on_session",
description: description,
}
);
okay so you are trying to change the PaymentIntent of an Invoice specifically? And you're saying it works fine in Test mode but not Live mode?
yes and yes
Do you have an example request where it worked before so I can compare?
are you asking for a paymentId where it worked?
sure
the perfect thing would be the exact req_123 for the really specific API Request that changed this value. Like for the 400, it's much easier if you share that information
But I can figure it out with just the pi_123
for one of the 400 responses i have this: https://dashboard.stripe.com/logs/req_Vr6InzqYBQFZ8V?t=1722780683, is req_Vr6InzqYBQFZ8V the right request id for that?
i dont see req_id on the body
august 3rd they all started failing
Do you know if you just turned on Link maybe? I see the PaymentIntent from Aug 1st had card/cashapp and the new one has card/cashapp/link and Link doesn't support on session
link is on in both our test mode and prod mode, and its working on test mode. were using the payment element and dont show link as an option
Do you have an example in Test mode where it works so I can compare?
that one doesn't have Link
but in my settings, link is on?
so I think that's your root cause honestly
Invoices + payment_method_types can be really painful to debug unfortunately but I'm fairly confident Link here is the issue
Why are you passing setup_future_usage: 'on_session' instead of off_session specifically?
Can you try off_session and see if the update works? That'll confirm if my intuition is correct
one difference we see, is that on prod for link -> custom rules, link is only on for stripe checkout and payment request button
but on dev/test mode, its on for all 5: stripe checkout, payment element, express checkout element, card element, payment request button
ah gotcha wait you're looking entirely in the wrong place
Link for Invoices is configured in a completely different part of the Dashboard. It's in the middle of https://dashboard.stripe.com/settings/billing/invoice
that's what I see on my account. I have a feeling you have Link on there and you likely turned it on recently. Can you confirm that?
it is on, but we did not turn it on recently. we think we turned it on a few months ago
that seems unlikely since the previous PaymentIntent you mentioned didn't have Link
agreed. this is my client, so honestly, i have no idea, just asking him and relaying lol
Sorry this can be really tough to debug ๐ฆ
But I think that is why you're suddenly getting errors too.
on my test mode, this setting is grayed out- is this not an option on test mode?
was trying to see if it matched there
Settings that affect live integration are disabled, but can be edited in live mode.
or i guess test mode just mirrors live mode for this settings?
and link IS OFF on this account (seperate account, seperate test mode account)
Looking at the logs I do not see them change the settings in the past week so you might be right.
so i can confirm thats different between the 2 now that im looking at the right settings
Sorry this is just so problematic to debug but I am fairly confident Link is the cause.
makes sense
Link does not support "on session reuse" so we error if you try. I think you would get away with just passing setup_future_usage: 'off_session' and that should solve the problem
does off_session work with Link?
yes
I'd still recommend writing to our support team. It's a weird "failure mode" to error like this and it's so hard for you to plan ahead of time.
In theory we should be removing Link from the list of payment_method_types instead but it's because you use Invoice and that forces a certain set of values. I don't want to go too deep into this, it's something we do want to fix. But I had never seen someone hit an error like yours
i can confirm that on prod now that turned off link in invoices like you said, it is working again- first successufl purchase weve had since the 3rd
and i will switch to off_session if they want to support link
and yeah ill report that to support team too
Spunds good. I'm glad that unblocked you. It sucks to have you turn off Link since it's such a useful feature (but I'm biased I work for Stripe lol) but that might be the easiest
Note: this will not retroactively apply to previous Invoices already finalized.
What you could do is pass payment_method_types otherwise and remove link from the list. That should work
i pass payment_method_types on the stripe element:
<Elements
stripe={stripePromise}
options={{
mode: "payment",
amount: 4700,
currency: "usd",
payment_method_types: ["card"],
setup_future_usage: "on_session",
}}
>
is there another spot to pass that too, or is that what you mean
all we display/use is card currently
Right now you are calling the Update PaymentIntent API server-side to force setup_future_usage because an Invoice will not have it set by default (which is the bane of my existence, it confuses sooooo many people, but I digress)
The problem is that when you pass setup_future_usage, we validate that it's compatible with all values in payment_method_types. And right now it errors because one of those (Link) is incompatible.
What you can do is update both setup_future_usage and payment_method_types
gotcha, i didnt realize this was here https://docs.stripe.com/api/payment_intents/update#update_payment_intent-payment_method_types
ok perfect, that gives me multiple workarounds/next steps
thank you thank you, you've helped me like 5 times this year so far lol
That's what I'm here for so I'm glad we got you to the right place quickly.