#jesper_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1369046231103311913
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello there
If you want to implement something then you could expire the Checkout Session using https://docs.stripe.com/api/checkout/sessions/expire based on failed payment attempts -- which you would use Webhooks for -- listening for payment_intent.payment_failed.
Otherwise Radar for Fraud Teams would be the recommended way to set up your own protection.
I had a look at payment_intent.payment_failed but ran into issues when trying to obtain the ip address of the user while handling that event.
I was hoping to use something like payment_intent_data.metadata to include the ip address, but since I'm using subscriptions that didn't work
Yeah you would just base this on the PaymentIntent ID itself.
Which is tied to the Session
The IP part you would use on your end in terms of Session creation
Oh I see, that could work
So limit the rate at which new sessions can be created by ip, then expire the session after N failed attempts?
Alright thanks! I'll try that then ๐
Hey sorry got another follow up. Is there an easy way to find the link back to the session id from the payment_intent.payment_failed event? I can't find any useful identifiers in the event other than the customer. But I'm creating the session without a customer so I can't really use that either.
You would list Sessions by PaymentIntent: https://docs.stripe.com/api/checkout/sessions/list#list_checkout_sessions-payment_intent