question

scottbeca avatar image
scottbeca asked

Questions about implementing Steam IAPs

I am in the process of implementing Steam microtransactions using PlayFab and have gotten the basics working so that I can now purchase a PlayFab Catalog Item within Steam. I have a couple of questions before I continue integrating PlayFab:

  1. During the Steam IAP purchase process, the player is presented with a purchase confirmation dialog via the Steam Overlay. Within this confirmation dialog, the name of the IAP is taken from the PlayFab Catalog Item display name. The rest of our game is localised into multiple languages but the display name field within the PlayFab dashboard is only a single field with no visible ways to set multiple localisation strings. Is there any way to localise the display name or do you have any plans to offer this functionality?
  2. How are all the different currencies supported by Steam handled by PlayFab? For example, if I want an IAP to cost the equivalent of $1.99 USD in all the different currencies, how does PlayFab generate the cost in Japanese Yen (for reference the current exchange rate has 1.99 USD = 217.25 JPY)?
3 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.

swapnilnegi avatar image swapnilnegi commented ·

@scottbeca Could you please assist me with the steam payment as I get the overlay for authorizing the purchase but when I press the authorize button I dont get the MicroTxnAuthorizationResponse_t callback from steam. I am handling the callback also in game. I am using Unity for development.

Thanks in advance!!!

0 Likes 0 ·
brendan avatar image brendan swapnilnegi commented ·

Can you confirm that everything else Steam-related is working for your title? The Steam login works fine, the purchasing popup has the right price based upon what items were in the StartPurchase call, etc.?

0 Likes 0 ·
scottbeca avatar image scottbeca swapnilnegi commented ·

Hi @swapnilnegi, this is the code I'm using for my callback code in SteamManager:

// Place this in your SteamManager initialize function after you've successfully called SteamAPI.Init()
Callback<MicroTxnAuthorizationResponse_t>.Create(OnMicroTxnAuthorizationResponse);


private void OnMicroTxnAuthorizationResponse(MicroTxnAuthorizationResponse_t pCallback)
{
    if (pCallback.m_bAuthorized == 1) {
        // Player authorized the payment
    } else {
        // Player didn't authorize the payment
    }
}

You also need to make sure that your SteamManager has been added to the scene and that you're calling this in your SteamManager Update function or you won't get any callbacks:

SteamAPI.RunCallbacks();
0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

For 1, what most titles that require localization do currently is to use a lookup index in the string fields for text, like description or display name. They use that lookup index to find the correct string in their local string tables, which they can store in the Content service.

For 2, all conversion of purchase prices in Steam are handled by Steam directly. They compute the exchange rate-calculated price for the popup where they ask for user confirmation.

7 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.

scottbeca avatar image scottbeca commented ·

Hi @Brendan, thank you for the quick response.

To confirm, for point 1, what you're suggesting is a solution that works for something that happens entirely on the PlayFab servers? I can enter a lookup index into the display name field and PlayFab will automatically replace that with the correct localized string before sending it to Steam? If that is the case, is there a tutorial or documentation for how to get working?

0 Likes 0 ·
brendan avatar image brendan scottbeca commented ·

No, we don't have integrated localization yet. What I'm describing is that you would store localized text either in Title Data or Content (depending on how much you have), and pull the appropriate assets down to the client for use in-game. So, if a catalog item might have a name of "sword010_name", which you would use to look up the name text for that item in your asset files. You could, for example, store all the localized strings in asset package files (art, text, 3d modes, etc.) grouped in some way, or just as a single JSON or XML file containing all strings for the game.

0 Likes 0 ·
brendan avatar image brendan brendan commented ·

Ah, hang on - you're specifically asking about the text which is displayed by Steam, as a result of the StartPurchase/PayForPurchase route, I see. Sorry, no - since we don't have built in localization support yet, you would need to have separate catalogs for the different localizations (or possibly separate Title IDs, though I tend to doubt that you'd want to split your user base that way).

0 Likes 0 ·
Show more comments
swapnilnegi avatar image swapnilnegi commented ·

@Brendan Yes I am able to login without any error and also the overlay shows the price of the item as specified in playfab. Still stuck in this. Thanks

0 Likes 0 ·
swapnilnegi avatar image swapnilnegi swapnilnegi commented ·

Hey @Brendan it works now! The script was getting destroyed in game so SteamAPI.RunCallbacks was not getting called. Its now fixed. Thanks for the Help!

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.