#bwurtz999

1 messages ยท Page 1 of 1 (latest)

ivory veldtBOT
celest abyss
verbal willow
#

I believe it's between step 2 (process the PI) and step 3 (verify the reader state)

#

It's a simple POS app. Items are added to the cart. When the customer is ready, the cashier hits a button that triggers the creation of the payment intent and processPaymentIntent

#

I then return the PI to the app. But what keeps happening is the reader accepts payment and shows the check mark but my app hasn't received the PI response yet

#

So it just gets stuck hanging there waiting for payment

#

even though it's already gone through

#

and if the cashier wants to clear the order and start over I have no way to check if the payment has been made because I have no PI to check

celest abyss
#

Which method do you use to verify reader state

verbal willow
#

I use webhooks as a direct means and then the payment intent itself as a back up

#

That process works. And with a solid internet connection I don't have any issues

celest abyss
#

Gotcha

verbal willow
#

But with poor service/delays I'm running into problems

celest abyss
#

But in your scenario with a poor internet connection, do you not receive the webhook events?

#

Or it's just a delay?

verbal willow
#

My server receives them fine. It's the communication back to my app that's causing the issue

#

yes the delay

#
return response()->json([
            'payment_intent_id' => $paymentIntent->id,
        ], 200);
#

This is all I send back after calling processPaymentIntent

#

So I don't think I can make the response any smaller

#

In case that might be the issue

#

So I guess I'm wondering why the reader can communicate so much faster than my app. Are the requests significantly smaller than what I'm sending?

#

I guess I could create the payment intent after the first item is added and then update it after each additional item. But I'd like to try and avoid that if possible because it slows everything down

#

But then I guess I could at least check if the payment intent has succeeded before the cashier tries to clear the order

#

Is there some best practice I'm missing here?

celest abyss
#

Hm I don't think so. Let me try to pull in a colleague with more terminal experience though to see if they have any suggestions for poor network connection

verbal willow
#

Great thank you

celest abyss
#

My colleague said that for the most part you'll just need a better network connection. However, there is something you might can try:

https://stripe.com/docs/terminal/payments/collect-payment?terminal-sdk-platform=server-driven#stripe-api

They can try polling the reader status too
https://stripe.com/docs/terminal/payments/collect-payment?terminal-sdk-platform=server-driven#reader-object```
verbal willow
#

Hmm ok

#

But what would I be looking for when checking the terminal status?

#

So let's say a customer adds one item to the cart, quickly presses the 'Checkout' button, and then taps their card, all before my app can get a response back from my update-cart POST

#

The app is showing a screen saying 'Awaiting Payment' because it hasn't received a response yet

#

There is also a 'Cancel' button

#

When the cashier clicks that cancel button, what reader state should I be looking for to indicate that a payment was made?

#

Succeeded?

#

After a payment it just goes back to the default Stripe screen

#

How long does that 'succeeded' state last for?

verbal willow
dense sonnet
verbal willow
#

Ok great

#

And will that also give me the payment intent that was successful?

#

So I can check that the total is correct for verification?

dense sonnet
#

Yup you can check the PaymentIntent status as well as the reader's action.status to make sure the payment succeeded

verbal willow
#

But how would I know the payment intent?

#

The docs seem to indicate that polling the reader doesn't give me the payment intent. Just the status

#

Basically I'm trying to verify that before I go ahead and cancel an order, that the order actually went through

dense sonnet
#

Right, you'd have to keep a track of the PaymentIntent ID from the earlier steps
https://stripe.com/docs/terminal/payments/collect-payment?terminal-sdk-platform=server-driven#process-payment

When someone clicks "checkout" on your POS, you're basically creating a payment intent server-side and processing the payment. You can share the PaymentIntent ID to your POS app and then add a button to fetch payment status which then polls the API for the PaymentIntent status

Prepare your application and backend to collect payments using Stripe Terminal.

verbal willow
#

Right, this is the problem I'm facing with poor cell service:

So let's say a customer adds one item to the cart, quickly presses the 'Checkout' button, and then taps their card, all before my app can get a response back from my update-cart POST

#

Then I have no payment intent to check

#

Does that make sense?

dense sonnet
#

Ah I see. Yeah that's a tricky one

verbal willow
#

Oh I guess I could create a payment intent when the order is started (empty cart)

#

and return that

#

then I'd have an ID to check?

#

right?

dense sonnet
#

Yup, that should work

verbal willow
#

Only problem is that this slows everything down, particularly with a poor connection

#

But I don't see a way around it

#

Unless there is something I'm missing?

dense sonnet
#

Yeah unfortunately until you figure out the network situation, you'll have to have some trade-offs ๐Ÿ˜ฆ

verbal willow
#

Gotcha

#

Well thanks

#

I appreciate being able to talk this through with someone

dense sonnet
#

NP! Happy to help ๐Ÿ˜„
Good luck with everything

verbal willow
#

๐Ÿ‘