#morteza_api

1 messages ¡ Page 1 of 1 (latest)

grand tundraBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1250795913337897082

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

remote lichen
#

Hi

#

hope you are doing well

#

I'm developing an app in which I need to calculate the balance for issuing cards, but how ? I check the interval in spending limits and then based on that I get authorizations for a day or week or month and calculate amount for approved authorizations

surreal sapphire
#

Hello

remote lichen
#

the point is in the dics it;s said that

#

for a week : Limit applies to a week, starting on Sunday at midnight UTC.

#

if I use moment js' week options then my calculations will be wrong ?

surreal sapphire
#

Yeah the only way to do this is to list out the transactions for an Issuing Card and calculate this on your end

#

There is no API that directly provides this information

remote lichen
#

transacions

#

or authorizations ??

#

in the sample issuing treasury

#

to calculate spend money they have used authorizations which are approved

surreal sapphire
#

Sorry, you are correct, Authorizations

remote lichen
#

ok

#

how can I calculate for a week

#

this is the question

#

if I use moment

#

it doesn't seem to be right

#

because of Limit applies to a week, starting on Sunday at midnight UTC.

#

today.diff(transaction_date, 'week');

#

is this correct

#

considering that Limit applies to a week, starting on Sunday at midnight UTC.

surreal sapphire
#

Our API returns everything in UTC, so yes you need to calculate based on UTC

#

I can't write that code for you

remote lichen
#

ok