public final class AuthorizationState
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
boolean |
canDeauthorize()
Deauthorization fails if there are asynchronous payments recorded on the device that have not
been uploaded to Square servers.
|
boolean |
equals(java.lang.Object o) |
Location |
getAuthorizedLocation()
Returns the currently authorized location.
|
int |
hashCode() |
boolean |
isAuthorizationInProgress()
Returns true if a Reader SDK authorization is in progress, false otherwise.
|
boolean |
isAuthorized()
Returns true if Reader SDK is currently authorized to collect payments on behalf of a Square
location, false otherwise.
|
static AuthorizationState |
newAuthorizedState(Location location,
boolean canDeauthorize)
Returns new authorized AuthorizationState instance.
|
static AuthorizationState |
newInProgressState()
Returns a new in progress AuthorizationState instance.
|
static AuthorizationState |
newUnauthorizedState()
Returns a new unauthorized AuthorizationState instance.
|
java.lang.String |
toString() |
@NonNull public static AuthorizationState newAuthorizedState(@NonNull Location location, boolean canDeauthorize)
Returns new authorized AuthorizationState instance.
This method is provided for testing purposes.
@NonNull public static AuthorizationState newUnauthorizedState()
Returns a new unauthorized AuthorizationState instance.
This method is provided for testing purposes.
@NonNull public static AuthorizationState newInProgressState()
Returns a new in progress AuthorizationState instance.
This method is provided for testing purposes.
public boolean isAuthorized()
public boolean isAuthorizationInProgress()
public boolean canDeauthorize()
@NonNull public Location getAuthorizedLocation() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if Reader SDK is not currently authorized.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object