如何查看交易是用测试账户购买还是用真实账户购买?

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.

这篇关于如何查看交易是用测试账户购买还是用真实账户购买?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)