#heartthrob-rob_code

1 messages ยท Page 1 of 1 (latest)

hearty remnantBOT
#

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

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

cyan forge
#

Hello
Can you share the exact code you're working with? Where's this updateReader error originating from?

#

Are you seeing that when you call connectReader ?

vestal crest
#

yes when I call connect reader

#

seems to be coming from a stripe module in the logcat - "StripeTerminal"

cyan forge
#

What are you passing as your SimulatorConfiguration?

vestal crest
#

I was setting discoveryconfig to (isSimulated= true), but haven't passed a specific simulator config

cyan forge
#

Hmm I meant when you call connectReader, what are you passing in as the second parameter?

#

The issue seems to be with Connection and not Discovery

vestal crest
#

fun connectToReader(
reader: Reader,
locationId: String = DEFAULT_LOCATION_ID,
onSuccess: (Reader) -> Unit,
onFailure: (TerminalException) -> Unit
) {
try {
// Check if already connected to this reader
if (currentReader != null && currentReader?.id == reader.id) {
// Already connected to this reader, just call the success callback
onSuccess(currentReader!!)
return
}

        // Not connected or connected to a different reader
        val config = createConnectionConfig(locationId)

        terminal?.connectReader(
            reader,
            config,
            createReaderCallback(onSuccess, onFailure)
        )
    } catch (e: Exception) {
        handleConnectionError(e, onFailure)
    }
}

private fun createConnectionConfig(locationId: String): ConnectionConfiguration {
    return ConnectionConfiguration.TapToPayConnectionConfiguration(
        locationId = locationId,
        autoReconnectOnUnexpectedDisconnect = true,
        tapToPayReaderListener = createTapToPayListener()
    )
}
#

It's createConnectionConfig isn't it?!

cyan forge
#

Yup
Hmm I don't see anything that might trigger an update on the simulated reader ๐Ÿค”

vestal crest
#

thanks so much for your help

#

sometimes being a solo dev is exhausting

cyan forge
#

Are you on the latest version of the SDK?

vestal crest
#

I'll have to check, haven't updated for a while

cyan forge
#

Gotcha. Can you try using the latest SDK if you don't currently have that set up yet?

Also, just to confirm -- there arent' any other places where your code calls Terminal.getInstance().simulatorConfiguration or anything similar -- correct?

vestal crest
#
  • Just moving from 4.1 to 4.3
  • Yes you're right no other places that call simulatorConfiguration
cyan forge
#

Hmm I don't have a way to reproduce this error at the moment. Are you able to test this on an actual device to see if you're able to test with non-simulated device?