為 Android 應用程式授權 Google 錢包 Android SDK
Google Wallet API 提供 Android SDK,方便您整合
透過原生程式碼直接在 Android 應用程式中使用 Google 錢包功能。
如要使用 Google Wallet Android SDK,您必須提供應用程式的套件名稱
Android 應用程式,以及應用程式簽署憑證的 SHA-1 指紋。這些憑證
用於授權應用程式的發布存取權,以及驗證要求
傳送到 Google Wallet API
1. 取得簽署憑證的 SHA-1 指紋
如要取得簽署憑證的 SHA-1 指紋,請按照
Google Play 服務說明文件,瞭解如何透過下列任一做法擷取動態饋給:
簽署憑證的 SHA-1 指紋看起來像這樣:
DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09
2. 在 Google 錢包主控台中授權應用程式
取得 SHA-1 指紋後,請按照下列步驟授權 Android
。
- 前往 Google Pay 和錢包控制台。
- 在左側導覽欄中,按一下 [Google Wallet API]開啟 Google 錢包控制台。
- 按一下 [其他功能]分頁。
- 在「應用程式權限」中方塊中,請點選「+ 新增應用程式」按鈕。
- 輸入應用程式的套件名稱和 SHA-1 指紋。
- 按一下「新增應用程式」。
如果套件名稱和應用程式出現在「應用程式權限」中方塊,您的應用程式已獲得授權
,使用 Google Wallet Android SDK 傳送要求至 Google Wallet API。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-08-29 (世界標準時間)。
[null,null,["上次更新時間:2024-08-29 (世界標準時間)。"],[[["The Google Wallet API offers an Android SDK for native app integration of Google Wallet features."],["You need to obtain your app's SHA-1 fingerprint and package name for authorization."],["Authorize your app via the Google Wallet console by providing the package name and SHA-1 fingerprint."]]],["The Google Wallet Android SDK requires app authorization using the app's package name and SHA-1 fingerprint. Retrieve the fingerprint via `keytool` or Gradle. Then, in the Google Pay & Wallet console, navigate to the 'Google Wallet API' section, and under 'App Permissions,' add your app details, including the package name and the obtained SHA-1 fingerprint. This process authorizes the app to use the Google Wallet API.\n"]]