#twirtle2_unexpected
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/1369449205323665480
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi! The IDs would be useful. Thanks! ๐
np
pi_3RLg91I9cLlAW5Qr0y13FVR1
pi_3RLjsmI9cLlAW5Qr1zVBAMuc
and here's an example of a successful one that goes through the same flow
pi_3RLu96I9cLlAW5Qr14hs43bp
to add context, looking at the payment flow
await stripe.confirmPayment
check result.error
if no error then perform checkStatus
checkStatus ==> await stripe.retrievePaymentIntent
if the intent status == succeeded then proceed as paid.
at least that's the expected path for the payment methods allowed for these PIs (card). weird that there's nothing in the logs after the PI is created
https://dashboard.stripe.com/payments/pi_3RLg91I9cLlAW5Qr0y13FVR1
They're in the requires_payment_method state which means they didn't a payment method added and didn't complete - possible the person closed their browser, or left the tab, etc.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
hrm nothing else you can see on your end that looks weird (i assume not from the logs)?
Nothing, no. These are essentially just incomplete purchases, or 'abandoned carts'; the user just left the page some time between when you created the Payment Intent and when your client-side code intended to call await stripe.confirmPayment.
hrm ok thanks for confirming, appreciate it. there must be some exception path that i've not considered that allows this to happen
thanks for your time please close
This isn't a code issue, it's a user issue. They are stopping your program before it gets to the confirm step.
You could search for these regularly, and assuming you have an email address for the person, you could follow up - but beyond that, it just happens. ยฏ_(ใ)_/ยฏ
But also you're welcome!
I more meant that from our crm perspective it appears something broken on my end where the user is able to continue as if a transaction occurred when nothing has happened in stripe. Something totally on my end as opposed to stripe, I just wanted to confirm tyty. If you can please close this thread I have different question to ask ๐
It sounds like you might be marking the payment complete in your system before it has actually completed, ya.
You can ask more questions here as well, or you can go back to #help and create a different thread - up to you. ๐
ah, i have a best practice question around billing you happy to keep it here?
That's totally fine, yes. ๐
Appreciate it! So context is that i'm working on a subscription donation flow for a charity. I've got the setup of the subscription all working as expected, however I've been doing some lifecycle testing where the transaction fails and seeing what happens
right now i see what happens after the smart reties is that the invoice is marked as uncollectible which is what we want. However on the next invoice it gets created (draft) however doesn't automatically get attempted. from the docs I've read that when the subscription has an unpaid status the invoice is created but automatic collection is turned off.
With the context of donations we want to keep automatically attempting each cycle until our business logic says to do no more. What's the best way to handle this?
sub_1RLd6rI9cLlAW5QrZOGQr3eM
should i be changing the settings to mark the subscription/invoice as overdue instead? does that keep automatic collection going?
Hi there, could you share an example Subscription Id?
hey sub_1RLd6rI9cLlAW5QrZOGQr3eM
I see. So this is called "Auto advance" and I think your second Invoice.in_1RLepSI9cLlAW5QrPTgF6xBe , after all retries failed, has turned to off and then all Invoice afterwards also has it turned off.
qq, if you advance your latest Invoice in_1RLfPkI9cLlAW5QrewIxSwIN from draft to open, will it auto-attempt for charge?
hrm do you mean advance the time?
or change the invoice status manually?
the invoice is meant to charge at 2:28pm local time, and i pushed out the test clock to 3:30pm so i assume you don't mean the time
Ah I see, it does not finalize also because of auto_advance is off
reading the subscription statues i think if i set the configuration to set the status as past_due (overdue) instead it sounds like it'll continue to auto collect
I'll try this, but i guess my question is should i leave the invoice as uncollectible?
or set the invoice status to overdue as well
Uncollectible is more "peaceful" than "overdue". I would recommend keeping uncollectible
Alternatively, you can explicitly turn on auto_advance on the new Invoice right after its invoice.created event
change its auto_advance property
ok thanks I'll work with that and see if it performs as i need it to
I assume if we're to keep that subscription status to unpaid, i would have to update every invoices as they're created to change the flag though right?
I think just the first Invoice should work. Could you try it? Turn it on then advance the time past the next Invoice as well and inspect its auto_advance?
i think all good, the setting to leave the subscription as overdue seems to be working perfectly
while I have you, again with testing the lifecycle of a subscription.
I want to test someone who successfully pays for a subscription, but subsequently fails due to insufficient funds
is that possible? or is it only possible via the specifc card
if it's not possible, are you able to confirm if I can see that decline code under failure_code or do I have to check the outcome.reason instead?
Yes that 0341 is the exact card you need
Well it's not insufficient decline code, but it will be generic decline
I meant it's the only card which can allow you to success first, then failed later
yep i understand that, but in the event of an insufficient funds (in a real scenario) where would that code appear?
in the docs I can't quite tell where exactly the value insufficient_funds would appear in the charge object
The failure_code which you see card_declined above, it could have insufficient_funds as well. See https://docs.stripe.com/error-codes
Ctrl+F for card_declined or insufficient_funds on this page
ahhh it's under API error codes, ok thanks! I was looking under https://docs.stripe.com/declines/codes
That's under the error object in a response: https://docs.stripe.com/api/errors#errors-decline_code
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
thanks so much for your time, i think i've got all i need for now