| 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 type for a specific Google Wallet pass type. Each demo type has methods implemented for performing tasks such as creating a pass class, updating issuer permissions, and more.
| Pass type | File |
|---|---|
| Event tickets | demo_eventticket.go |
| Flight boarding passes | demo_flight.go |
| Generic passes | demo_generic.go |
| Gift cards | demo_giftcard.go |
| Loyalty program membership | demo_loyalty.go |
| Offers and promotions | demo_offer.go |
| Transit passes | demo_transit.go |
The following environment variables must be set. Alternatively, you can update the code files to set the values directly.
| Enviroment variable | Description | Example |
|---|---|---|
| GOOGLE_APPLICATION_CREDENTIALS | Path to a Google Cloud service account key file | /path/to/key.json |
| WALLET_ISSUER_ID | Your Google Wallet Issuer ID | 1234567890 |
First install the dependencies for the sample you wish to run (this isn't necessary a second time for running subsequent samples)
go install demo_eventticket.goRun the sample
go run demo_eventticket.goOptionally, you can manually copy the demo type in your own project. An example can be found below
// Create a demo type instance
// Creates the authenticated HTTP client
d := demoEventticket{}
d.auth()
// Create a pass class
d.createClass(issuerId, classSuffix)
// Create a pass object
d.createObject(issuerId, classSuffix, objectSuffix)
// Expire a pass object
d.expireObject(issuerId, objectSuffix)
// Create an "Add to Google Wallet" link
// that generates a new pass class and object
d.createJwtNewObjects(issuerId, classSuffix, objectSuffix)
// Create an "Add to Google Wallet" link
// that references existing pass classes and objects
d.createJwtExistingObjects(issuerId)
// Create pass objects in batch
d.batchCreateObjects(issuerId, classSuffix)| Back | FazBrowse Home | New Git URL |