对多个卡券分组
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
使用分组 ID
默认情况下,将多个卡券添加到单个卡券
添加到 Google 钱包链接不会将这些卡券归入
用户的 Google 钱包应用。不过,您可以通过
请确保它们均具有相同的分组 ID。已分组的卡券将一起显示
。选择一组卡券后,每张卡券
可在轮播界面中展示
卡券可归为一组:
要向组添加卡券,groupingInfo.groupingId
属性
传递对象。所有通过
即使“groupingId
”值被自动归为一组,系统也会自动将其归为一组
它们是单独添加的
以下示例展示了如何将会员卡和优惠组合到一起
吸引用户在下一次购买中同时使用这两种工具。
loyaltyObject = {
"classId": "ISSUER_ID.GIFT_CARD_CLASS_SUFFIX",
"id": "ISSUER_ID.GIFT_CARD_OBJECT_SUFFIX",
"state": "ACTIVE",
"groupingInfo": {
# Note the same groupingId value
"groupingId": "combinedGiftCardAndOfferId",
"sortIndex": 1
},
"barcode": {
"type": "QR_CODE",
"value": "QR code"
},
"accountId": "Account id",
"accountName": "Account name",
"loyaltyPoints": {
"label": "Points",
"balance": {
"int": 800
}
}
}
offerObject = {
"classId": "ISSUER_ID.OFFER_CLASS_SUFFIX",
"id": "ISSUER_ID.OFFER_OBJECT_SUFFIX",
"state": "ACTIVE",
"groupingInfo": {
# Note the same groupingId value
"groupingId": "combinedGiftCardAndOfferId",
"sortIndex": 2
},
"barcode": {
"type": "QR_CODE",
"value": "QR code",
},
}
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-09-26。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-26。"],[],["Passes in Google Wallet can be grouped by assigning them a shared `groupingId`. This can be done during the initial provisioning or later using `update` or `patch` methods. Setting the `groupingInfo.groupingId` property in each pass object ensures they are grouped. Passes with the same `groupingId` appear together in the user's wallet and are shown on a carousel when selected. The example shows a loyalty card and an offer using \"combinedGiftCardAndOfferId\" to be grouped.\n"]]