[null,null,["最后更新时间 (UTC):2025-08-29。"],[[["\u003cp\u003eGift Card enrollment allows users to add gift cards to Google Wallet via a mobile-friendly website sign-in process.\u003c/p\u003e\n"],["\u003cp\u003eImplementing this feature involves setting up a test class, developing sign-in pages, enabling immediate gift card push back, and requesting verification.\u003c/p\u003e\n"],["\u003cp\u003eYour sign-in page must be mobile-friendly, secure, and capable of completing sign-in within a single page, with at least 99.9% uptime.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Wallet provides user data in a Base64 encoded JSON object within the \u003ccode\u003eSharedDataType\u003c/code\u003e parameter, requiring proper handling and decoding on your sign-in page.\u003c/p\u003e\n"],["\u003cp\u003eAfter implementation and testing, submit a request for verification and activation through the Google Pay and Wallet Console to launch the feature publicly.\u003c/p\u003e\n"]]],["To enable gift card sign-in for Google Wallet, first set up a test class in Google Wallet, defining the sign-in URL and program logo. Next, develop a mobile-friendly sign-in page using `HTTPS`, that accepts `SharedDataType` via a `POST` request. After sign-in, immediately push the gift card to Google Wallet via a specific URL structure containing a JWT. Finally, request verification via the Google Pay and Wallet Console to launch the feature and maintain compliance.\n"],null,["# User Gift Card enrollment\n\nThe Gift Card enrollment (sign-in) feature allows users to search for a\ngift card and add it to the Google Wallet.\nUsers will be directed to your mobile-friendly website to complete the\nprocess, after which they can add their card to Google Wallet.\n\nThis guide provides an overview of the implementation steps required\nto enable your gift card program for this feature.\n\nOverview\n--------\n\nTo get started, make sure you have previously set up your project and have access to\nGoogle Wallet API.\n\nYou must follow these four steps to implement the sign-in feature\nfor your gift card program:\n\n1. Set up a test class in Google Wallet for testing your sign-in flow.\n2. Develop sign-in pages that use Google Wallet `SharedDataType`.\n3. Implement push back of gift card to Google Wallet after sign-in.\n4. Request verification and activation.\n\nSet up a test class in Google Wallet\n------------------------------------\n\nDetermine the sign-in URL, your program logo. Then,\nuse the `discoverableProgram` nested fields in the\n[`giftcardclass`](/wallet/reference/rest/v1/giftcardclass) to set the\nappropriate values.\n\nSet the values in the `discoverableProgram` to create a draft version of your\nsign-in enabled gift card program. To make sure this is visible to testers, verify that\nthe testers have access to your Google Pay and Wallet Console. For details on how to share your\nGoogle Pay and Wallet Console's access with other people, see\n[Learn about the Users page](https://support.google.com/googlepay/businessconsole/answer/10878869#zippy=%2Cinvite-a-new-user).\n\nTo complete the verification of your implementation's functionality during the development\nprocess, reach out to us using the contact support widget in the Google Pay and Wallet Console. While in\nthe console, select **Google Wallet API** in the topic, and select **Gift card sign-in** in\nthe subtopic.\n\nDevelop sign-in page that use Google Wallet user data\n-----------------------------------------------------\n\nWhen a user chooses to add your gift card,\nthey are directed to a tailored page on your website in order to complete\nthe sign-in process.\n\nYou are required to provide a sign-in URL where a user can sign\nin to an existing account.\n\nYour sign in page must meet the following requirements:\n\n- Provide a mobile-friendly user experience.\n- Allow the user to complete sign-in within one single page.\n- Use `HTTPS` encryption with a valid certificate to ensure user data is transmitted securely.\n- Ensure at least 99.9% uptime of your sign-in page.\n\nWhen presenting the sign-in page, Google Wallet will create\nan Android WebView and a `POST` request is made to your provided\nURL. User data is provided in the parameter `SharedDataType`\nwhich is included in the `POST` request using\nthe [application/x-www-form-urlencoded](https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1) content type and\n`UTF-8` encoding. The value of the `SharedDataType`\nparameter is a Base64 encoded JSON object.\n| **Note:** The JSON string is first UTF-8 encoded and subsequently encoded using [android.util.Base64](https://developer.android.com/reference/android/util/Base64.html) with the options NO_WRAP and URL_SAFE. This corresponds with [RFC 3548 section 4](https://tools.ietf.org/html/rfc3548#section-4).\n\nImplement immediate push back of gift card to Google Wallet\n-----------------------------------------------------------\n\nOnce authenticated (sign-in), your page\nshould immediately push back the user's gift card to Google Wallet.\n| **Note:** Don't implement a Google Wallet API button as users should be taken back to Google Wallet without additional user interaction.\n\nYou can push back the gift card to Google Wallet by redirecting to a\nlink that follows the structure \n\n```\nhttps://pay.google.com/gp/v/save/{jwt_generated}\n```\n| **Note:** Make sure to include the trailing '/' in the URL before the JWT.\n| **Note:** JWTs are unencrypted. Only include data in the deep link that is safe to share as plain text.\n\nThe safe length for a URL is 2000 characters. Your links should\nremain under this limit. Objects encoded in JWTs should be small, containing only\ndata that is specific to the user. Try to keep most data in the object's class,\ncreating it before making the JWT. For larger objects that don't fit the limit, consider\nfirst creating the object in the\n**Google Wallet API** and sending only the object ID in the JWT.\n\nTypical Communication Flow\n--------------------------\n\nThe communication flow for a user completing sign-in is illustrated in the\nfollowing image. All actions between \"Your Server\" are your responsibility to implement.\n\nRequest verification and activation\n-----------------------------------\n\nAfter you complete the development work and test your sign-in flow, submit a request\nthrough the\n[Google Pay and Wallet Console](https://pay.google.com/business/console/) contact support\nwidget.\n\nAfter a full review of your implementation that confirms correct feature in\ncombination with the Google Wallet app, the gift card sign-in feature will be\npublicly launched for your gift card program. This will allow any user to see the\nprogram and make use of this feature.\n\nIn order to ensure an optimal user experience, recurring checks of your sign-in\nimplementation will be conducted to ensure ongoing compliance with the feature requirements.\nYou will be notified in the event of discrepancies and the sign-in feature\nmay be disabled until the issue is resolved.\n\nFrequently Asked Questions\n--------------------------\n\n- **Are there any requirements for the images used in my gift card program?**\n - Yes, your images should be hosted on `HTTPS` location as they won't be visible in Google Wallet otherwise.\n- **Are there any tools that simplify the implementation and debugging of JWTs?**\n - Yes, platforms such as [www.jwt.io](https://jwt.io/) allow you to decode and debug your tokens during your development process, allowing you to verify the content you are submitting. Do note that Google has no affiliation and does not specifically recommend any of such third parties.\n- **How do we correctly handle the Base64 encoded SharedDataType data?**\n - Ensure that you are using UTF-8 encoding throughout your process. The JSON string is first UTF-8 encoded and subsequently encoded using [android.util.Base64](https://developer.android.com/reference/android/util/Base64.html) with the options NO_WRAP and URL_SAFE. This corresponds with [RFC 3548 section 4](https://tools.ietf.org/html/rfc3548#section-4)."]]