title: How to implement in-app purchases in a Windows Store App
body: <p>I was wondering how exactly in-app purchases are implemented in Windows Store Apps (meaning not Windows Phone), simply because I've looked online and at Microsoft's tutorials and I have found nothing that seems to avail me.</p>
  
  <p>I used Unity to develop my game and then exported a Windows Store 8.1 file. Specifically, I have an event implemented in my Unity code that is linked to a method in the MainPage.xaml.cs file accessible in Visual Studio (I am running Express 2013 for Windows). The actual method is being executed, but when I request a product purchase in the method like so, I get an error:</p>
  
  <pre><code>    // This is assigned to the event that is called in Unity whenever the "Get Points" button is pressed.
      private async void PurchasePoints(object arg)
      {
          // Find the GameManager GameObject.
          UnityEngine.GameObject gameManager = UnityEngine.GameObject.FindGameObjectWithTag("GameManager");
  
          // Get the script attached to it.
          GameManager gameManagerScript = gameManager.GetComponent&lt;GameManager&gt;();
  
          // Get the license information for this app.
          Windows.ApplicationModel.Store.LicenseInformation licenseInformation = Windows.ApplicationModel.Store.CurrentAppSimulator.LicenseInformation;
  
          if (licenseInformation.ProductLicenses["SectorDefense_Points_250"].IsActive)
          {
              await Windows.ApplicationModel.Store.CurrentAppSimulator.RequestProductPurchaseAsync("SectorDefense_Points_250");
  
              gameManagerScript.playerScore += 250;
          }
      }
  </code></pre>
  
  <p>I'm just generally confused as to how one is supposed to implement that sort of functionality.</p>
  
  <p>I've made sure to look into the WindowsStoreProxy.xml file and customize everything within it to suit the app's needs, although I've never really worked with XML before.</p>
  
  <p>Any help is much appreciated!</p>
  
  <p>Thanks in advance.</p>