#lutthein_best-practices

1 messages ยท Page 1 of 1 (latest)

regal cedarBOT
#

๐Ÿ‘‹ 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/1354494638735495189

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

stoic nova
#

Im using react native stripe sdk, and I already tested using cancelCollectPaymentMethod but it wont cancel the transaction in neither the Wisepad3 or M2 terminals

supple yew
#

What does the Promise resolve to when you call this method?

stoic nova
#

Well, I can see a "Cancelled" promise since Im making a Promise.race (my approach as the M2 as no cancel button) between the collectPaymentMethod Promise and a button tap I created to call the cancelCollectPaymentMethod

--Screenshot--

But the PaymentStatus is still stuck in waitingForInput

supple yew
#

But the PaymentStatus is still stuck in waitingForInput

Where are you seeing this?

stoic nova
#

didChangePaymentStatus user callback

supple yew
#

And what status are you expecting it to transition to?

stoic nova
#

well, I would expect it to change to any other status, in the Wisepad3 it gets stuck in that waiting for input screen

supple yew
#

Hmmm... true, I would expect it to transition to ready since we should exit the current operation and be ready to accept a new command

stoic nova
#

also, I removed my logic to see if enableCustomerCancellation on its own would do it, but with a M2 terminal it throws a
Customer-initiated cancellation is only available on Android-based internet readers.

supple yew
#

Yes, that requires the reader have some sort of interface

#

The X button on the WP3, for example

stoic nova
#

Yup, makes sense

supple yew
#

Hmmm... okay I'm not seeing anything that looks like this reported in the GH issues page for that SDK.

#

I'm still digging

stoic nova
#

Thank you, cancelling the collectPaymentMethod is both not working for M2 and Wisepad3, in the Wisepad3 side, it is not a big deal, just tap the cancel physical button, but for M2 it certainly gets the process stuck

supple yew
#

Okay and can you tell me what version of the SDK you are using?

#

It looks like this was flagged for both M2 and WP3 last year

stoic nova
#

"@stripe/stripe-terminal-react-native": "0.0.1-beta.23",

regal cedarBOT
umbral crag
#

Hi, taking over as my teammate needs to step away. Let me catch up.

stoic nova
#

Sure, thank you!

umbral crag
#

It looks like you might be using a Beta version. Let me loop in a teammate who has more expertise here.

stoic nova
#

let me check, thanks! I will try to PoC asap

#

Oh wait

#

yeah, I already do that haha

#

cancelCollectRefundPaymentMethod is the function you refer to?

umbral crag
#

Yes, you'd need to wire up a separate button to cancel the collection

stoic nova
#

Yeah, I do that while waitingforinput status

#

Nothing gets logged when I tap the button and call the function while the PaymentStatus is waitingForInput

honest jackal
#

Hello
Jumping into help out here

#

Can you take out the if condition to invoke the function directly?

stoic nova
#

Hi, thank you

#

Sure, I have logged and it is firing, reaching that point, the function just wont do anything.

honest jackal
#

that function returns a promise I think
can you modify the code a bit to receive a response and see if you're getting an error?

like

 const { _, err } = await cancelCollectPaymentMethod();

 console.log(_);
 console.log(err);
#

also I wonder if it's just bad naming in the SDK for the function but there seems to be a cancelCollectSetupIntent function as well

#

Ah yup bad naming on our end

stoic nova
#

Sure one sec

#

So, for reference, the error from calling const { _, err } = await cancelCollectPaymentMethod(); is undefined

honest jackal
#

ah yeah it likely just returns one parameter back (in case there's an error)

stoic nova
#

Onn it, changing it now

#

That was it! the M2 device actually does a Nah ah sounds and everything, perfect!

honest jackal
#

Awesome.. Sorry for the confusion earlier. I've flagged the weird naming issue internally already. Let's see if we can get it updated in future SDK releases.

regal cedarBOT
stoic nova
#

It makes some sort of sense anyway, Im actually going to change the catch function in my setupIntent to also call cancelCollectSetupIntent instead of the cancelCollectPaymentMethod which apparently was not doing anything, it was the terminal or TapToPay who was handling the cancelation in case of an error

honest jackal
#

Sounds good! ๐Ÿ‘
Anything else I can help you with?

stoic nova
#

That would be all, thanks so much appreciate it!