question

ketanjaiswal avatar image
ketanjaiswal asked

How to get the Currency Tags (Abv. form like EUR, USD, INR)?,How to get Currency Tags (Abv. forms like USD, GBP, EUR)?

Hello,

I am using the following code and getting the "RM" value:

foreach (var item in result.Catalog)
{
      var price = item.VirtualCurrencyPrices["RM"];
      //var price = item.RealCurrencyPrices["RM"];
      ItemList.Add(new StoreProduct { Id = item.ItemId, Name = item.DisplayName, Price = price.ToString() });
}

Here is the screenshot of my CatalogItem.

The variable Price is giving me value as "299". I would like to get the localized currency as well for the same like USD 1.99, INR 299, GBP 0.99

Also, var price = item.RealCurrencyPrices["RM"]; gives me NULL.
What could be the problem?

Any help would be appreciated.

Thanks in Advance.
K

,

Hello,

I am using the following code and getting the "RM" value:

foreach (var item in result.Catalog)
{
      var price = item.VirtualCurrencyPrices["RM"];
      //var price = item.RealCurrencyPrices["RM"];
      ItemList.Add(new StoreProduct { Id = item.ItemId, Name = item.DisplayName, Price = price.ToString() });
}

Here is the screenshot of my CatalogItem.

The variable Price is giving me value as "299". I would like to get the localized currency as well for the same like USD 1.99, INR 299, GBP 0.99

Also, var price = item.RealCurrencyPrices["RM"]; gives me NULL.
What could be the problem?

Any help would be appreciated.

Thanks in Advance.
K

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

RM is USD cents in PlayFab, which is by design. You may need to use VirtualCurrencyPrices to get the RM price and implement the convertor on your own for your game if multiple prices are required. However, in this scenario, we usually implement prices for different currencies on Google Play Store or Apple App Store if using receipt real-money purchase. Please note that in this kind of purchase, RM on PlayFab is not referred for the purchase, it is a simple statistic for VTD calculation after the purchase is finished.

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ketanjaiswal avatar image ketanjaiswal commented ·

Cheers Mate, that explains quite a bit. I am still wondering would could be the reason for item.RealCurrencyPrices returning NULL value

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ ketanjaiswal commented ·

The RealCurrencyPrices is used in the Store. You may define the different Currency for display via SetStoreItems API or SetCatalogItems API, so that RealCurrencyPrices can be seen when client calls GetStoreItems/GetCatalogItems API.

It can be seen or modified via Game Manager, for now, it works like a display property instead of functional currency.

There is no further description about this feature. Please keep track of roadmap updates.

1 Like 1 ·
Seth Du avatar image Seth Du ♦ ketanjaiswal commented ·

In terms of this issue, I will consult the team. Thanks again for the feedback.

0 Likes 0 ·
ketanjaiswal avatar image ketanjaiswal commented ·

Quite late in updating this but I got this sorted. With the product id I am getting the information of Currency Code and Currency Symbol by using Unity's IStoreController

To get the symbols like $1.99 etc, use this:

storeController.products.WithID(productID).metadata.localizedPriceString;


To get USD, INR, GBP, use this:
storeController.products.WithID(productID).metadata.isoCurrencyCode;
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.