0

It looks like it's all right, but Add the token to the Google Pay link, the Pass Add button on Google Wallet is not generated. Could verify if the token is correctly formatted and compatible with the Google Wallet API?

google wallet error

My code:

const jwt = require('jsonwebtoken');
const serviceAccount = require('./credenciais/project-brantes1327-329d887ab0e4.json');

const claims = {
    iss: serviceAccount.client_email,
    aud: 'google',
    typ: 'savetowallet',
    payload: {
        genericClasses: [
            {
                "id": "id_abc",
                "issuerName": "Lorem Ipsum",
                "title": "Lorem Ipsum",
                "reviewStatus": "UNDER_REVIEW",
                "logo": {
                    "sourceUri": {
                        "uri": "/img/eb_logo.png"
                    }
                },
                "classTemplateInfo": {
                    "cardTemplateOverride": {
                        "cardRowTemplateInfos": [
                            {
                                "twoItems": {
                                    "startItem": {
                                        "firstValue": {
                                            "fields": [
                                                {
                                                    "fieldPath": "object.textModulesData['titulo']"
                                                }
                                            ]
                                        }
                                    },
                                    "endItem": {
                                        "firstValue": {
                                            "fields": [
                                                {
                                                    "fieldPath": "object.textModulesData['subtitulo']"
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        ]
                    },
                    "detailsTemplateOverride": {
                        "detailsItemInfos": [
                            {
                                "item": {
                                    "firstValue": {
                                        "fields": [
                                            {
                                                "fieldPath": "class.imageModulesData['banner']"
                                            }
                                        ]
                                    }
                                }
                            },
                            {
                                "item": {
                                    "firstValue": {
                                        "fields": [
                                            {
                                                "fieldPath": "class.textModulesData['detalhes']"
                                            }
                                        ]
                                    }
                                }
                            },
                            {
                                "item": {
                                    "firstValue": {
                                        "fields": [
                                            {
                                                "fieldPath": "class.linksModuleData.uris['site_oficial']"
                                            }
                                        ]
                                    }
                                }
                            }
                        ]
                    }
                },
                "imageModulesData": [
                    {
                        "id": "banner",
                        "mainImage": {
                            "sourceUri": {
                                "uri": "/img/banner_certific.png"
                            },
                            "contentDescription": {
                                "defaultValue": {
                                    "language": "en-US",
                                    "value": "Lorem ipsum dolor sit amet"
                                }
                            }
                        }
                    }
                ],
                "textModulesData": [
                    {
                        "id": "detalh",
                        "header": "Lorem Ipsum",
                        "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
                    }
                ],
                "linksModuleData": {
                    "uris": [
                        {
                            "id": "site_oficial",
                            "uri": "https://exempl.com/certific",
                            "description": "Lorem ipsum dolor sit amet"
                        }
                    ]
                }
            }
        ],
        genericObjects: [
            {
                "id": "id_gen",
                "classId": "id_abc",
                "generic": {
                    "issuerName": "Lorem Ipsum",
                    "title": "Lorem Ipsum",
                    "notificationIcon": "/img/logo_web.png",
                    "headerArea": {
                        "logoImage": "img/b_logo.png",
                        "issuerName": "Lorem Ipsum",
                        "passName": "Lorem Ipsum"
                    },
                    "primaryFields": [
                        {
                            "label": "Name",
                            "value": "Lorem ipsum dolor sit amet"
                        },
                        {
                            "label": "Tip",
                            "value": "Lorem ipsum"
                        }
                    ],
                    "secondaryFields": [
                        {
                            "label": "RA",
                            "value": "123456789"
                        },
                        {
                            "label": "CPF",
                            "value": "000.000.000-00"
                        }
                    ],
                    "barcode": {
                        "type": "qrCode",
                        "value": "https://exemplo.com/qr",
                        "alternateText": "Lorem Ipsum"
                    },
                    "stringImageArea": {
                        "stripImage": "/img/a_logo.png"
                    },
                    "linksModuleData": {
                        "uris": [
                            {
                                "uri": "https://exempl.com/qr",
                                "description": "Lorem ipsum dolor"
                            }
                        ]
                    },
                    "logo": {
                        "sourceUri": {
                            "uri": "/img/logo.png"
                        }
                    },
                    "textModulesData": [
                        {
                            "header": "Situa",
                            "body": "Lorem ipsum dolor sit amet"
                        },
                        {
                            "header": "Filia",
                            "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
                        },
                        {
                            "header": "Lorui sjasd",
                            "body": "Lorem ipsum, 01/01/2000"
                        },
                        {
                            "header": "Info Compl",
                            "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
                        },
                        {
                            "header": "CΓ³digo hash",
                            "body": "abcdef123456"
                        },
                        {
                            "header": "Expedido(a) em",
                            "body": "01/01/2000"
                        }
                    ]
                }
            }
        ]
    }
};

const token = jwt.sign(claims, serviceAccount.private_key, { algorithm: 'RS256' });
console.log("Token JWT for Google Wallet:");
console.log(token);

What am I doing wrong?

0

Your Answer

By clicking β€œPost Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.