title: How to Implement In-App Purchases in Windows 10 Apps?
body: <p>I want to integrate in-app purchasing in my windows universal app. I do the following thing before coding.</p>
  
  <ul>
  <li><p>Make App on <a href="https://dev.windows.com/en-us/dashboard/" rel="nofollow">Windows Dev Center</a></p></li>
  <li><p>Add products with details in IAPs section and submit to Store as you can see in <a href="https://cloudup.com/cvpVT8d9pxK" rel="nofollow">Image</a></p></li>
  <li>After that I use the following code in my app to get list of products of In-App purchasing and button to purchase product. I also used <code>CurrentApp</code> instead of <code>CurrentAppSimulator</code> in my code but it goes in exception.</li>
  </ul>
  
  
  
  <pre><code>private async void RenderStoreItems()
      {
          picItems.Clear();
  
          try
          {
              //StoreManager mySM = new StoreManager();
              ListingInformation li = await CurrentAppSimulator.LoadListingInformationAsync();
  
              System.Diagnostics.Debug.WriteLine(li);
  
              foreach (string key in li.ProductListings.Keys)
              {
                  ProductListing pListing = li.ProductListings[key];
                  System.Diagnostics.Debug.WriteLine(key);
  
                  string status = CurrentAppSimulator.LicenseInformation.ProductLicenses[key].IsActive ? "Purchased" : pListing.FormattedPrice;
  
                  string imageLink = string.Empty;
  
                  picItems.Add(
                      new ProductItem
                      {
                          imgLink = key.Equals("BaazarMagzine101") ? "block-ads.png" : "block-ads.png",
                          Name = pListing.Name,
                          Status = status,
                          key = key,
                          BuyNowButtonVisible = CurrentAppSimulator.LicenseInformation.ProductLicenses[key].IsActive ? false : true
                      }
                  );
              }
  
              pics.ItemsSource = picItems;
          }
          catch (Exception e)
          {
              System.Diagnostics.Debug.WriteLine(e.ToString());
          }
      }
  
      private async void ButtonBuyNow_Clicked(object sender, RoutedEventArgs e)
      {
          Button btn = sender as Button;
  
          string key = btn.Tag.ToString();
  
          if (!CurrentAppSimulator.LicenseInformation.ProductLicenses[key].IsActive)
          {
              ListingInformation li = await CurrentAppSimulator.LoadListingInformationAsync();
              string pID = li.ProductListings[key].ProductId;
  
              string receipt = await CurrentAppSimulator.RequestProductPurchaseAsync(pID, true);
  
              System.Diagnostics.Debug.WriteLine(receipt);
  
              // RenderStoreItems();
          }
      }
  </code></pre>
  
  <p>I also Associate my app with Store and my app package is same as in MS Dev Center App as you can see in <a href="https://cloudup.com/ca4g4-WZY_x" rel="nofollow">Image</a> </p>
  
  <p>When I run my app and click on Buy button, I got this dialogue box as you can see in <a href="https://cloudup.com/cqLTzfNPYzi" rel="nofollow">Image</a> after that I did not get receipt data from Store.</p>
  
  <p>If I'm doing wrong then Please give me proper guide to implement the In-app purchase and test that In-app purchase in my laptop device.</p>