#felipe_code
1 messages · Page 1 of 1 (latest)
👋 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/1288505899186655283
📝 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.
- felipe_code, 2 hours ago, 16 messages
Hello, can you provide more of your code for how you are setting terminal up before calling discoverReaders?
sure
val config: DiscoveryConfiguration =
DiscoveryConfiguration.LocalMobileDiscoveryConfiguration(isApplicationDebuggable)
discoveryCancelable =
Terminal.getInstance().discoverReaders(config, discoveryListener = object :
DiscoveryListener {
override fun onUpdateDiscoveredReaders(readers: List<Reader>) {
readers.filter { it.networkStatus != Reader.NetworkStatus.OFFLINE }
val reader = readers[0]
val result =
Terminal.getInstance().supportsReadersOfType(reader.deviceType, config)
if (result.isSupported) {
val config2 =
ConnectionConfiguration.LocalMobileConnectionConfiguration(
location?.gatewayLocationId ?: "",
autoReconnectOnUnexpectedDisconnect = true
)
Terminal.getInstance().connectLocalMobileReader(
reader,
config2,
object : ReaderCallback {
override fun onFailure(e: TerminalException) {
mView.isToShowProgressDialog(false)
mView.showTerminalNotSupportedToast()
Timber.e(e)
}
override fun onSuccess(reader: Reader) {
createPrepareTransaction(ticket!!.id, totalToCharge)
Timber.d("onReaderReconnectSucceeded")
}
}
)
Thank you, and is there any other info that is included in the exception that is thrown, like a message string?
This is the full stacktrace
It looks like that exception should be thrown with an error code that will tell us more. Can you try catching that exception and checking what its error code is?
Whoops wrong link. To catch the exception, you can put a try-catch exception that catches a TerminalException around that code from above https://kotlinlang.org/docs/exceptions.html#handle-exceptions-using-try-catch-blocks
I'm getting the same exception, without any error code
I added a try catch block
To be clear, is that to say that the try catch block is not catching your exception, or that when you inspect errorCode on the exception it doesn't seem to be set? From the screenshot, it looks like it may still not be getting caught at all, in which case you may need to wrap different code in the try-catch to properly inspect this error
https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.models/-terminal-exception/index.html
I only can reproduce the expception using a release version, so I can't debug
I will try to add another try catch block
I tried on multiple parts of the code, still getting the same
I'm suspecting there is no error code
I was wondering why that exception mentioned firebase remote config?
Hi there 👋 helping taking a look here. I'm not sure why Firebase is mentioned there, are you using Firebase for your app somehow? (We don't know much about firebase since we don't have first-party support for it) I wouldn't expect our sdk to throw an error related to Firebase.
What does come to mind offhand, since you mentioned that you're testing in a live environment, is checking whether your app is debuggable. Tap to pay can't be used used in a debuggable app:
https://docs.stripe.com/terminal/payments/connect-reader?terminal-sdk-platform=android&reader-type=tap-to-pay#:~:text=For the non-simulated version of the Tap to Pay reader%2C the application isn’t debuggable
I was able to fix the issue following this: https://github.com/stripe/stripe-terminal-android/issues/439
It seems an issue between stripe/firebase sdk
Gotcha, glad to hear you were able to get to the bottom of it!
So, is there a fix for that in progress for the next releases of the stripe sdk?
I don't see any active issues about that. It could be worth raising a new one on that repo if you think this is something that should be fixed on our side