#lostuser21_unexpected

1 messages ¡ Page 1 of 1 (latest)

proud coralBOT
#

👋 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/1381622791442530384

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

maiden flame
#

Hi, an you share the invoice id with me please?

heady plover
#

in_1RY5C2IEslhnjuZ2VtRwxGFV

#

its in test mode

maiden flame
#

Where are you looking exactly?

heady plover
#

yeah, it is paid but the moment i made a api request to fetch subscription, the invoice was unpaid and payment intent was succeded

#

it might be there for a single moment, but it was there

maiden flame
heady plover
#

user API was checking subscription status and invoice was open so we wanted to check current state so made a fetch request (webhooks can be missed)

This happened with me again, I thought this was one time issue.

maiden flame
#

No, instead of fetching the subscription, you'd want to listen to the events.

heady plover
#

i make changes through events most of the time,

but if user want to know their current subscription status and subscription is in past_due or incomplete state, i fetch the invoice state. if subscription is active, i don;t fetch it

maiden flame
#

That makes sense, but why are you fetching the subscription right after you create it though?

#

Like that would not work for async payment methods where it takes days for the payment to process for instance

heady plover
#

Becasue i was using ach and payment was in pending state. now in this case, i am also checking if invoice is paid or not, because we want to provide subscription only if payment is done.

so i wanted to check the current invoice state

#

the problem was the moment i fetched the state, the payment and invoice states were transitioning

maiden flame
heady plover
#

Okay, let me see what i can do