I am implementing in-app purchases for an app with support for several countries.
The In-App Billing Version 3 API claims that:
No currency conversion or formatting is necessary: prices are reported in the user's currency and formatted according to their locale.
This is actually true, since skuGetDetails()
takes care of all necessary formatting. The response includes a field called price
, which contains the
Formatted price of the item, including its currency sign. The price does not include tax.
However, I need the ISO 4217 currency code (retrievable if I know the store locale) and the actual non-formatted price (optimally in a float or decimal variable) so I can do further processing and analysis myself.
Parsing the return of skuGetDetails()
is not a reliable idea, because many countries share the same currency symbols.
How can I get the ISO 4217 currency code and non-formatted price of an in-app purchase with the In-App Billing Version 3 API?
Open Play Console and go to the App pricing page (Products > App pricing). Click Set price. Review the table in the "Local prices" section. In the "Price" column, review the local prices for each country.
Locate “In-App Purchases” heading and tap it. (If In-App Purchases are available, it will say “Yes” and have a downward-pointing carat beside it.) After tapping the entry, a list will be revealed showing all of the app's In-App Purchases and the price of each one.
Full information can be found here, but essentially in August 2014 this was resolved with:
The getSkuDetails() method
This method returns product details for a list of product IDs. In the response Bundle sent by Google Play, the query results are stored in a String ArrayList mapped to the DETAILS_LIST key. Each String in the details list contains product details for a single product in JSON format. The fields in the JSON string with the product details are summarized below
price_currency_code ISO 4217 currency code for price. For example, if price is specified in British pounds sterling, price_currency_code is "GBP".
price_amount_micros Price in micro-units, where 1,000,000 micro-units equal one unit of the currency. For example, if price is "€7.99", price_amount_micros is "7990000".
You can't, this is currently not supported. There is a feature request for it, but it may or may not get implemented.
https://code.google.com/p/marketbilling/issues/detail?id=93
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With