如何检查是通过测试帐户购买还是通过真实帐户购买进行交易

如何检查是通过测试帐户购买还是通过真实帐户购买进行交易

本文介绍了如何检查是通过测试帐户购买还是通过真实帐户购买进行交易?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用测试帐户进行应用内购买测试,但Google的回复与从真实帐户进行的购买相同.如何根据Google的回复检查购买的商品是否为测试商品?

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 responserefer.

类型:整数

说明:订阅的购买类型.仅当未使用购买商品进行购买时,才设置此字段标准应用内结算流程.可能的值为: 0 =测试(即从许可证测试帐户购买的

Description: The type of purchase of the subscription.This field is only set if this purchase was not made using thestandard in-app billing flow. Possible values are: 0 = Test (i.e.purchased from a license testing account)

正如Google所建议的那样,您必须开发一个Web服务器,从中可以获得全面的字段列表.如果您想了解有关Web服务器的更多信息,请参考我的答案.

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.

这篇关于如何检查是通过测试帐户购买还是通过真实帐户购买进行交易?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 12:49