#Miloszex

1 messages · Page 1 of 1 (latest)

lament juniperBOT
gentle furnace
#

not sure what you mean by "need to take somehow time of stripe server"

viral pewter
#

I need to pass unix timestamp right?

gentle furnace
#

expires_at is just a unix timestamp in UTC yes

viral pewter
#

in UTC okay

#

great

#

thanks

#

and one more question When the session will expire will I be notified on webhook with event "checkout.session.expired" ?

gentle furnace
#

I think so, I suppose you can test it quickly by setting an expires_at now in a test and seeing if you get an event in 30 minutes

viral pewter
#

thanks 🙂

lament juniperBOT
viral pewter
#

hmm still have problem with it im generating timestamp

like
int(time.mktime(((datetime.datetime.utcnow() + datetime.timedelta(seconds=30)).timetuple())))

and it returns me
1686558603

#

it is wrong format?

#

stripe.error.InvalidRequestError: Request req_lpBuBeyY43HbAK: Invalid timestamp: must be an integer Unix timestamp in the future.

storm geode
#

Seems like a valid timestamp, but it's in the past. Your logic is likely wrong

viral pewter
#

hm

#

strange because im taking utcnow time and even if I add 30 minutes to this its till wrong . So what time should i take? not UTC?

storm geode
#

Yes, it needs to be UTC. Not really familiar with what library you're using there but clearly not working as you expect