-
Notifications
You must be signed in to change notification settings - Fork 153
Description
Hi,
I tried to implement C# code to generate google generic pass but no success I got. I tried lost of docs & article but didn't found a fruitful result. Anyone can help me to generate google pass using .NET C# please? I've tried all those steps with VS 2022 like below:
Prerequisites
- .NET 6.0
- Follow the steps outlined in the
Google Wallet prerequisites
to create the Google Wallet issuer account and Google Cloud service account - Download the C#
Google Wallet API Client library
Environment variables
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 |
How to use the code samples
-
Open the
wallet-rest-samples.csprojfile
in your .NET editor of choice. -
Copy the path to the Google Wallet API Client library (
Google.Apis.Walletobjects.v1.csprojfile) you downloaded. If needed, update
the path inwallet-rest-samples.csproj(line
19).<CodeFiles Include="lib/Google.Apis.Walletobjects.v1.cs" />
-
Build the project to install the dependencies.
-
In your C# code, import a demo class and call its method(s).