ios - SQRDReaderSDK.shared.authorize() 最初没有回调
问题描述
我目前无法使用 iOS (Swift) 授权 SquareReaserSDK。
- 我有一个接受access_token的节点实例。
- 然后我调用listLocations()
- 我在CreateMobileAuthorizationCodeRequest()的正文中提供了第一个location_id
- 然后我将生成的移动身份验证代码传递给客户端
在成功检索移动身份验证令牌并将其提供给下面之后,第一次调用它时没有回调。块 if 语句永远不会触发。
冗余调用会导致authorization_already_in_progress错误(触发 if 语句)。
SQRDReaderSDK.shared.authorize(withCode: mobileAuthToken) { location, error in
if let authError = error {
print("Authorize SquareReaderSDK", authError.localizedDescription)
} else {
print("Authorize SquareReaderSDK", location)
Defaults[.establishment]?.squareMobileAuthToken = mobileAuthToken as! String
}
}
authorize() 端点参考: https ://developer.squareup.com/docs/api/reader/ios/Classes/SQRDReaderSDK.html#/Authorization
冗余调用导致:
vvvvv SQUARE ERROR vvvvv
ERROR: Something went wrong. Please contact the developer of this application and provide them with this error code: authorization_already_in_progress
DEBUG CODE: authorization_already_in_progress
DEBUG MESSAGE: Authorization is already in progress. Please wait for SQRDReaderSDK.shared.authorize() to complete.
^^^^^ SQUARE ERROR ^^^^^
在尝试授权设备的任何时候,我在尝试呈现 checkoutController 时都会收到以下错误:
Checkout Failed:
This device is not currently authorized to accept payments with Square.
解决方案
推荐阅读
- python - 编写测验时如何添加有限提示?
- php - 如何获取数组名称。Blade.Laravel.PHP
- google-chrome - 谷歌浏览器日志网络通话时间计算
- python - 我想更改我电脑的壁纸,但它变成了黑色
- perl - Plack 如何调试请求?
- javascript - 在地图中调用异步函数
- c# - PowerPoint ThemeColorScheme 派生的颜色/色调
- intellij-idea - 在 intellij 中更改 testng xml 文件模板
- python - sec.gov 使用嵌套的 for 循环进行抓取,遇到 Unicode 错误
- javascript - JQuery .load() 后跟 .css() 修改