Configuration
To use this component, you’ll need to configure the Google Wallet console and create the associated Google Cloud project. The main output and requirement of this configuration is the Service account JSON file which will be used by this component, it has the following format:
1. {
2. "type": "service_account",
3. "project_id": "YOUR-CLOUD-PROJECT-NAME",
4. "private_key_id": "SOME-GUID",
5. "private_key": "-----BEGIN PRIVATE KEY-----\nPRIVATE-KEY-CONTENT==\n-----END PRIVATE KEY-----\n",
6. "client_email": "SERVICE-ACCOUNT-EMAIL",
7. "client_id": "CLIENT-ID",
8. "auth_uri": "https://accounts.google.com/o/oauth2/auth",
9. "token_uri": "https://oauth2.googleapis.com/token",
10. "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
11. "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/wallet-account%40os-one-wallet.iam.gserviceaccount.com",
12. "universe_domain": "googleapis.com"
13. }
14.
It’s highly suggested to read thoroughly all Google documentation on this configuration, if done incorrectly or by skipping steps, this component will not work.
Using the component
Using the component is very straightforward: just consume the Service Action ‘Generate_GenericPass’ and provide the required inputs. There are some rules to what can be put in a pass:
The pass can have up to 3 rows of content, each row having up to 3 columns of content
The Background color of the pass must be specified in Hex code
This component handles class and object creation/update automatically to the Wallet console, but it doesn’t do any type of sorting /distinction/organizing, any naming convention or scheme is entirely on the user’s responsibility
Image URLs must be absolute or accessible from the internet, otherwise the pass generation will fail
The Service Action, if all the inputs are correct, will then return a URL with a JWT token that will be interpreted by the wallet app and add the pass to said wallet.
Debugging
The Google Wallet API isn’t prone to bugs if all the inputs are correct, but if facing issues, there are some steps to try and find the problem’s origin:
“Error decoding JSON credentials”: there is something wrong with the credentials JSON provided. Advice: don’t store this JSON in a site property, it will be truncated and therefore a possible cause for this error.
The pass URL contains a JWT that can be decoded online in jwt.io to check what exactly is being sent in the component. So, if there’s anything wrong with the pass in the wallet, decoding the JWT is a good starting point to find the error