[null,null,["最后更新时间 (UTC):2025-08-29。"],[[["\u003cp\u003eUpdate objects/classes to include value-added opportunity modules, displayed on details pages and linking to issuer content.\u003c/p\u003e\n"],["\u003cp\u003eModules require a header, body, image, URI, display interval, and sort index, allowing customization of appearance and behavior.\u003c/p\u003e\n"],["\u003cp\u003eUp to 10 modules can be added per object/class, prioritizing object modules and filtering by view constraints.\u003c/p\u003e\n"],["\u003cp\u003eEnsure modules are actionable with appropriate language and imagery, prioritizing based on importance and relevance, and keeping them active.\u003c/p\u003e\n"],["\u003cp\u003eValue-added modules enhance user experience by providing clickable links to additional actions and content related to the pass.\u003c/p\u003e\n"]]],["To integrate value-added modules, update objects/classes with `ValueAddedModuleData`, defining a header, body, image, and URI. Modules are displayed based on `ModuleViewConstraints`, particularly `displayInterval`, and `sortIndex`. Each module must have a header and URI. You can add up to ten modules per class/object, but only ten will display. Prioritize active, actionable modules with relevant imagery, managing their display through `displayInterval` or by adding/removing them.\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/gift-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/gift-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. |"]]