但跑出來的結果跟模擬器一樣...
API exception 10
還有實機多了模擬器一顆按鈕
回去乖乖翻資料,發現之前的筆記上提到 github project 要仔細看 Constants.java and PaymentsUtil.java,發現 CURRENCY_CODE 我從 USD 改成 TW,應該是 TWD 才對,也把 exampleGatewayMerchantId 改成 YOUR_GATEWAY_MERCHANT_ID (因為我挑 ctbcbank 所以要帶這個,在之前的 payment provider 有提到)
改好後終於擺脫 error 10 !! (是說這 error 也太.... 幾乎找不到參考資料,大部分都說是 sign in 的資訊)
上次卡關的時候有用本帳號加入群組,今天突破後改用免洗帳號,結果就出現需要新增信用卡的情況,記得原本在 Test card suite 裡面是說:
These sample credit cards are intended for use with our integration checklist. To use them in our TEST environment, join our user group. While logged into an account that has joined the above group and viewing the payment sheet in the test environment, the Google Pay payment sheet will display a set of test cards.
以為 group 裡面會有個 sheet contains sample credit card, 但群組裡面空空如也,仔細看上面寫著:
Congratulations! You now have access to our test suite! No further action is required.
To test this feature, navigate to the demo page in our dev docs. Once you click on the Google Pay payment button, you should see our test cards instead of your own production cards.
猜想可能沒加過信用卡不行,或者時間差的關係,就換上本帳號,果真看到測試卡片了(上方右側)
按下 Continue 被要求加個螢幕鎖,展開發現蠻多卡片可以挑的 XD
然後就順利完成購物啦 Yeah~
PS 後來大概過半個小時,免洗帳號也出現測試信用卡了~
PS 有一度 factory reset 實機,多的那顆按鈕就不見了...