#wellthen-validate-before-payment
1 messages · Page 1 of 1 (latest)
wellthen-validate-before-payment
Hey @quasi drift it depends a lot on your integration and which product(s) you use. We don't really have "inventory management"
what most businesses do like airlines and ticketmaster is that they "hold" the items for X minutes
I can't get an intent via webhooks which allow me to approve/deny the transaction?
that could mean many different things but not really
again depends a lot on the exact product(s) you are using: Checkout, PaymentElement, Subscriptions, etc. If you provide more details I can help
i believe i'm using checkout
then no that is not something we support today unfortunately
Sorry if I'm intruding, I don't know if you do this today but you can create an payment Intent by stripe.paymentIntents.create(paymentOptions), store your Payment Intent ID and after all your checks you can just confirm, with stripe.paymentIntents.confirm(paymentIntentID, options)
what'd you advise to use instead?
looking at this but not sure what it's referencing https://stripe.com/docs/refunds#cancel-payment
There isn't really an easy way to do this. What you can do is use short lived Checkout Sessions for example and "hold" the ticket until that session expiration
so would you advise simply refunding the user if it's not possible to complete their transaction?
it depends on a lot of factors, for example if you refund you lose our fee (we don't give it back) so that could be costly
Alternatively you could not use Checkout at all, build your own integration and before confirming the payment you can check with your server whether the inventory is still available or not
oh, i think i misunderstood what checkout is
following that integration guide for example
i am integrating stripe over PHP
that doesn't really say much, everything can be integrated in PHP, including Checkout
well it's only a small part of the code but based on the parameters yes
right, i already do checks on my backend before the user clicks the pay button on whether the seats are available, but I can't do anything while they're at this screen
correct you can't, that's what I explained earlier, if you use Checkout that is impossible, you do the check before redirecting them to that page
and there's no way to hold the funds after they finish that part?
not sure what that means
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-expires_at you can control the expiration of that Session but the minimum is 30 minutes
user enters their details -> stripe waits for my server to respond on whether to approve the transaction
then no. Sorry I've said a few times this is impossible
hm, the alternative is doing my own form and not going through checkout.stripe.com?
yes
i assume that's more risky security wise
no it's not more risky security wise. But it's more work to implement
I'd recommend going through our main doc I shared above to get a feel for it
I'd have to send requests with the credit card information to Stripe, right?
oh, seems to be done locally via JS
correct
reading it now, based on what I've understood so far, I can have a button on my website which sends the data to Stripe. When users click the button, I can do a server side check before I send it to Stripe?
yes
i believe there's a chance that the user will still get redirected (3DS, Klarna)?
or does it open a new window and wait for a success response for that?
yes they can still be redirected, there's no way to prevent that really
there will always be a risk of race condition, anyone in your situation would build a way to "hold" tickets for a while and handle double payments and such after the fact
can you elaborate on holding tickets?
i find it kind of weird Stripe doesn't have fund holding, when I purchase something from the internet, the funds are usually "on hold" by my bank until the owner claims it
I mean we do have that, it doesn't really change that much
you're still holding the funds, still a really poorexperience for the customer
correct, but i'm not seeing a way how I can avoid the issue
I did explain how to avoid the issue
also "funds hold" doesn't work with most payment methods in the world
like sure it works with card, but not most
but https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-capture_method is what you are after maybe
i don't really understand what you mean by ticket holding
reserve the tickets before the customer makes a payment?
if you ever bought airline tickets or tickets on ticketmaster, there's a waiting list, and a countdown like you have X minutes to pay
that's what most companies do at least to hold inventory
what you can also do is track all the Checkout Sessions and cancel everything once the whole inventory has been sold
this does indeed sound like a better solution, just didn't want to do it because people can enter fake forms and reserve the seats
with the fund holding option, does stripe still take the fees?
it doesn't in that case
correct