Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Sau khi tạo thẻ và vé và mã hoá thẻ/vé đó trong JWT đã ký, bạn có thể cấp thẻ/vé ở bất cứ đâu trong phần "Thêm vào Google Wallet" được hỗ trợ. Để thực hiện việc này, bạn sẽ hiển thị cho người dùng của mình một 'Thêm vào Google Wallet' hoặc đường siêu liên kết để lưu thẻ và vé vào Google Wallet khi họ nhấn vào. Ví dụ về nơi bạn có thể sử dụng phương thức này bao gồm trang web, email, SMS và nhiều nơi khác.
Điều kiện tiên quyết
Trước khi cố gắng phát hành thẻ và vé, hãy nhớ làm như sau:
1. Tạo một "Thêm vào Google Wallet" đường liên kết
Phát hành thẻ và vé bằng "Google Wallet" Đường liên kết này sẽ thêm Đối tượng thẻ và vé vào Google Wallet của người dùng. Việc này chỉ có thể được thực hiện trong bối cảnh danh tính của người dùng đã đăng nhập vào Google.
Đường liên kết này có thể được nhúng vào các trang web, email, trò chuyện, SMS hoặc bất kỳ nơi nào khác có hỗ trợ siêu liên kết.
Để biết thêm thông tin về cách tạo lớp thẻ và vé, hãy xem bài viết Tạo lớp thẻ và vé.
Để biết thêm thông tin về cách tạo JWT đã ký, bạn cần phải tạo một "Thêm vào Google Wallet" hãy xem bài viết Làm việc với mã thông báo web JSON.
2. (Được đề xuất) Sử dụng nút "Thêm vào Google Wallet" nút
Đối với mọi nền tảng hỗ trợ hình ảnh siêu liên kết, chẳng hạn như trang web và email, bạn nên trình bày nút "Thêm vào Google Wallet" liên kết với người dùng của bạn bằng một nút "Thêm vào Google Wallet" . Đối với người dùng Google Wallet, nút này là một lời nhắc quen thuộc và có thể được nhận ra như là một cách để bắt đầu thêm thẻ và vé vào Google Wallet.
Bạn có thể tải thành phần hình ảnh xuống theo nhiều hướng và bằng nhiều ngôn ngữ để hỗ trợ việc tích hợp API Google Wallet.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-29 UTC."],[[["\u003cp\u003eGoogle Wallet Passes are issued to users via an 'Add to Google Wallet' link, which is a dynamically generated URL containing an encoded and signed JWT.\u003c/p\u003e\n"],["\u003cp\u003eThis link can be embedded in various platforms like websites, emails, SMS, and more, allowing users to easily 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 for better user experience and recognition.\u003c/p\u003e\n"],["\u003cp\u003eBefore issuing passes, ensure completion of onboarding steps, creation of Passes Class and Object, encoding in a JWT, and signing with your service account key.\u003c/p\u003e\n"],["\u003cp\u003eDemo mode passes will have "[TEST ONLY]" in the title, which is removed after publishing access is granted.\u003c/p\u003e\n"]]],["After creating and encoding a pass in a signed JWT, you can issue it via an 'Add to Google Wallet' link or button on websites, emails, or SMS. This link, a dynamically generated URL containing the signed JWT, directs users to save the pass to their Google Wallet. Before issuing, complete onboarding, create Passes Classes and Objects, encode, and sign your JWT. Demo passes have a \"[TEST ONLY]\" label. The maximum safe length for the JWT is 1800 characters.\n"],null,["# Issuing passes for web, email, SMS\n\nOnce 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-------------\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\n----------------------------------------\n\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/retail/gift-cards/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/retail/gift-cards/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/retail/gift-cards/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/retail/gift-cards/web/jwt).\n\n2. (Recommended) Use the 'Add to Google Wallet' button\n------------------------------------------------------\n\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/retail/gift-cards/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/retail/gift-cards/resources/brand-guidelines)"]]