[null,null,["最后更新时间 (UTC):2025-08-29。"],[[["\u003cp\u003eGoogle Wallet now allows adding clickable modules to objects and classes to link to external content, enhancing user engagement.\u003c/p\u003e\n"],["\u003cp\u003eThese modules, configured using the \u003ccode\u003eValueAddedModuleData\u003c/code\u003e field, can include a header, body, image, and a clickable URI leading to web or deep links.\u003c/p\u003e\n"],["\u003cp\u003eModules can be customized with display intervals and sorting indexes for optimized visibility and user experience.\u003c/p\u003e\n"],["\u003cp\u003eYou can add up to 10 modules per object/class, with object modules prioritized, ensuring relevant content is displayed on the pass.\u003c/p\u003e\n"],["\u003cp\u003eEnsure modules have clear language, relevant imagery, and active display intervals for optimal user interaction.\u003c/p\u003e\n"]]],["To implement value-added modules in Google Wallet, update objects/classes with `ValueAddedModuleData`. Each module requires a header, URI, optional body, image, and view constraints. Define display timeframes using `displayInterval` and prioritize modules with `sortIndex`. Modules are displayed on the pass's details page, linking to external content via the provided URI. Manage module visibility using `displayInterval`, or by adding/removing from the class or object. Ten modules can be defined, but only ten will be shown.\n"],null,["# Value Added Opportunities\n\nBackground\n----------\n\n\nYou can now update objects and classes to include value added opportunity modules. Modules will be\ndisplayed on the details page and can link to issuer content. This document walks through the\nkey steps required to enable and use modules using the Google Wallet API.\n| **Note:** For gift cards, loyalty cards, and offers we also support an automatic integration with [Shopping Merchant Center](https://www.google.com/retail/).\n\n### Feature example\n\n|-------------|-----------|\n| | |\n| Single view | List view |\n\n**The following guide assumes you are familiar with the basic concepts of Google Wallet and have already\ncompleted the recommended\n[prerequisites](/wallet/retail/loyalty-cards/getting-started/onboarding-guide).\nSend any questions or feedback to your Google Wallet POC.**\n\nIntegration Steps\n-----------------\n\n\nTo add a new module you will need to update the object and/or class to include\n[ValueAddedModuleData](/wallet/retail/loyalty-cards/rest/v1/ValueAddedModuleData).\nValueAddedModuleData has the following fields:\n\n### **\\[Required\\] LocalizedString header**\n\nThe header displayed on the module. Character limit is 60 and longer strings will be truncated. \n\n### **LocalizedString body**\n\nThe body displayed on the module. Character limit is 50 and longer strings will be truncated. \n\n### **Image image**\n\nThe image displayed on the module. The recommended image ratio is 1:1 and images will be resized to fit this ratio. \n\n### **\\[Required\\] string uri**\n\nThe URI that the module leads to when clicked. This can be a web link or a [deep link.](https://developer.android.com/training/app-links/deep-linking). \n\n### **ModuleViewConstraints viewConstraints**\n\nConstraints that all must be met for the module to be shown. ModuleViewConstraints has the following field: \n\n### **TimeInterval displayInterval**\n\nThe period of time that the module will be displayed to users. Can define both a \\`startTime\\` and \\`endTime\\`. The module is displayed immediately after insertion unless a \\`startTime\\` is set. The module is displayed indefinitely if \\`endTime\\` is not set. \n\n### **int32 sortIndex**\n\nThe index for sorting the modules. Modules with a lower sort index are shown before modules with a higher sort index. If unspecified, the sort index is assumed to be INT_MAX. For two modules with the same index, the sorting behavior is undefined. \n\n### **Example ValueAddedModuleData:**\n\n```scdoc\n {\n \"valueAddedModuleData\": [\n {\n \"header\": {\n \"defaultValue\": {\n \"language\": \"en-US\",\n \"value\": \"10% off merch\"\n }\n },\n \"body\": {\n \"defaultValue\": {\n \"language\": \"en-US\",\n \"value\": \"Shirts, caps, mugs, and more\"\n }\n },\n \"image\": {\n \"sourceUri\": {\n \"uri\": \"http://www.images.google.com/opportunity\"\n }\n },\n \"uri\": \"http://www.google.com/opportunity\",\n \"viewConstraints\": {\n \"displayInterval\": {\n \"start\": {\n \"date\": \"2024-08-01T18:30:00\"\n },\n \"end\": {\n \"date\": \"2025-08-01T18:30:00\"\n }\n }\n },\n \"sortIndex\": 0\n },\n {\n \"header\": {\n \"defaultValue\": {\n \"language\": \"en-US\",\n \"value\": \"10% off concessions\"\n }\n },\n \"uri\": \"http://www.google.com/new_opportunity\"\n }\n ]\n }\n```\n| **Note:** You can add up to ten modules to the object and up to ten modules in the class. However, a max of ten modules will be displayed on the pass. We will prioritize the modules from the object filtering out those that don't meet the view constraints.\n\nExpected Behavior\n-----------------\n\n\nAfter successfully updating the object and/or class you will now see modules on the corresponding\npass. If you have added only one module you will see it on the front of the pass. \n\nGuidelines on Value Added Opportunity Modules\n---------------------------------------------\n\n\nModules are opportunities for you to augment your user's pass experience with additional actions.\nYou should consider the following when creating and managing the modules:\n\n- Modules should be defined with appropriate language to indicate that they are actionable to help users understand that these modules are clickable.\n- Modules should have the appropriate imagery defined that is related to the specific module.\n- You are in control of the modules and should proactively manage the prioritization of the module depending on the importance and relevance.\n- You should only show users modules that are active. You can control this by setting the displayInterval on the module or proactively adding or removing it from the class or object.\n\nException handling\n------------------\n\n| **Message** | **Reason** |\n|-------------------------------------------------------------|-----------------------------------------------------|\n| ValueAddedModuleData must contain a header. | ValueAddedModuleData does not have a header. |\n| ValueAddedModuleData must contain a non-empty URI. | ValueAddedModuleData does not have a non-empty URI. |\n| A maximum of 10 value added modules are allowed per class. | Need to reduce value added modules on the class. |\n| A maximum of 10 value added modules are allowed per object. | Need to reduce value added modules on the object. |"]]