[null,null,["最后更新时间 (UTC):2025-08-29。"],[[["\u003cp\u003eUsers can search for your loyalty program and join or sign-in to their account from Google Wallet, after which they can add their loyalty card.\u003c/p\u003e\n"],["\u003cp\u003eTo implement this feature, you need to set up a test class in Google Wallet, develop enrollment/sign-in pages that use Google Wallet \u003ccode\u003eSharedDataType\u003c/code\u003e, implement push back of the loyalty card to Google Wallet after enrollment/sign-in, and finally, request verification and activation.\u003c/p\u003e\n"],["\u003cp\u003eWhen a user chooses to sign-in or enroll, they are directed to a tailored page on your website to complete the process where user data is shared via \u003ccode\u003eSharedDataType\u003c/code\u003e for a seamless experience.\u003c/p\u003e\n"],["\u003cp\u003eAfter successful enrollment or sign-in, your page should immediately push the loyalty card to Google Wallet using a specific link structure containing a JWT.\u003c/p\u003e\n"],["\u003cp\u003eTo ensure ongoing compliance and an optimal user experience, recurring checks of your implementation will be conducted.\u003c/p\u003e\n"]]],["Users can join or sign in to loyalty programs from Google Wallet, directed to a mobile-friendly website. Implementation requires: setting up a test class with enrollment/sign-in URLs and user fields, developing enrollment/sign-in pages utilizing Google Wallet's `SharedDataType` for user data, and enabling immediate loyalty card pushback to Google Wallet after sign-in/enrollment. The sign in and enrollments pages need to be mobile friendly, secure with HTTPS, and able to complete the process on one page. After development, a verification request must be submitted.\n"],null,["# User Loyalty Program enrollment\n\nThe loyalty enrollment and sign-in feature allows users to search for your\nloyalty program and join or sign-in to their account from 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 loyalty 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 enrollment and sign-in feature\nfor your loyalty program:\n\n1. Set up a test class in Google Wallet for testing your enrollment/sign-in flows.\n2. Develop enrollment/sign-in pages that use Google Wallet `SharedDataType`.\n3. Implement push back of loyalty card to Google Wallet after enrollment/sign-in.\n4. Request verification and activation.\n\nSet up a test class in Google Wallet\n------------------------------------\n\nDetermine the enrollment and sign-in URLs, your program logo, and the chosen user fields. Then,\nuse the `discoverableProgram` nested fields in the\n[`loyaltyclass`](/wallet/reference/rest/v1/loyaltyclass) to set the\nappropriate values.\n\nSet the values in the `discoverableProgram` to create a draft version of your\nenrollment/sign-in enabled loyalty 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 **Loyalty sign-in/enrollment** in\nthe subtopic.\n\nDevelop enrollment and sign-in pages that use Google Wallet user data\n---------------------------------------------------------------------\n\nWhen a user chooses to sign-in or enroll for your loyalty program,\nthey are directed to a tailored page on your website in order to complete\nthe enrollment or sign-in process. If a user chooses to enroll, Google Wallet\nwill request the user to approve sharing their user data with you.\n\nYou are required to provide one of the two pages, or both, that allow users to complete these actions.\n\n1. A sign-in URL where a user can sign in to an existing account.\n2. An enrollment URL where a user can create a new account.\n\nYour sign in and enrollment pages must meet the following requirements:\n\n- Provide a mobile-friendly user experience.\n- Minimize the number of required fields during the enrollment process.\n- Allow the user to complete sign-in or enrollment 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 and enrollment pages.\n\nIn addition to the requirements above, we recommend you allow users\nto enroll in your loyalty program without filling out any form or\nkeeping the page to just your terms of service acceptance.\n\n- By leveraging the user data provided in the `SharedDataType`, you can create an account and immediately push back their loyalty card.\n- You can subsequently email the user a one-time password, or a link to configure their password and optional account details.\n- This reduces the chance of users abandoning their enrollment process, as every additional step can lead to additional drop-out.\n\nWhen presenting the sign-in or enrollment 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\nDepending on the action chosen by the user and the fields you have specified\nto request from the user, the JSON object may contain the following fields.\n\n| Field | Enrollment |\n|---------------------|------------|\n| email | ✓ |\n| firstName | ✓ |\n| lastName | ✓ |\n| addressLine \\[1-3\\] | ✓ |\n| city | ✓ |\n| state | ✓ |\n| zipcode | ✓ |\n| country | ✓ |\n| phone | ✓ |\n\n| **Note:** None of the fields are guaranteed to have content, and your site must allow the user to continue if one or more fields are not present.\n| **Note:** If you request a field from a user, ensure that these details are used to pre-populate your form.\n\nRefer to the below for a decoded sample JSON object\ncontained in the `SharedDataType`. \n\n### Resource\n\n```resourcebundle\n{\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"addressLine1\": \"1600 Amphitheatre Pkwy\",\n \"addressLine2\": \"Apt 123\",\n \"addressLine3\": \"Attn:Jane\",\n \"city\": \"Mountain View\",\n \"state\": \"CA\",\n \"zipcode\": \"94043\",\n \"country\": \"US\",\n \"email\": \"jane.doe@example.com\",\n \"phone\": \"555-555-5555\"\n}\n```\n\nImplement immediate push back of loyalty card to Google Wallet\n--------------------------------------------------------------\n\nOnce authenticated (sign-in), or after account creation (enrollment), your page\nshould immediately push back the user's loyalty card to Google Wallet.\n| **Note:** Do not 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 loyalty card to Google Wallet by redirecting to a\nlink that follows the structure below. \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 below 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 do not 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 enrollment or 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 enrollment/sign-in flows, 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 functionality in\ncombination with the Google Wallet app, the loyalty enrollment/sign-in feature will be\npublicly launched for your loyalty program. This will allow any user to see the\nprogram and make use of this functionality.\n\nIn order to ensure an optimal user experience, recurring checks of your enrollment/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/enrollment functionality\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 loyalty program?**\n - Yes, your images should be hosted on `HTTPS` location as they will not 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)."]]