#ben-st-john_code
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/1357816656709292203
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Good question. I'm not sure if there's security implication to cancelling the PaymentIntent from the frontend. Let me poke around abit.
Thanks! Maybe there is a way but I'm not seeing it in the docs https://docs.stripe.com/js/payment_intents/confirm_payment
if there is a simple way to do like this.stripe.cancelPayment({itnent: intentId}) that would be incredible
I know that the PI generation requires the api_key, but the confirming and generation of the payment element only needs the client secret and the publishable key, so maybe it's just a permission thing and Stripe has a security reason to not want client-side cancellation
but also could just be missing something in the docs
I guess the other question is - is there any real benefit to cancelling these payment intents vs just leaving them as uncaptured? Feels like good cleanup to do, but if it's completely unnecessary and not really a benefit to us - I don't want to bog our system down with those cleanup mechanisms
I just doubled checked with a colleague. There's no way to cancel a PaymentIntent via StripeJS. The risk lies in the exposure of the Publishable Key which can be obtained and potentially used maliciously.
One benefit to cancelling the PaymentIntent is this will release any uncaptured funds associated with that PaymentIntent. Once that PaymentIntent is canceled, it can no longer be used to perform charges and the process would have to start over in order to try to collect funds from the end customer.