# AuthorizationManager

interface AuthorizationManager

Lets the application authorize and deauthorize Mobile Payments SDK to collect payments on behalf of a Square location.

## Properties

authorizationState
Link copied to clipboard
abstract val authorizationState: AuthorizationState

Snapshot of the current authorization state. The returned AuthorizationState is immutable and is NOT modified if the state changes. If you are looking for a way to track AuthorizationState, register a callback with setAuthorizationStateChangedCallback.

location
Link copied to clipboard
abstract val location: AuthorizedLocation?

Snapshot of the AuthorizedLocation if Mobile Payments SDK is currently authorized. AuthorizedLocation is `null` if not authorized.

## Functions

authorize
Link copied to clipboard
abstract fun authorize(token: String, locationId: String?, callback: Callback<AuthorizeResult>): CallbackReference

Asynchronously authorizes Mobile Payments SDK with an OAuth Access Token and Location ID. Applications must authorize Mobile Payments SDK before performing any other operations.

deauthorize
Link copied to clipboard
abstract fun deauthorize()

Deauthorizes Mobile Payments SDK. Has no effect if the SDK is already in a deauthorized state.

setAuthorizationStateChangedCallback
Link copied to clipboard
abstract fun setAuthorizationStateChangedCallback(callback: Callback<AuthorizationState>): CallbackReference

Registers a callback to be called when an authorization state changes. The supplied Callback will be called on the application UI thread when user is logged in or logged out. Important note: this callback will be called AFTER the authorization callback supplied to authorize.