How to check if transaction is made with test account purchase or with real account purchase?(如何查看交易是用测试账户购买还是用真实账户购买?)
问题描述
我正在使用测试帐户进行应用内购买测试,但 google 的响应与从真实帐户进行的购买相同.如何根据google的回复判断购买是否为test?
I am making an In-app purchase test with test account but the response from google is same as the purchase made from real account. How to check if the purchase is test based on the response from google?
推荐答案
是的,您可以从 Google 的 Purchases.subscriptions API 响应的 purchaseType 字段中查看参考.
Yes, you can check that from the purchaseType field of the Google's Purchases.subscriptions API response refer.
字段:购买类型
类型:整数
说明:订阅的购买类型.仅当此购买不是使用标准的应用内计费流程.可能的值是:0 = 测试(即从许可证测试帐户购买)
Description: The type of purchase of the subscription. This field is only set if this purchase was not made using the standard in-app billing flow. Possible values are: 0 = Test (i.e. purchased from a license testing account)
正如 Google 建议的那样,您必须开发一个 Web 服务器,您可以从中获取完整的字段列表.如果您想了解有关 Web 服务器的更多信息,请参阅我的 this 答案.
As Google suggests, You have to develop a web server from where you can get a comprehensive list of fields. If you want to know more about the web server follow then refer to my this answer.
这篇关于如何查看交易是用测试账户购买还是用真实账户购买?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何查看交易是用测试账户购买还是用真实账户购买?
- UITextView 内容插图 2022-01-01
- 如何在 iPhone 模拟器中重置 NSUserDefaults 数据? 2022-01-01
- SetOnItemSelectedListener上的微调程序错误 2022-01-01
- 类似于 Mail.app 的 iPad 模态视图控制器? 2022-01-01
- GPS状态的广播接收器? 2022-01-01
- 在 Iphone SDK 的导航栏上添加多个按钮 2022-01-01
- 网上有没有好的 UIScrollView 教程? 2022-01-01
- Xcode 7.3 中带有 UILabel 的 UIStackView 2022-01-01
- URL编码Swift iOS 2022-01-01
- 使用自动布局向 UIScrollView 添加动态大小的视图 2022-01-01