#pascal - terminal

1 messages · Page 1 of 1 (latest)

glad zodiac
#

Hi there. One moment

south wave
#

Hello! I think you would call disconnectReader: in order to cancel the connection process, but let me confirm that...

solid condor
#

thank you. the issue is that the reader never got connected to. I have tried calling disconnectReader and that didn't work.

#

We are intentionally getting into this state by restarting the WisePos right before making the call to connectInternetReader. We're simulating the venue having WIFI connectivity issues and recovering from that. Allowing the venue to connect to another device or try to reconnect to the current device.

south wave
#

Ah, looks like this is something we decided explicitly to not allow. You cannot cancel connectReader, you need to wait for it to time out.

solid condor
#

Thank you. Is there a way to configure how long it takes to time out? What is the default timeout?

south wave
#

There's no way to configure the timeout. I believe the amount of time it takes depends on the specific version of the SDK being used. What version of the Terminal iOS SDK are you using?

solid condor
#

2.0

south wave
#

We may not publicly state how long it is, let me check...

solid condor
#

thank you. We are using cocoapods and this is how we're specifying the version
pod 'StripeTerminal', '~> 2.0'

south wave
#

Looks like we don't publicly document the timeout duration. I recommend measuring it on your end to make sure the amount of time is accurate for your integration.

solid condor
#

ok, thank you

#

It has been over 15 minutes and it still hasn't timed out yet.

south wave
#

15 minutes? Wow, that sounds unexpected.

solid condor
#

I have not received an error and if I execute discoverReaders still get the error about the SDK being busy

south wave
#

Was the completion block you supplied never called?

solid condor
#

that's correct

south wave
#

Can you share the code you're using?

solid condor
#

I can but it's quite a bit of code

#

it's a point of sale that support multiple payment platforms. For museums, aquariums, zoos ...

south wave
#

I'm mainly interested in your connectInternetReader code and the completion block.

solid condor
#

here is the code. I could simplify it if needed..

#

Terminal.shared.connectInternetReader(reader, connectionConfig: InternetConnectionConfiguration(allowCustomerCancel: false), completion: { reader, error in

                    if let reader = reader {
                        self.reader = reader
                    } else if let error = error {
                        print("connectInternetReader failed: \(error)")

                        InstrumentationManager.instance.notify(
                            for: "Stripe Device: Card Reader Initialization Failed - Unable to connect to internet device",
                               reason: error.localizedDescription,
                               severity: .warning,
                               data: self.metaData()
                        )
                    }

                    self.connectCallback?(ipAddress)
                    self.connectCallback = nil
                })
#

we aren't part of the allowCustomerCancel Beta so we're passing in false there. If we should pass in true we can.

south wave
#

allowCustomerCancel only impacts what the cardholder can do (if they can cancel or not during the payment process). It should not have any impact on establishing the initial connection to the reader.

solid condor
#

ok, thank you

south wave
#

Can you add logging at the very beginning of the completion handler or change the code to check for the error first and try again? I'm wondering if you're getting both a reader and an error when that's called, which means only the first part of your if statement is running. I mean, I doubt that's it, but just want to rule it out.

solid condor
#

I can do both

south wave
#

I'll do some digging on my end in the meantime!

solid condor
#

I am seeing it time out after about a minute. I will look more into this more. It will turn out to be code on our side where we'll need to block some UI components until it times out or successfully connects.

#

thank you very much Rubeus.

south wave
#

Happy to help!

#

So checking for error first resolves the 15+ minute issue?

solid condor
#

do you have a permalink for this thread?

#

yes, it's timing out after about one minute.

south wave