兌換活動票券
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
票證可透過以下兩種方式兌換:
您可以選擇在使用者兌換或存取票證時,要求額外的安全性。詳情請參閱「使用螢幕鎖定功能保護裝置」。
NFC 感應功能
使用者可使用 NFC 感應功能輕鬆兌換卡片。進一步瞭解智慧感應功能,並申請使用智慧感應功能。
條碼掃描
您可以附上條碼,協助客戶掃描自己的票證。
靜態條碼
您可以設定 object.barcode
顯示靜態條碼。API 提供多種條碼類型。詳情請參閱 Barcode
類型。
輪替條碼
為了提升安全性,您可以設定 object.rotatingBarcode
顯示旋轉的條碼。輪替條碼看起來與一般條碼類似,但會定時變更 (通常是每分鐘變更),並且終端機/讀取工具程式會設定為只接受最新的條碼。這種做法可降低條碼螢幕截圖帶來的風險,尤其是竊取票券或未經授權的票券轉售。詳情請參閱 RotatingBarcode
類型。
安全性動畫
另一個防止螢幕截圖濫用行為的方法是顯示條碼安全動畫,後者支援人為驗證票證。
安全性動畫的實體資訊清單是圍繞票證條碼周圍的外框輪廓。只有在裝置處於移動狀態時,才會觸發這個閃爍的動畫,因此使用者必須傾斜裝置,才能測試票證的有效性。另一隻手持裝置則仍然只會循環播放彩色安全性動畫。
如要為票證啟用安全性動畫,請在票證類別中,將 SecurityAnimation
欄位的 AnimationType
設為 FOIL_SHIMMER
。
請參閱下方的圖 1,瞭解啟用安全性動畫後會如何顯示:
圖 1.
使用螢幕鎖定功能保護裝置
為保護客戶的票證存取權,你可以要求他們每次新增或存取票證時,都必須使用螢幕鎖定功能。方法是設定 class.viewUnlockRequirement
。詳情請參閱 ViewUnlockRequirement
類型。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[null,null,["上次更新時間:2025-08-29 (世界標準時間)。"],[[["\u003cp\u003ePasses can be redeemed via NFC tap or barcode scan, offering users flexible options.\u003c/p\u003e\n"],["\u003cp\u003eRotating barcodes and security animations enhance security by mitigating risks like ticket theft and unauthorized resale.\u003c/p\u003e\n"],["\u003cp\u003ePasses can include a screen lock requirement for added security, protecting customer access.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers have access to various barcode types and customization options through the API, enabling them to tailor the pass experience.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Pay's Smart Tap technology facilitates seamless redemption through NFC.\u003c/p\u003e\n"]]],["Passes can be redeemed via NFC tap or barcode scan. For barcodes, options include static or rotating types, with rotating barcodes enhancing security by changing regularly. An optional security animation, a shimmering effect triggered by device motion, further validates pass authenticity. Extra security can be added by requiring a screen lock each time a user accesses or adds a pass, configured via `class.viewUnlockRequirement`. The barcode can be added by setting `object.barcode`.\n"],null,["# Redeem an Event ticket\n\nPasses can be redeemed in either of two ways:\n\n- [NFC tap](#use-nfc-tap)\n- [Barcode scan](#use-barcode-scan)\n\nYou can optionally require extra security when users redeem or access their pass. For details,\nsee [Protect with Screen Lock](#protect-with-screen-lock).\n\nNFC tap\n-------\n\nYour users can seamlessly redeem their cards using an NFC tap. Learn more about\n[Smart Tap](/wallet/smart-tap), and\n[sign up](https://support.google.com/pay/merchants/contact/smart_tap_support) for Smart\nTap.\n\nBarcode scan\n------------\n\nHelp your customers scan their Pass by attaching a barcode.\n\n### Static barcode\n\nYou can display a static barcode by setting `object.barcode`.\nThe API provides a variety of barcode types. For more details, see the\n[`Barcode` type](/wallet/tickets/events/rest/v1/Barcode).\n\n### Rotating barcode\n\n\nFor additional security, you can display a rotating barcode by setting\n`object.rotatingBarcode`. Rotating barcodes look just like regular barcodes but\nchange periodically, typically every minute, and the terminal/reader is programmed to only\naccept the most recent one. This reduces the risks associated with barcode screenshotting, in\nparticular ticket theft or unauthorized ticket resale. For more details, see the\n[`RotatingBarcode` type](/wallet/tickets/events/rest/v1/RotatingBarcode).\n\n### Security animation\n\n\nAnother way to prevent screenshot abuse is by displaying the barcode security animation, which\nsupports human-verification of a pass.\n\n\nThe physical manifestation of a security animation is a shimmering outline around the barcode of\nthe pass. This shimmering animation triggers only when the device is in motion so one can test\nthe pass' validity by tilting the device. On the other hand holding the device still will only\nanimate the colorful security animation in loop.\n\n\nTo enable security animation for a pass, in the pass class, set the [`SecurityAnimation`](/wallet/tickets/events/rest/v1/SecurityAnimation)\nfield's [`AnimationType`](/wallet/tickets/events/rest/v1/SecurityAnimation#AnimationType)\nto `FOIL_SHIMMER`.\n\n\nSee Figure 1. below for an example of how the security animation appears when it is enabled:\n\n\n**Figure 1.**\n\nProtect with Screen Lock\n------------------------\n\nTo protect your customer's access to their Pass, you can require a screen\nlock each time they add or access their pass. This can be done by setting `class.viewUnlockRequirement`.\nFor more details, see the\n[`ViewUnlockRequirement` type](/wallet/tickets/events/rest/v1/ViewUnlockRequirement)."]]