| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
The files in this directory each implement a demo class for a specific Google Wallet pass type. Each class implements methods for performing tasks such as creating a pass class, updating issuer permissions, and more.
| Pass type | File |
|---|---|
| Event tickets | com.google.developers.wallet.rest.DemoEventTicket.java |
| Flight boarding passes | com.google.developers.wallet.rest.DemoFlight.java |
| Generic passes | com.google.developers.wallet.rest.DemoGeneric.java |
| Gift cards | com.google.developers.wallet.rest.DemoGiftCard.java |
| Loyalty program membership | com.google.developers.wallet.rest.DemoLoyalty.java |
| Offers and promotions | com.google.developers.wallet.rest.DemoOffer.java |
| Transit passes | com.google.developers.wallet.rest.DemoTransit.java |
The following environment variables must be set. Alternatively, you can update the code files to set the values directly. They can be found in the constructor for each class file.
| Enviroment variable | Description | Example |
|---|---|---|
| GOOGLE_APPLICATION_CREDENTIALS | Path to a Google Cloud service account key file | /path/to/key.json |
Open the java project folder in your editor of choice.
Build the project to install the dependencies.
In your Java code, import a demo class and call its method(s). An example can be found below
// Create a demo class instance
// Creates the authenticated HTTP client
com.google.developers.wallet.rest.DemoEventTicket demo = new com.google.developers.wallet.rest.DemoEventTicket();
// Create a pass class
demo.createClass("issuer_id", "class_suffix");
// Update a pass class
demo.updateClass("issuer_id", "class_suffix");
// Patch a pass class
demo.patchClass("issuer_id", "class_suffix");
// Add a message to a pass class
demo.addClassMessage("issuer_id", "class_suffix", "header", "body");
// Create a pass object
demo.createObject("issuer_id", "class_suffix", "object_suffix");
// Update a pass object
demo.updateObject("issuer_id", "object_suffix");
// Patch a pass object
demo.patchObject("issuer_id", "object_suffix");
// Add a message to a pass object
demo.addObjectMessage("issuer_id", "object_suffix", "header", "body");
// Expire a pass object
demo.expireObject("issuer_id", "object_suffix");
// Generate an Add to Google Wallet link that creates a new pass class and object
demo.createJWTNewObjects("issuer_id", "class_suffix", "object_suffix");
// Generate an Add to Google Wallet link that references existing pass object(s)
demo.createJWTExistingObjects("issuer_id");
// Create pass objects in batch
demo.batchCreateObjects("issuer_id", "class_suffix");| Back | FazBrowse Home | New Git URL |