google-api-nodejs-client
google-api-nodejs-client copied to clipboard
Add Google Pay Passes API
The Google Pay Passes API is missing from the discovery index. Is it possible to add it?
https://walletobjects.googleapis.com/$discovery/rest?version=v1
We are also trying to develop for passes using nodejs. Is there a recommended library to use in this case or workarounds?
Hi, would someone be able to add it to the index? Would be great!
In the meantime, I generated the class using this repository's generators. If you'd like to use it, it's a standalone file. Just copy it to your project.
https://github.com/Segfaultd/google-api-nodejs-client/blob/master/src/apis/walletobjects/v1.ts
And for sample usage:
import { google } from 'googleapis';
import { walletobjects_v1 } from '@app/Utils/Services/Google/GoogleWalletObjects'; //REPLACE: With path to the previously downloaded file from my repo
import Walletobjects = walletobjects_v1.Walletobjects;
export default class MerchantCenterService {
private static _instance: MerchantCenterService;
private _walletObjects: Walletobjects;
constructor() {
const auth = new google.auth.GoogleAuth({
keyFile: `${__dirname}/../Credentials/google/passes_service_account.json`, //REPLACE: with path to your service account file
scopes: ['https://www.googleapis.com/auth/wallet_object.issuer'],
});
this._walletObjects = new Walletobjects({
auth,
});
}
public static getInstance = () => {
if (!MerchantCenterService._instance) {
MerchantCenterService._instance = new MerchantCenterService();
}
return MerchantCenterService._instance;
};
public getLoyaltyCards = () => {
this._walletObjects.loyaltyclass.list({issuerId: '<YOUR_ISSUER_ID>'}).then(res => {
console.log(res);
}).catch(err => console.error(err));
};
}
MerchantCenterService.getInstance().getLoyaltyCards();
@Segfaultd can you give an example related to how to create the pass.
When will this package support Passes API?
Any update on this?
When will this package support Passes API?