#wellthen ๐Ÿ‡ช๐Ÿ‡บ

1 messages ยท Page 1 of 1 (latest)

old peakBOT
warped grove
#

can i just forward the session ID here instead of requesting the session?

#

or would that not work

turbid geyser
#

Hi, taking a look here.

warped grove
#

session.url is generated by the session object?

turbid geyser
#

That is correct, it's the URL to the Checkout Session.

warped grove
#

So I technically have to pass the session ID I have stored through the API?

#

each time an user visits the page

#

or should i store the url in my database instead?

#

that is, should I fetch the URL each time a user visits the payment page using Session::retrieve, or should I store it instead?

turbid geyser
#

You should retrieve the Session

warped grove
#

what are the chances of being rate limited by Stripe if a user sends thousands of requests?

#

should i rate limit or something?

turbid geyser
#

Mm, let me confirm real quick.

warped grove
#

is the URL expected to change during the 24 hours whilst the session is available?

#

testing with the url from the session, I can see that it's not getting randomized each time I call the session

turbid geyser
#

I was able to confirm here, as long as the Checkout expires_at has not reached, then you can reuse that Checkout Session Id so you can store it in your database. However, if the session is expired, then you'd need to create a new Checkout Session.

warped grove
#

Yeah, I'm already storing the session ID, but I'm referring to the session.url here

#

Is it okay to store the session URL instead of retrieving it from the Stripe API each time?

turbid geyser
#

Yes you should be able to, I re-clarified my answer.

warped grove
#

Gotcha. Does expires_at return an unix timestamp?

turbid geyser
#

Yes

warped grove
#

and how long is the url expected to be?

#

i assume it's fine to leave it at 512 characters?

turbid geyser
warped grove
#

uh no i meant the length of the url

#

does it always return a 359 character string

turbid geyser
#

I'm trying to understand the logic behind this question, are you able to add more context into this?

warped grove
#

the session.url returns a url to do the checkout, is it always 359 characters?

turbid geyser
#

I would need to test this, I'm trying to understand what you're trying to do by knowing if the url is always 359 characters.

warped grove
#

store it in the database

turbid geyser
#

The URL length will not always be that length, it will vary. I was able to able to confirm on the API rate limiting part. The recommendation is that you do not store the session.url in your database. Instead, you'd fetch the session id. I know you are worried about the API rate limiting and that as I've mentioned earlier we do have a generous limit. Sorry for the confusion.

warped grove
#

is there any chance that something would go wrong if I do end up storing the session url?

turbid geyser
#

What are you thinking would go wrong?

warped grove
#

perhaps the url changes during the 24 hour session?

turbid geyser
#

I see, that should not be the case.

warped grove
#

thanks very much!