Interface for Pay API.
| enum | PayClient.ProductName | Indicates what the product is called in this market | |
| @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). |
|
| @interface | PayClient.WearWalletIntentSource | Intent source for Wear Card Management Activity. | |
| 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 Task<PendingIntent> |
getPendingIntentForWalletOnWear(String wearNodeId,
int intentSource)
Create a
PendingIntent
for the Wear Wallet activity.
|
| abstract PayClient.ProductName |
getProductName()
Provides the product name in this market.
|
| abstract Task<Void> | |
| 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.Create a PendingIntent
for the Wear Wallet activity. May return an error if pay is not supported in this
region or if the watch is not reachable.
| wearNodeId | The node id of the watch. |
|---|---|
| intentSource | The
PayClient.WearWalletIntentSource that launches the requested page. |
Provides the product name in this market.
Notifies Google Play services of a card tap event.
Only apps on the allowlist can call this method; otherwise, the result is a failed
Task.
| eventJson | The event details in JSON format. |
|---|
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. |