#kpaxian7

1 messages · Page 1 of 1 (latest)

sinful tartanBOT
rocky vigil
#

What does it give you after running this code? the "discoverReaders failed"?

burnt bison
#

no, nothing print

#

is something i need do with my reader?

#

fun initReader() {
Log.e("stripeTag", "initReader")
Terminal.initTerminal(context, LogLevel.INFO, object : ConnectionTokenProvider {
override fun fetchConnectionToken(callback: ConnectionTokenCallback) {
Log.e("stripeTag", "fetchConnectionToken")
discover()
}
}, object : TerminalListener {
override fun onUnexpectedReaderDisconnect(reader: Reader) {
Log.e("stripeTag", "onUnexpectedReaderDisconnect")
}
})

}

fun discover() {
    Log.e("stripeTag", "discover")
    val config = DiscoveryConfiguration(
        discoveryMethod = DiscoveryMethod.BLUETOOTH_SCAN,
    )
    Terminal.getInstance().discoverReaders(config, this, object : Callback {
        override fun onSuccess() {
            Log.e("stripeTag", "discoverReaders succeeded")
        }

        override fun onFailure(e: TerminalException) {
            Log.e("stripeTag", "discoverReaders failed = ${e.message}")
            e.printStackTrace()
        }
    })
    Log.e("stripeTag", "discover done!")
}
#

initReader
fetchConnectionToken
discover

and no more prints...

sinful tartanBOT
steady hamlet
#

Hi! I'm taking over this thread. Give me a few minutes to catchup.

#

Which documentation link are you following?

vagrant elm
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

#

What's the exact issue you're facing? Do you see any errors?
What's the expected behaviour?
Could you please share your SDK version please?

burnt bison
#

Yeah

  1. my android device is nearby with my M2 reader, but i cant discover readers by methods "Terminal.getInstance().discoverReaders", is there need a connection token before doing discover?
vagrant elm
#

Adding your initial message here:

seems being stuck at discoverReaders

burnt bison
#
  1. implementation 'com.stripe:stripe-android:20.25.8'
    
    implementation "com.stripe:stripeterminal:2.21.1"
vagrant elm
#

Don’t use mobile device settings to pair with your reader. Pairing the reader through device settings makes the reader unavailable to connect to your app.
From the doc, could you double check if it wasn't paired in the device settings?

burnt bison
#

i did nothing in my device bluetooth setting, i even cannot find my M2 reader in my Android bluetooth list...

#

i just want discover my reader in my app, but seems something wrong

vagrant elm
burnt bison
#

yes it does

#

and no more print

#

and i got a question, i only do this test in my Android app, without bankend, is this step wrong?

#

Or i need register something (like token generate) first, then i can discover the Reader?

vagrant elm
burnt bison
#

OH... Can you give me a complete step brief about M2 reader connection in Android app.

#

Thank you so much

vagrant elm
burnt bison
#

thank you again!

vagrant elm
#

Happy to help!