首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >应用内计费库存价格与用户购买时显示的币种并不总是相同

应用内计费库存价格与用户购买时显示的币种并不总是相同
EN

Stack Overflow用户
提问于 2014-11-04 16:23:35
回答 1查看 457关注 0票数 3

我的Android应用程序正在利用In- app -Purchases / In-App-Billing,到目前为止,整个过程运行得很好。我唯一的问题是,在这个过程中,有时货币会发生变化。我的意思是,当我使用mHelper.queryInventoryAsync()查询库存时,我得到的价格/货币有时与用户单击要购买的商品时显示的价格/货币不同。

例如,有一个来自希腊的用户,由于某种原因,queryInventory方法返回以英镑为单位的价格,只有在用户单击要购买的产品后,谷歌才向他显示以欧元为单位的价格。这位用户后来告诉我,他的Nexus 7是从英国买的,但他的信用卡是希腊的。所以这可能可以解释它,但它仍然让他感到困惑,并且看到它已经发生在我的一个测试用户身上,我可以想象这种情况会更频繁地发生。

此外,我不确定是否可以从法律上讲,如果一个应用程序在过程中改变货币,用户可能不知道谷歌在这里的错误。

所以我在这里问的是,有没有一种简单的方法来迫使google在我查询库存时提供最终价格?或者,有没有一种简单的方法来找出用户将用什么货币支付(可能从他的SIM卡中获得国家),并使用国家变量查询谷歌库存?

提前谢谢你。

下面是我的代码:

代码语言:javascript
复制
    // 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();                 

      }
    };  
EN

回答 1

Stack Overflow用户

发布于 2014-11-12 03:17:39

如果我在希腊,我使用一张连接到我的银行账户的美国卡,里面有美元,谷歌将首先以欧元计价。

当他们发现我用美元支付时,通过检查我的卡,它会变成美元。

在用户付款之前,没有办法知道他们会用什么货币付款,除非你在你的应用程序中添加了一个货币选择,并自己查询汇率,或者你查看了用户的私人付款信息(即使你可以,也不要这么做)。

编辑:但是,您可以根据所选的系统语言或其他识别因素来决定货币。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26730548

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档