文件看起來可以直上測試,那就開一套玩玩看囉~
先把 libs 加進來
- implementation 'com.google.android.gms:play-services-wallet:19.1.0'
把直接寫好的程式碼放到專案裡面看看吧
恩,噴了一些錯,看來程式碼有點歷史...
那來找歷史看看 XD
https://github.com/google-pay/android-quickstart/
Instructions
Make sure you read the comments in Constants.java and PaymentsUtil.java before you continue. These files must be modified prior to running the app, as per the instructions provided in the comments.
從 sample code 做的三個變更,跑起來開服飾店啦
哎呀,要設定帳號才行~
這邊 Before you begin 有提到:
Set up your app in your Google Pay account
Install the Google Play services version 19.1.0 or greater.
Install the Google Pay app and add a payment method.
Add a payment method to Google.
Adhere to our Google Pay API Acceptable Use Policy and the Google Play developer policy.
剛好在 Integration checklist 裡面有看到 Test card suite
剛按下申請加入,期待審核後參考裡面的測試卡片資料囉~
咦,重整網頁居然秒加入群組了
貌似只要用加入群組的帳號登入裝置就能直接使用測試卡片
但登入後顯示 Toast ...
No comments:
Post a Comment