Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Po utworzeniu karty i zakodowaniu jej w podpisanym tokenie JWT możesz ją wysłać wszędzie tam, gdzie przycisk „Dodaj do Portfela Google” jest obsługiwany. Aby to zrobić, musisz wyświetlić użytkownikowi opcję „Dodaj do Portfela Google” przycisk lub hiperlink, który zapisuje kartę w Portfelu Google, gdy użytkownik jej dotknie. Ta metoda może być używana na przykład w przypadku stron internetowych, e-maili czy SMS-ów.
Wymagania wstępne
Zanim spróbujesz wystawić dokument, wykonaj te czynności:
Podpisz token JWT za pomocą klucza konta usługi Google Cloud.
1. Utwórz opcję „Dodaj do Portfela Google” połącz
Wystawianie karty za pomocą „Portfela Google” dodaje obiekt Karty do Portfela Google użytkownika. Można go zainicjować tylko w kontekście tożsamości Google, na której użytkownik jest zalogowany.
Ten link można umieścić na stronach internetowych, w e-mailach, na czacie, w SMS-ach i w innych miejscach, które obsługują hiperlinki.
Więcej informacji o tworzeniu klas i obiektów kart kart znajdziesz w artykule Tworzenie klas i obiektów kart (w języku angielskim).
Więcej informacji o tym, jak utworzyć podpisany token JWT wymagany do utworzenia opcji „Dodaj do Portfela Google” link, zapoznaj się z artykułem Working with JSON Web Tokens (Praca z tokenami internetowymi JSON).
2. (Zalecane) Użyj opcji „Dodaj do Portfela Google” przycisk
Na wszystkich platformach obsługujących hiperlinki, takich jak strony internetowe i e-maile, zalecamy wyświetlanie przycisku „Dodaj do Portfela Google”. link do konta użytkowników za pomocą opcji „Dodaj do Portfela Google” Przycisk Dla użytkowników Portfela Google ten przycisk to dobrze znany komunikat i rozpoznawalny sposób rozpoczęcia dodawania karty do Portfela.
Komponenty z obrazem można pobrać w różnych orientacjach i językach, aby ułatwić integrację interfejsu API Portfela Google.
[null,null,["Ostatnia aktualizacja: 2025-08-17 UTC."],[[["\u003cp\u003eIssue passes to users through an 'Add to Google Wallet' link, which is a dynamically generated URL containing an encoded and signed JWT.\u003c/p\u003e\n"],["\u003cp\u003eThe 'Add to Google Wallet' link can be embedded in various platforms like websites, emails, and SMS, enabling users to save the pass to their Google Wallet.\u003c/p\u003e\n"],["\u003cp\u003eIt's recommended to present the link using the 'Add to Google Wallet' button, providing a familiar and recognizable prompt for users.\u003c/p\u003e\n"],["\u003cp\u003eBefore issuing passes, complete the onboarding process, create a Passes Class and Object, encode them in a JWT, and sign it with your Google Cloud service account key.\u003c/p\u003e\n"],["\u003cp\u003eDemo passes will have "[TEST ONLY]" in the title until you are granted publishing access.\u003c/p\u003e\n"]]],["To issue a pass, present users with an 'Add to Google Wallet' button or hyperlink, which saves the pass upon tapping. This link, formatted as `https://pay.google.com/gp/v/save/\u003csigned_jwt\u003e`, contains an encoded and signed JWT and can be used on websites, email, or SMS. Prerequisites include completing onboarding, creating pass classes and objects, encoding, and signing a JWT. During demo mode, passes display \"[TEST ONLY]\" until publishing access is granted.\n"],null,["Once you've created a pass and encoded it in a signed JWT, you are ready to issue it anywhere that the 'Add to Google Wallet' link is supported. To do this, you will present your user with an 'Add to Google Wallet' button or a hyperlink, which will save the pass to their Google Wallet once they tap it. Examples of where you might use this method include websites, email, SMS, and more.\n| **Demo Mode / \\[TEST ONLY\\] passes**\n|\n| When you are still in [Demo Mode](../resources/terminology#demo-mode), all the passes that you create will have an additional text \"\\[TEST ONLY\\]\" in the title. This is to differentiate demo passes from live passes. Once you are granted [publishing access](../test-and-go-live/request-publishing-access), these demo mode passes will no longer have the additional text when the user reopens the wallet app on a connected device.\n\nPrerequisites\n\nBefore you try to issue a pass, be sure you do the following:\n\n- Complete all of the steps in the [Onboarding guide](../getting-started/onboarding-guide).\n- Create at least one [Passes Class](../use-cases/create#creating_a_passes_class).\n- Create at least one [Passes Object](../use-cases/create#creating_a_passes_object).\n- [Encode](../use-cases/jwt#encoding-a-pass-in-a-jwt) your Passes Class and Passes Object in a JWT.\n- [Sign](../use-cases/jwt#web,-email,-and-sms) your JWT with your Google Cloud service account key.\n\n1. Create an 'Add to Google Wallet' link \nIssuing a pass with an 'Google Wallet' link adds the Passes Object to a user's Google Wallet, and can only be initiated in the context of a logged-in Google identity.\n\nThe 'Add to Google Wallet' link is a dynamically generated URL that contains an [encoded and signed JSON Web Token (JWT)](/wallet/generic/web/jwt).\n\nThe Add to Google Wallet link has the following format: \n\n```\nhttps://pay.google.com/gp/v/save/\u003csigned_jwt\u003e\n```\n\nFor example, a fully-formed 'Add to Google Wallet' link will look something like this: \n\n```\nhttps://pay.google.com/gp/v/save/eyJhbGci6IkpXVCJ9.eyJhdWQiO...6EkC1Ahp6A\n```\n\nThis link can be embedded into websites, email, chat, SMS, or anywhere else that supports hyperlinks.\n| The safe length of an encoded JWT is 1800 characters. If your JWT is less than this limit, the entire object can be included in the signed JWT. If the length is over 1800 characters, the save may not work due to truncation by web browsers. See this [FAQ](/wallet/generic/resources/faq#my-jwt-link-url-exceeds-the-1800-character-limit-browser-restriction.-what-should-i-do) for more info.\n\nFor more information on creating Passes Classes and Passes Objects, see [Create Passes Classes and Passes Objects](/wallet/generic/web/create).\n\nFor more information on how to create the signed JWT needed to create an 'Add to Google Wallet' link, see [Working with JSON Web Tokens](/wallet/generic/web/jwt).\n\n2. (Recommended) Use the 'Add to Google Wallet' button \nFor any surfaces that support hyperlinking images, such as websites and email, it is recommended to present the 'Add to Google Wallet' link to your users with an 'Add to Google Wallet' button. For Google Wallet users, the button is a familiar prompt that is recognizable as a way to initiate adding a pass to their Google Wallet.\n- \n- \n\n[Image assets](/wallet/generic/resources/brand-guidelines) are available to download in a variety of orientations and languages to support your Google Wallet API integration.\n\n[Download the 'Add to Google Wallet' button](/wallet/generic/resources/brand-guidelines)"]]