Stripe 读卡器位置在 Android 上为空

Stripe card reader location is coming null on Android

提问人:M. Usman Khan 提问时间:5/11/2023 更新时间:5/11/2023 访问量:124

问:

我们面临着将读卡器连接到 Android 应用程序的问题。以下是我们遵循的步骤: 1-打开读卡器:我们有“Stripe Reader M2”。我们点击读卡器上的按钮,它的灯亮起,然后再次关闭。我们假设它是 ON。

2-连接读卡器:我们首先转到Android蓝牙设置并在那里配对读卡器。它似乎已成功配对,因此我们认为阅读器已打开。

3-在Android上,我按照文档进行操作,并尝试发现该设备。

    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. 

请指导我们缺少什么。

Android 条纹支付

评论


答:

1赞 alex 5/11/2023 #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