question

simong@everguild.com avatar image
simong@everguild.com asked

StartPurchase returns no RealCurrencyPrices

Hi,

I uploaded 3 store items with virtual and real currency prices this way :

<!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%">storeItem.VirtualCurrencyPrices = <span style="color: #008800; font-weight: bold">new</span> Dictionary<<span style="color: #333399; font-weight: bold">string</span>, <span style="color: #333399; font-weight: bold">uint</span>>();
storeItem.VirtualCurrencyPrices.Add(<span style="background-color: #fff0f0">"RM"</span>, (<span style="color: #333399; font-weight: bold">uint</span>)item.moneyPrice * <span style="color: #6600EE; font-weight: bold">100</span>);
storeItem.RealCurrencyPrices = <span style="color: #008800; font-weight: bold">new</span> Dictionary<<span style="color: #333399; font-weight: bold">string</span>, <span style="color: #333399; font-weight: bold">uint</span>>();
storeItem.RealCurrencyPrices.Add(Currency.USD.ToString(), (<span style="color: #333399; font-weight: bold">uint</span>)item.moneyPrice * <span style="color: #6600EE; font-weight: bold">100</span>);
</pre></div>

When I make a call with the PlayFabAdminAPI to retrieve the store items I do have these realcurrencies in the result.
OR when I actually use StartPurchase ingame, RealCurrencyPrices is null and I only have the virtual currency "RM" and when I call PayForPurchase, I get the error:
Item can not be bought with USD, no USD price specified.

10 |1200

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

brendan avatar image
brendan answered

Apologies for the confusion on this. At the moment, the StartPurchase flow only works with Virtual Currencies or RM (real money). If using foreign currency prices via the RealCurrencyPrices is critical to your title, could you reach out to us at devrel@playfab.com with more info on the specifics for your title (launch date, etc.)? Thanks!

10 |1200

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

simong@everguild.com avatar image
simong@everguild.com answered

oops, sorry the actual code is :
storeItem.VirtualCurrencyPrices = new Dictionary<string, uint>();
storeItem.VirtualCurrencyPrices.Add("RM", (uint)item.moneyPrice * 100);
storeItem.RealCurrencyPrices = new Dictionary<string, uint>();
storeItem.RealCurrencyPrices.Add(Currency.USD.ToString(), (uint)item.moneyPrice * 100);

10 |1200

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

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.