小编Ale*_*uts的帖子

通过Google Play服务API将会员卡添加到Google Pay

使用Google Play服务API将会员卡添加到Google Pay应用时遇到问题。在Google付款请求后,我得到了帐户验证,但我收到了400条日志。

找不到问题所在...

下面的代码是按照本指南编写的:

https://developers.google.com/pay/passes/guides/get-started/implementing-the-api/save-to-google-pay#from-native-android-app

https://developers.google.com/pay/passes/guides/overview/basics/typical-api-flow

附加代码(看一下注释,这很重要

// is 9999999
val userId : String = usr.idUser.toString()
// value is "John Snow"
val fullname : String = usr.fullname
// ISSUER_ID - is numeric value from console

val wob = LoyaltyWalletObject.newBuilder()
//    the class id has similar name. All characters has been replaced with 'x' character
    .setClassId("$ISSUER_ID.xxxx.xxx.xxxxxxxxxxxx.xxxxxxxxxx")
//    similar to comment from method setClassId
    .setId("$ISSUER_ID.xxxx.xxx.xxxxxxxxxxxx.xxxxxxxxxx.$userId")
    .setState(WalletObjectsConstants.State.ACTIVE)
//   id of user in app
    .setAccountId(userId)
//   name of user in app …
Run Code Online (Sandbox Code Playgroud)

android google-play-services google-pay

5
推荐指数
1
解决办法
953
查看次数

标签 统计

android ×1

google-pay ×1

google-play-services ×1