Interface for Pay API.
| @interface | PayClient.RequestType | All possible request types that will be used by
callers of
PayClient.getPayApiAvailabilityStatus(int). |
|
| @interface | PayClient.SavePassesResult | Possible result codes passed back in
onActivityResult() when calling
PayClient.savePasses(String, Activity, int) or
PayClient.savePassesJwt(String, Activity, int). |
|
| String | EXTRA_API_ERROR_MESSAGE | Debug message passed back in
onActivityResult() when calling
savePasses(String, Activity, int) or
savePassesJwt(String, Activity, int). |
| abstract Task<Integer> |
getPayApiAvailabilityStatus(int requestType)
Gets the
PayApiAvailabilityStatus
of the current user and device.
|
| abstract void |
savePasses(String json,
Activity
activity, int requestCode)
Saves one or multiple passes in a JSON format.
|
| abstract void |
savePassesJwt(String jwt,
Activity
activity, int requestCode)
Saves one or multiple passes in a JWT format.
|
Debug message passed back in onActivityResult() when calling
savePasses(String, Activity, int) or
savePassesJwt(String, Activity, int).
public void onActivityResult(int requestCode, int resultCode, Intent data) {
...
if (resultCode == PayClient.SavePassesResult.SAVE_ERROR && data != null) {
String errorMessage = data.getStringExtra(PayClient.EXTRA_API_ERROR_MESSAGE);
...
}
...
}
Gets the PayApiAvailabilityStatus
of the current user and device.
| requestType | A PayClient.RequestType
for how the API will be used. |
|---|
PayApiAvailabilityStatus.Saves one or multiple passes in a JSON format.
Must be called from an Activity.
| json | A JSON string request to save one or multiple passes. The JSON format is consistent with the JWT save link format. Refer to Google Pay API for Passes for an overview on how save links are generated. Only focus on how the JSON is formatted. There is no need to sign the JSON string. |
|---|---|
| activity | The Activity that will receive the callback result. |
| requestCode | An integer request code that will be passed back in
onActivityResult(), allowing you to identify whom this result came
from. |
Saves one or multiple passes in a JWT format.
Must be called from an Activity.
| jwt | A JWT string token to save one or multiple passes. The token format is the same used in the JWT save link format. Refer to Google Pay API for Passes for an overview on how save links are generated. |
|---|---|
| activity | The Activity that will receive the callback result. |
| requestCode | An integer request code that will be passed back in
onActivityResult(), allowing you to identify whom this result came
from. |