Skip to content

Step-by-step Integration

First Steps

  1. Install Steamworks.NET.
  2. Basic Balancy integration.
  3. Install Balancy Steam module.

    Screenshot

  4. Add game in Steam dashboard.

  5. Add Steam platform in Balancy on platforms page.
  6. Copy App ID, WebAPI key from Steam partner dashboard to Balancy.

    Screenshot

  7. Now you can authorize using Steam and buy products using Balancy.

Prerequirements

You need to init Steam SDK before using Balancy. Check SDK docs. Take a look on the provided SteamManager.cs.

Init Balancy after initing Steam SDK.

Authorization

Just call SteamNetwork.SteamInstance.Login:

SteamNetwork.SteamInstance.Login(result =>
{
  if (!result.Success)
      Debug.LogError("Steam auth error: " + result.Error.Code + " => " + result.Error.Message);
});

Payments

  1. First, read payments doc and in-game store documentation.
  2. Now you can add your own products to use it later. You can do it on the products page.

    Localized name is a special type. This string will automatically use translation depending on user language settings. You can read about our localization system on this page.

    Price is in USD

    Price on this page is in USD and it will be used during the purchase.

  3. Deploy changes on Deploy page.

    Don't forget to deploy

    All changes applied only after deploy. If you change something on the products page, deploy everything before testing.

  4. In the simple integration you can just start purchasing process like this:

    Payments.PurchaseProduct("gold.pack", res => { 
       Debug.Log("Product purchase: " + res.Success);
       if(res.Success) {
           // give your player gold
       }
    });
    

    But we strongly recommend you to use our in-game store.

  5. Internally we do all the magic (including server validation).

    Payments system works only if you run build via Steam

    For payments you need Steam overlay, so you can't test this functionality in the editor or in standalone build. You have to run the game via Steam.

Potential Issues

  1. App ID: 480. If your game shows "Spacewar" instead of your actual game when running in Unity, it means that Steam is not detecting your correct Steam App ID. This happens because "Spacewar" (App ID: 480) is a default placeholder for testing Steam integration.

    Read about steam_appid.txt.