Stripe卡阅读器在Android上的位置返回null。

huangapple go评论67阅读模式
英文:

Stripe card reader location is coming null on Android

问题

我们正面临着连接读卡器到Android应用程序的问题。以下是我们正在执行的步骤:
1- 打开读卡器:我们使用的是 "Stripe Reader M2"。我们轻按读卡器上的按钮,它的灯会亮起然后再次熄灭。我们认为它已经打开。

2- 连接读卡器:首先,我们进入Android的蓝牙设置并在那里配对读卡器。看起来它成功配对,所以我们认为读卡器已经打开。

3- 在Android上,我按照文档的说明尝试发现设备。

val config = DiscoveryConfiguration(20, DiscoveryMethod.BLUETOOTH_SCAN, false)
Terminal.getInstance().discoverReaders(config, object : DiscoveryListener {...}, object : Callback {...})

问题:我收到了名为 "onUpdateDiscoveredReaders" 的回调,在那里我看到了读卡器,但读卡器的位置->id为 'null'。它的标签和id也都是 'null'。它的serialNumber是上面的字符串 "STRM2..."。
另外,我在discoverReaders的onFailure回调中收到了错误 BLUETOOTH_SCAN_TIMED_OUT。

我需要在BluetoothConnectionConfiguration中获取 "reader->location->id"。

如果我在DiscoveryConfiguration中将isSimulated设置为true,那么它可以工作,并且模拟的读卡器可以连接。

请指导我们缺少什么。

英文:

We are facing a problem connecting to the Card reader to Android app. Here are the steps we are following:
1- Turn on the card reader: We have "Stripe Reader M2". We tap the button on the reader, its lights turn on and then turn off again. We assume it is ON.

2- Connect the reader: We first go to Android Bluetooth settings and pair the reader there. It seems it gets paired successfully, so here we think that the Reader was ON.

3- On Android I followed the documentation, and tried to discover the device.

    val config = DiscoveryConfiguration(20, DiscoveryMethod.BLUETOOTH_SCAN , false) 
    Terminal.getInstance().discoverReaders(config, object : DiscoveryListener {...}, object : Callback {...})

  PROBLEM: I get the callback "onUpdateDiscoveredReaders" and there I see the reader, but the reader's location->id is 'null'. Its label and id  are also 'null'. Its serialNumber is the above string "STRM2..."
  Also, I am getting the error BLUETOOTH_SCAN_TIMED_OUT in onFailure Callback in discoverReaders.

    I need the "reader->location->id" in BluetoothConnectionConfiguration. 

    If I set isSimulated = true in DiscoveryConfiguration, then it works, and the simulated reader is connected. 

Please guide us on what is missing.

答案1

得分: 1

reader.location如果尚未注册到位置,则为null - 请参阅https://stripe.com/docs/terminal/fleet/locations了解更多详情

如果尚未执行以下操作,您应该:

  1. 创建位置:https://stripe.com/docs/api/terminal/locations/create
  2. 将阅读器注册到位置:https://stripe.com/docs/terminal/fleet/locations#register-bluetooth-readers
英文:

reader.location is null if the reader hasn't been registered to a location yet - see https://stripe.com/docs/terminal/fleet/locations for more details

If you haven't yet done so, you should :

  1. Create a location : https://stripe.com/docs/api/terminal/locations/create
  2. Register a reader to a location : https://stripe.com/docs/terminal/fleet/locations#register-bluetooth-readers

huangapple
  • 本文由 发表于 2023年5月11日 09:14:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76223507.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定