#wellthen ๐Ÿ‡ช๐Ÿ‡บ

1 messages ยท Page 1 of 1 (latest)

foggy groveBOT
unkempt pebble
#

Hi, taking a look here

cold mirage
unkempt pebble
cold mirage
#

I think it's perhaps better to save it and then check it every time, given that a user can refresh the page multiple times to generate practically unlimited sessions. Does Stripe have an API limitation?

#

I assume they can also request the Stripe checkout using the same session id multiple times, that should rate limit them, not my website, correct?

unkempt pebble
#

I do not understand the second question, can you elaborate please?

cold mirage
#

If a user visits the website and presses the payment button, I'd have to check with the Stripe API to see if the session is valid or not, and whether to generate a new session.

#

Theoretically, the user could click the button many times, with automated tools.

#

I assume that would lead to a lot of API calls

#

would something like recaptcha be advisable?

unkempt pebble
#

You'd want to cache or something like that on your end. When the user comes back, you just use the existing session.

cold mirage
#

yeah, but if the session becomes invalid in the meantime, how would I know it's invalid instead of checking with the API?

#

should i just cache one session id per 24 hours and hope it doesn't somehow get invalidated?

#

can the webhooks be used to monitor whether the session becomes invalid?

unkempt pebble
cold mirage
#

does that get returned via webhook each time it gets completed/failed?

unkempt pebble
#

Yes, the status is included with each Checkout Session.

cold mirage
#

oh cool, so I can save one session ID and then keep it as active until I get webhook information that it's not valid anymore?

#

i assume it also returns that after 24 hours

unkempt pebble
#

Yes, that is correct

cold mirage
#

got it, thanks!

#

with regards to the webhooks, if the website is down, does the API retry sending requests after a while, and are there any known issues with CDNs like Cloudflare blocking requests?

#

i assume I should whitelist these IP addresses?

unkempt pebble
cold mirage
#

ah great

#

do you believe it's enough to rely on webhooks to check if transactions are completed?

unkempt pebble
cold mirage
#

i'm assuming if I use that I don't have to check whether the IP comes from Stripe?

unkempt pebble
cold mirage
#

Thanks, seems understandable, will come back if I need additional info.