#afenster
1 messages · Page 1 of 1 (latest)
I have a BBPOS WISEPOS_E. I am launching it from a .Net API method.
Okay so server-driven integration then?
yes
I use the server to display the amount owed and then call ProcessPaymentIntent()
So then we wait for the customer to swipe a card. When that happens, I want to jump in.
It's possible that we sold out our last ticket while the current user is checking out. If so, I want to stope the process.
Gotcha. I'm nearly positive that a payment_intent.processing webhook won't be sent here. That is only really for async PaymentMethods.
So you have two options
You either wait for terminal.reader.action_succeeded and attempt to cancel any time before that
There are two methods: ProcessPaymentIntent and ProcessPaymentIntentAsync
Or you can poll the API to retrieve the Reader and check its state: https://stripe.com/docs/terminal/payments/collect-payment?terminal-sdk-platform=server-driven#reader-object
Neither of those seems ideal. What do you mean when you say .processing is only for async PaymentMethods?
Like a bank debit
Where it is asynchronous in terms of when the payment is initiated and when it succeeds
Versus a credit card which is synchronous for its success/failure
You should be able to easily test the Events that are emitted though
OK then, a few questions about other events:
If I am doing manual processing (separating confirm and capture), which event occurs after confirm but before capture? Is that payment_intent.amount_capturable_updated?
And if I capture that event in my webhook and discover we're sold out, can I un-confirm or otherwise back out of the payment?
Yep payment_intent.amount_capturable_updated
Sorry
I misunderstood
You are saying if you see that webhook but haven't actually captured the payment yet
?
In that case you can cancel the authorization, yes.
You do this by canceling the PaymentIntent
To make sure I understand:
1- User swipes card and payment is confirmed. That triggers payment_intent.amount_capturable_updated.
2 - I catch that event in my webhook. I look in our database and discover that we're actually sold out. I can just cancel the PaymentIntent? This does not impact the customer? They have no hold on their account?
They do have a hold on their account
But it will then be released if you don't capture the charge
That said, it isn't instant by any means
It is up to the issuing bank for how long they take to remove the authorization from the card holder's statement
Sometimes this can take up to a few days
I got you. So that doesn't sound like a good experience. We tell them we can't make a reservation, but we put a hold on your account. I don't think we'll do that.
Last question, I think: My original question 2 from my first message.
Yep so metadata will get passed to the Webhook
So you can set metadata on the PaymentIntent here
Then it will come through in any of the PaymentIntent webhooks
Is there a way to tell Stripe not to even call us unless X conditions are met?
No that's not how Webhooks work. They will always be sent to your endpoint, but then you dictate how to handle them.
So basically you just always respond with a 200. But then if certain metadata is present you don't action anything
Otherwise you action on your end whatever you want to do
OK. All this was helpful. Thank you very much for your help.