#pascal - terminal
1 messages · Page 1 of 1 (latest)
Hello! I think you would call disconnectReader: in order to cancel the connection process, but let me confirm that...
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.
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.
Thank you. Is there a way to configure how long it takes to time out? What is the default timeout?
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?
2.0
We may not publicly state how long it is, let me check...
thank you. We are using cocoapods and this is how we're specifying the version
pod 'StripeTerminal', '~> 2.0'
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.
15 minutes? Wow, that sounds unexpected.
I have not received an error and if I execute discoverReaders still get the error about the SDK being busy
Was the completion block you supplied never called?
that's correct
Can you share the code you're using?
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 ...
I'm mainly interested in your connectInternetReader code and the completion block.
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.
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.
ok, thank you
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.
I can do both
I'll do some digging on my end in the meantime!
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.
do you have a permalink for this thread?
yes, it's timing out after about one minute.
Yes, it would be https://discord.com/channels/841573134531821608/991056523478302850, but I don't know that Discord thread permalinks are working correctly all the time. You can always use the search in Discord to find this conversation again though.