Add a real money purchase to your game

The following instructions describe how to define the parameters of a real money purchase in your game’s economy.

  1. From the Unity Cloud Dashboard, open Economy and select Configuration.

  2. Select Add resource.

  3. Set Choose a type to Real money purchase.

  4. Give the transaction a resource name, and an ID for use in API calls. For example, if your real money purchase is for a shield, the item name could be Buy Shield. The ID is auto-generated from the item name, but you can change it to anything that suits you and your game.

  5. Select Next.

  6. The next screen contains these sections to fill.

    • In the What does this purchase buy? section, set the Resource field to a currency or inventory item the player acquires as a result of this transaction, as well as the amount of the item the player receives.
    • In the Which devices is this available on? section, set the Which devices is this available on? field to the ID of the purchase in the reference store. If you do not allow the item to be purchased in one of the available stores, then leave the corresponding box empty. Some stores might require additional configuration. See Configure the Google Play Store with IAP.
  7. You can add any optional custom JSON data you want allocated to this real money purchase by entering it into the Custom Data box. See Custom data.

  8. Select Add.

The new real money purchase now appears on the Configuration page of Economy.

Integrate in-app purchases using the IAP plug-in

The following process creates a real money purchase using the In-App Purchasing plug-in from Unity:

  1. Configure the products on both the Apple App Store and the Google Play Store.
  2. Define the same products as resources in the Economy configuration.
  3. Define real money purchases within Economy that describe the available in-app purchases and associated rewards.
  4. Retrieve the available real money purchases from Economy at runtime and display them to the player.
  5. Perform an IAP using Unity IAP.
  6. Verify, redeem and securely apply the purchase rewards with Economy.

Configure the Google Play Store with IAP

Google Store configuration requires you to set an additional key at project level. Developers will see an information banner in the Real Money Purchase configuration dialog that informs them to fill the required field, with a link to the page containing the section.

To set up Google Play Store for use with IAP:

  1. Retrieve the Google Play License Key in addition to the Product ID for the item.
  2. In the Unity Cloud Dashboard, select Projects and open your project.
  3. In the Google License Key setting, select the Edit pencil icon and add the Google key.
  4. Save the configuration change.

Additional resources