Facebook 积分和外币
我正在开发一个使用 FB Credits 作为货币的应用程序,但是,我的客户将以当地货币(ILS、以色列谢克尔)付款。
我知道 1 个积分的汇率是 10 美分,但是,ILS 的价格似乎随着 USD-ILS 汇率的变化而变化。
有没有办法查询 Facebook 服务器以了解用户将以当地货币支付的价格?就像查询价目表的方式一样。许多新用户不理解积分的概念,我想向他们展示他们将用当地货币支付什么。
I am developing an application that uses FB Credits as a currency, however, my clients are going to be paying in their local currency (ILS, israeli sheqel).
I know the rate for 1 credit is 10 cents, however, the price in ILS seems to be changing according to changes in the exchange-rates of USD-ILS.
Is there a way to query Facebook Server to know the prices users are going to be charged in their local money? Like a way to query the pricelist. Many new users don't understand the concept of credits and i'd like to show them what they're about to pay in local money.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
正如 OffBySome 所说,Facebook 没有可用的汇率信息。考虑到这一点,我明白为什么他们没有这个,因为他们不希望您显示商品的当地货币价格。尽管目前 Facebook Credits 相对较新,最终用户也存在很多困惑,但最终当它广泛普及时,这些问题就不会再出现了。
我现在建议(正如我所做的那样 - 这里 1 个 Facebook Credit 目前约为 7p),您只需在应用程序中以当地货币硬编码 1 个 Facebook Credit 的价格,并在需要时显示此价格。我认为 Facebook 不支持这一点的原因之一是他们没有设想使用 Credits 的应用程序仅限于一个地区,但实际上并非所有东西都是可以在全球范围内使用的游戏。 :)
As stated by OffBySome, Facebook do not have exchange rate information available. Thinking about this, I can see why they don't have this as they do not want you to display the local currency price for items. Although at the moment Facebook Credits are relatively new, and there is a lot of confusion for end users, eventually when it becomes widespread there won't be these issues.
I would suggest for now (as that is what I have done - here one Facebook Credit is currently ~7p) that you just hard code in your app the price of 1 Facebook Credit in your local currency, and if required display this. I think one of the reasons why Facebook don't support this is that they didn't envisage apps using Credits to be restricted to one territory, however in reality not everything is a game to be used worldwide. :)
为了总结这个问题,我尝试了两种方法。一种是使用这个 python 函数每 10 分钟从 openexchange 提取一次汇率:
但是,facebook Credits 似乎根据不同的汇率计算 ILS(israeli sheqel) 汇率(计算结果略有偏差)。因此,我们决定使用以下函数从以色列中央银行提取
xml
数据:Just to sum this question up, I tried two methods. One was to pull the rate every 10 minutes from openexchange using this
python
function:However it seems that facebook credits calculates ILS(israeli sheqel) rate according to a different rate (calculations were off by a little). So we have decided to pull
xml
data from israel's central bank, using this function:Facebook Credits API 没有可用的汇率信息。您可以在他们的开发者小组中请求此功能。最好的办法是拉下汇率源(如果你搜索的话,有大量可用的)并显示它,并警告说这只是一个估计汇率,它取决于 Facebook 使用的实际汇率。
The Facebook Credits API doesn't have exchange rate information available. You could request this feature on their developer group. You're best bet would be to pull down an exchange rate feed (there are tons available if you search) and display that with a warning that it is just an estimated rate and that it is dependent on the actual exchange rate Facebook uses.
xe.com 是一个很棒的提要,您还可以从雅虎或谷歌财经获取数据
xe.com is a great feed , you can also pull data from yahoo or google finance