Android 应用内结算 DEVELOPER_PAYLOAD 未通过
我一直在玩《地下城》应用程序以及我自己的计费代码,除了一个奇怪的地方之外,几乎一切都正常。
似乎无论我做什么,我都无法让 DEVELOPER_PAYLOAD 显示在 JSON 签名响应中。如果我没看错的话,文档似乎说我应该在 JSON 市场响应中看到developer_payload。 Dungeons 应用程序似乎认为它也应该在 json 中看到developer_payload。
我还没有让它在我的代码中工作,而且它似乎在我手机上的地下城示例中也不起作用。
以下是我的代码的一些片段:
Bundle request = makeRequestBundle("REQUEST_PURCHASE");
request.putString(C.DEVELOPER_PAYLOAD, "testing 123");
C.DEVELOPER_PAYLOAD is:
public static final String DEVELOPER_PAYLOAD = "DEVELOPER_PAYLOAD";
这是我在购买状态中看到的更改响应
05-14 20:13:08.360: INFO/BillingService(715): buyStateChanged 得到 签名数据: {“随机数”:9005407554096378381,“订单”:[{“notificationId”:“android.test.purchased”,“orderId”:“transactionId.android.test.purch ased","packageName":"com.mypackage","productId":"android.test.purchased","purchaseTime":1305429187752,"purchaseState":0}]}
提前致谢!
编辑:我终于想通了。事实证明,如果您使用任何测试 Android 项目 ID,则developer_payload 不会通过。您必须使用真实的应用内购买项目。
I've been playing around the the Dungeons app and also my own billing code and pretty much have everything working except for one strangeness.
It seems that no matter what I do I can't get the DEVELOPER_PAYLOAD to show up in the JSON signed response. If I'm reading thing right, the docs seem to say that I should see the developer_payload in the JSON market response. The Dungeons app seems to think it should see the developer_payload in the json too.
I haven't gotten it to work in my code and it doesn't seem to work in the Dungeons example either on my phone.
Here are some snippets of my code:
Bundle request = makeRequestBundle("REQUEST_PURCHASE");
request.putString(C.DEVELOPER_PAYLOAD, "testing 123");
C.DEVELOPER_PAYLOAD is:
public static final String DEVELOPER_PAYLOAD = "DEVELOPER_PAYLOAD";
And here's what I'm seeing in the purchase state changed responses
05-14 20:13:08.360: INFO/BillingService(715): purchaseStateChanged got
signedData:
{"nonce":9005407554096378381,"orders":[{"notificationId":"android.test.purchased","orderId":"transactionId.android.test.purchased","packageName":"com.mypackage","productId":"android.test.purchased","purchaseTime":1305429187752,"purchaseState":0}]}
Thanks in advance!
EDIT: I finally figured this out. Turns out that the developer_payload doesn't come through if you're using any of the test android item ids. You have to be using real in app purchase items.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我终于明白了这一点。事实证明,如果您使用任何测试 Android 项目 ID,则developer_payload 不会通过。您必须使用真实的应用内购买项目。
I finally figured this out. Turns out that the developer_payload doesn't come through if you're using any of the test android item ids. You have to be using real in app purchase items.