#cho_best-practices
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/1228341246179934248
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Sorry , I got cut off:
I am doing the following steps:
- make a setup intent
- create a subscription schedule
- use payment method in setup intent to pay subscription schedule invoice manually
- I await the result and check invoice.status === 'paid'
I modified my code yesterday, but essntially this is what I had
and the else block code never fired, ever, even though we have had payment failures
very peculiar since I expect invoice.status === 'open' when it fails
this is how i fire it
Have you added some logs when you test this?
That way you can see the code path when a payment fails
Outside that
I don't see the log
So you can see the exact path the code takes when invoice payment fails
I don't quite get what you mean
because there was no thing after the else
there was no return statement AFTER the else
because I had the if - else and returns in both typescript let me do that
Wait is invoice.status === 'paid' actually best practice?
because then I'll just have to do some heavy debugging with the logs
๐ฆ
You need to add more logging to figure out what your code is doing
Outside of that else block
So I actually have logs and database audits
Is there an alternative way to check the status of an order so I can try?
What do you mean? Above is how you check an invoice's status. Your code isn't executing the if block, so you need to either comb your existing logs to understand what's happening or improve your logging so you get a better idea