SQRDReaderSDK.shared.authorize()最初没有回调

时间:2019-07-29 04:05:22

标签: ios node.js swift square-connect square

我目前无法使用iOS(Swift)授权SquareReaserSDK。

  1. 我有一个包含 access_token 的节点实例。
  2. 然后我呼叫 listLocations()
  3. 我在 CreateMobileAuthorizationCodeRequest()
  4. 正文中提供第一个 location_id
  5. 然后我将生成的移动身份验证代码传递给客户端

成功获取移动身份验证令牌并将其提供给以下对象后,首次调用该令牌便没有回调。 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.

0 个答案:

没有答案