我的Android应用程序正在利用In- app -Purchases / In-App-Billing,到目前为止,整个过程运行得很好。我唯一的问题是,在这个过程中,有时货币会发生变化。我的意思是,当我使用mHelper.queryInventoryAsync()查询库存时,我得到的价格/货币有时与用户单击要购买的商品时显示的价格/货币不同。
例如,有一个来自希腊的用户,由于某种原因,queryInventory方法返回以英镑为单位的价格,只有在用户单击要购买的产品后,谷歌才向他显示以欧元为单位的价格。这位用户后来告诉我,他的Nexus 7是从英国买的,但他的信用卡是希腊的。所以这可能可以解释它,但它仍然让他感到困惑,并且看到它已经发生在我的一个测试用户身上,我可以想象这种情况会更频繁地发生。
此外,我不确定是否可以从法律上讲,如果一个应用程序在过程中改变货币,用户可能不知道谷歌在这里的错误。
所以我在这里问的是,有没有一种简单的方法来迫使google在我查询库存时提供最终价格?或者,有没有一种简单的方法来找出用户将用什么货币支付(可能从他的SIM卡中获得国家),并使用国家变量查询谷歌库存?
提前谢谢你。
下面是我的代码:
// googles IabHelper class
private IabHelper mHelper;
// this carries my products, gets filled in my activity by a request to my server
private List<String> additionalSkuList = new ArrayList<String>();
mHelper.queryInventoryAsync(true, additionalSkuList,
mGotInventoryListener);
// Listener that's called when we finish querying the items and subscriptions we own
IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() {
public void onQueryInventoryFinished(IabResult result, Inventory inventory) {
L.debug("Query inventory finished.");
// Have we been disposed of in the meantime? If so, quit.
if (mHelper == null) return;
// Is it a failure?
if (result.isFailure()) {
L.debug("Failed to query inventory: " + result);
return;
}
Set<String> skuKeys = inventory.getSkuKeys();
List<String> exceptList=new ArrayList<String>();
mHelper.flagEndAsync();
for (final String sku: skuKeys) {
// this price is not always the one which will be shown when someone
// would start the IAB process
String price = inventory.getSkuDetails(sku).getPrice();
}
}; 发布于 2014-11-12 03:17:39
如果我在希腊,我使用一张连接到我的银行账户的美国卡,里面有美元,谷歌将首先以欧元计价。
当他们发现我用美元支付时,通过检查我的卡,它会变成美元。
在用户付款之前,没有办法知道他们会用什么货币付款,除非你在你的应用程序中添加了一个货币选择,并自己查询汇率,或者你查看了用户的私人付款信息(即使你可以,也不要这么做)。
编辑:但是,您可以根据所选的系统语言或其他识别因素来决定货币。
https://stackoverflow.com/questions/26730548
复制相似问题