34

I have an Android app using In-App-Purchase that caters to an international audience, so I expect payments in different currencies. Of course I would like to show the items for purchase with the user's local currency, but I don't really know how.

Using the region or language of a user seems like a bad indicator, as the currency seems to depend on the region of the Market account the user is using and not on the device settings.

How can I find out which currency a user will pay in?

Thanks.

janpio
  • 10,645
  • 16
  • 64
  • 107

5 Answers5

26

As of IAB Version 3, the SKU details for the purchasable item include a formatted price, which includes the currency the user would pay in (the corresponding currency to their Google Play store):

enter image description here Some examples of values of price (not from a real SKU):

  • 3,99€
  • £2.99
  • $4.99

EDIT: I've updated the SKU details table, now including information about the price_currency_code field.

Christian García
  • 3,939
  • 1
  • 26
  • 26
  • Jippieh! Do you know when IAB v3 went into effect? – janpio Aug 04 '14 at 10:49
  • TBH, I don't know :) I'm glad this solves your solution. However, imho, the solution the Android team has provided is far from ideal: they provide a formatted string and, separately, a currencyCode field containing the ISO code of the currency (e.g. USD, AUD, EUR). I don't know why they don't provide a proper Locale. Besides, the [IAB v3 documentation](http://developer.android.com/google/play/billing/billing_reference.html#getSkuDetails) is not updated with these new fields! Have a look at the related [issue](https://code.google.com/p/marketbilling/issues/detail?id=93) to see its progress – Christian García Aug 04 '14 at 11:53
  • As of 27/10/2014, they have updated the [IAB v3 documentation](http://developer.android.com/google/play/billing/billing_reference.html#getSkuDetails) to include information about the price_currency_code field. I've updated the answer accordingly – Christian García Oct 27 '14 at 12:56
  • 1
    The `price` and `price_currency_code` values are *not necessarily* the values the user will actually see in the final payment dialog! Example: the item's default currency is JPY and the user's store is the Japan store; then the SKU info will be in JPY, but the user's credit card may be denominated in USD, in which case the final payment amount shown by the Google Play dialog is in USD. – Aaron Dec 15 '16 at 03:02
  • That's right,but we need to display the price of our items if user has wish to see price before the purchase.It's not necessary but important. – Dorbagna Feb 15 '19 at 19:32
5

It is somewhat difficult to do as the exchange rate that the market uses to process the transaction may fluctuate between you displaying the price and the user purchasing. I daresay Google would prefer you weren't doing this as it may result in customers yelling at them/you because you said $10 and they were charged $12.

Your best bet (failing someone knowing how to do this within the framework) is to ask the user what currency they wish to pay in and then give them an approximate price (I would list it in brackets next to the supplied price like "USD$10 [approx AUD$9]"). You should be able to grab it using an exchange rate API.

It's a bit of messing around but you should only need to ask once and save the preference. If you really want to be tricky, you could use coarse location data to get their locale and initially populate the value that way.

Ben Neill
  • 2,811
  • 2
  • 22
  • 20
  • 2
    This would be the case for iOS but in the play console you have the option to set the price per currency. So the price shouldn't fluctuate at all unless I'm missing something. – DallinDyer Oct 18 '12 at 17:41
  • @DallinDyer I was specifically talking about the Play Store at the time. No idea on iOS personally. Having another look, there is the option of defining the price for *most* countries, but not all. The remainder would be charged at USD conversion from memory, which would almost certainly fluctuate. – Ben Neill Oct 19 '12 at 04:27
  • What countries can the app be sold for which you cannot set the price for? AFAIK you enable the countries you want to sell in and then always*? have the option to set the price. – DallinDyer Oct 22 '12 at 16:01
4
  1. You may ask the user initially to choose their currency (optional).
  2. Show price in USD by default. Provide an option for user to change currency on item selection screen. Maybe an icon/button near to where price is displayed that opens a dropdown of all currencies. When user selects a currency from drop-down, all items' price should be displayed in selected currency.
Reena
  • 96
  • 13
3

I don't that would such a good idea, since the the in app billing isn't handled by your you, it's handled by the market. Just write the price in dollar or euro and let the user see the purchase in their own currency on the check-out page.

http://developer.android.com/guide/market/billing/index.html

Arash
  • 39
  • 1
  • 1
    Well, I don't think displaying to different prices is a good idea. I found nothing in the Android documentation at all on the i18n problems with billing. – janpio Feb 22 '12 at 21:20
  • I agree that letting the user choose a currency that Google Play is just going to ignore is a bad idea. The biggest problem with the Google Play checkout at the moment is it's not telling me what currency the price is in. It just shows a currency symbol. So if my app just shows the USD price with a "local pricing will be shown at checkout" message, when they go to the checkout if their currency is also shown with $ sign they have no idea if I'm trying to pull a fast one and charge them more or if it's just showing the local $'s price. (Example: NZ $ are worth less than USD). – ChrisJD Apr 30 '12 at 01:30
-3

Perhaps use the default Locale of the device?

String locale = Locale.getDefault().toString();

Then you could do a comparison off of that.

Just an idea!

romo
  • 1,990
  • 11
  • 10
  • 4
    That's what I meant with "region or language of a user seems like a bad indicator". It will be correct in many cases, but the payment currency is not tied to the device, but to the Market account (I think). If I change my language, I still pay in EUR because I'm from Germany and Google knows that. – janpio Feb 22 '12 at 21:19
  • @JanP.: I am looking for a way out where I can get the price which I paid in Google wallet.If you have any inputs , please share .That would really help. – Amar Oct 29 '15 at 12:23