admin管理员组文章数量:1023648
I am working with Stripe terimnal with wisepad 3 reader. The reader got discovered during discovery phase but it is not getting connected. We are not using Location for now.
It is written in the documentation that :
To connect to a reader, your backend needs to give the SDK permission to use the reader with your Stripe account by providing it with the secret from a ConnectionToken. Your backend should only create connection tokens for clients that it trusts. If you’re using Stripe Connect, you should also scope the connection token to the relevant connected accounts. If using locations, you should pass a location ID when creating the connection token to control access to readers.
From documentation it seems it is optional to use location. But in the configuration of connect code it is neccessary to provide location id. I would like to know is it possible to connect reader with out using location id.
My current code for connect is :
private fun connectToReader(reader: Reader, result: MethodChannel.Result) {
val bluetoothReaderListener = TerminalBluetoothReaderListener()
val connectionConfig = ConnectionConfiguration.BluetoothConnectionConfiguration(
locationId = "",
autoReconnectOnUnexpectedDisconnect = true,
bluetoothReaderListener = bluetoothReaderListener
)
Terminal.getInstance().connectReader(reader, connectionConfig, object : ReaderCallback {
override fun onSuccess(connectedReader: Reader) {
Log.d("StripeTerminal", "Reader connected: ${connectedReader.serialNumber}")
notifyFlutterReaderConnection(true)
result.success("Reader connected successfully: ${connectedReader.serialNumber}")
}
override fun onFailure(e: TerminalException) {
Log.e("StripeTerminal", "Error connecting to reader: ${e.message}")
notifyFlutterReaderConnection(false)
result.error("CONNECT_ERROR", "Error connecting to reader: ${e.message}", null)
}
})
}
I am working with Stripe terimnal with wisepad 3 reader. The reader got discovered during discovery phase but it is not getting connected. We are not using Location for now.
It is written in the documentation that : https://docs.stripe/terminal/quickstart?reader=wp3
To connect to a reader, your backend needs to give the SDK permission to use the reader with your Stripe account by providing it with the secret from a ConnectionToken. Your backend should only create connection tokens for clients that it trusts. If you’re using Stripe Connect, you should also scope the connection token to the relevant connected accounts. If using locations, you should pass a location ID when creating the connection token to control access to readers.
From documentation it seems it is optional to use location. But in the configuration of connect code it is neccessary to provide location id. I would like to know is it possible to connect reader with out using location id.
My current code for connect is :
private fun connectToReader(reader: Reader, result: MethodChannel.Result) {
val bluetoothReaderListener = TerminalBluetoothReaderListener()
val connectionConfig = ConnectionConfiguration.BluetoothConnectionConfiguration(
locationId = "",
autoReconnectOnUnexpectedDisconnect = true,
bluetoothReaderListener = bluetoothReaderListener
)
Terminal.getInstance().connectReader(reader, connectionConfig, object : ReaderCallback {
override fun onSuccess(connectedReader: Reader) {
Log.d("StripeTerminal", "Reader connected: ${connectedReader.serialNumber}")
notifyFlutterReaderConnection(true)
result.success("Reader connected successfully: ${connectedReader.serialNumber}")
}
override fun onFailure(e: TerminalException) {
Log.e("StripeTerminal", "Error connecting to reader: ${e.message}")
notifyFlutterReaderConnection(false)
result.error("CONNECT_ERROR", "Error connecting to reader: ${e.message}", null)
}
})
}
Share
Improve this question
edited Nov 20, 2024 at 15:29
sai
asked Nov 19, 2024 at 9:30
saisai
535 bronze badges
2 Answers
Reset to default 1Yes, location id is necessary. First you have to add location in your stripe account terminal dashboard. Then if the endpoint for getting location id is not implemented on your backend then your team have to implement it. https://docs.stripe/api/terminal/locations/retrieve After that you can get location id from your backend on frontend side by calling your backend api.
And depending on which type of reader you are using you can register your reader by following this:
https://docs.stripe/terminal/fleet/register-readers?terminal-sdk-platform=android
You must register your reader to a location upon connection.
https://docs.stripe/terminal/payments/connect-reader?terminal-sdk-platform=android&reader-type=bluetooth#connect-reader
I am working with Stripe terimnal with wisepad 3 reader. The reader got discovered during discovery phase but it is not getting connected. We are not using Location for now.
It is written in the documentation that :
To connect to a reader, your backend needs to give the SDK permission to use the reader with your Stripe account by providing it with the secret from a ConnectionToken. Your backend should only create connection tokens for clients that it trusts. If you’re using Stripe Connect, you should also scope the connection token to the relevant connected accounts. If using locations, you should pass a location ID when creating the connection token to control access to readers.
From documentation it seems it is optional to use location. But in the configuration of connect code it is neccessary to provide location id. I would like to know is it possible to connect reader with out using location id.
My current code for connect is :
private fun connectToReader(reader: Reader, result: MethodChannel.Result) {
val bluetoothReaderListener = TerminalBluetoothReaderListener()
val connectionConfig = ConnectionConfiguration.BluetoothConnectionConfiguration(
locationId = "",
autoReconnectOnUnexpectedDisconnect = true,
bluetoothReaderListener = bluetoothReaderListener
)
Terminal.getInstance().connectReader(reader, connectionConfig, object : ReaderCallback {
override fun onSuccess(connectedReader: Reader) {
Log.d("StripeTerminal", "Reader connected: ${connectedReader.serialNumber}")
notifyFlutterReaderConnection(true)
result.success("Reader connected successfully: ${connectedReader.serialNumber}")
}
override fun onFailure(e: TerminalException) {
Log.e("StripeTerminal", "Error connecting to reader: ${e.message}")
notifyFlutterReaderConnection(false)
result.error("CONNECT_ERROR", "Error connecting to reader: ${e.message}", null)
}
})
}
I am working with Stripe terimnal with wisepad 3 reader. The reader got discovered during discovery phase but it is not getting connected. We are not using Location for now.
It is written in the documentation that : https://docs.stripe/terminal/quickstart?reader=wp3
To connect to a reader, your backend needs to give the SDK permission to use the reader with your Stripe account by providing it with the secret from a ConnectionToken. Your backend should only create connection tokens for clients that it trusts. If you’re using Stripe Connect, you should also scope the connection token to the relevant connected accounts. If using locations, you should pass a location ID when creating the connection token to control access to readers.
From documentation it seems it is optional to use location. But in the configuration of connect code it is neccessary to provide location id. I would like to know is it possible to connect reader with out using location id.
My current code for connect is :
private fun connectToReader(reader: Reader, result: MethodChannel.Result) {
val bluetoothReaderListener = TerminalBluetoothReaderListener()
val connectionConfig = ConnectionConfiguration.BluetoothConnectionConfiguration(
locationId = "",
autoReconnectOnUnexpectedDisconnect = true,
bluetoothReaderListener = bluetoothReaderListener
)
Terminal.getInstance().connectReader(reader, connectionConfig, object : ReaderCallback {
override fun onSuccess(connectedReader: Reader) {
Log.d("StripeTerminal", "Reader connected: ${connectedReader.serialNumber}")
notifyFlutterReaderConnection(true)
result.success("Reader connected successfully: ${connectedReader.serialNumber}")
}
override fun onFailure(e: TerminalException) {
Log.e("StripeTerminal", "Error connecting to reader: ${e.message}")
notifyFlutterReaderConnection(false)
result.error("CONNECT_ERROR", "Error connecting to reader: ${e.message}", null)
}
})
}
Share
Improve this question
edited Nov 20, 2024 at 15:29
sai
asked Nov 19, 2024 at 9:30
saisai
535 bronze badges
2 Answers
Reset to default 1Yes, location id is necessary. First you have to add location in your stripe account terminal dashboard. Then if the endpoint for getting location id is not implemented on your backend then your team have to implement it. https://docs.stripe/api/terminal/locations/retrieve After that you can get location id from your backend on frontend side by calling your backend api.
And depending on which type of reader you are using you can register your reader by following this:
https://docs.stripe/terminal/fleet/register-readers?terminal-sdk-platform=android
You must register your reader to a location upon connection.
https://docs.stripe/terminal/payments/connect-reader?terminal-sdk-platform=android&reader-type=bluetooth#connect-reader
本文标签: androidIs it neccessary to use locationId for connecting reader with Stripe TermialStack Overflow
版权声明:本文标题:android - Is it neccessary to use locationId for connecting reader with Stripe Termial? - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745570875a2156729.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论