title: Unity IAP | In App Purchase | Unknown Error
body: <p>I want to implement IAP in my android game.</p>
  
  <p>This is my code, it is from the official unity website:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.Purchasing;
  using UnityEngine.UI;
  
  public class Purchaser : MonoBehaviour, IStoreListener {
  private static IStoreController m_StoreController;          // The Unity Purchasing system.
  private static IExtensionProvider m_StoreExtensionProvider; // The store-specific Purchasing subsystems.
  
  public Text text;
  
  public static string kProductIDConsumable = "pile_shadycoin";
  
  void Start() {
      if (m_StoreController == null) {
          InitializePurchasing();
      }
  }
  
  public void InitializePurchasing() {
      if (IsInitialized()) {
          return;
      }
  
      var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
  
      builder.AddProduct(kProductIDConsumable, ProductType.Consumable);
  
      UnityPurchasing.Initialize(this, builder);
  }
  
  
  private bool IsInitialized() {
      return m_StoreController != null &amp;&amp; m_StoreExtensionProvider != null;
  }
  
  
  public void BuyConsumable() {
      BuyProductID(kProductIDConsumable);
  }
  
  void BuyProductID(string productId) {
      if (IsInitialized()) {
          Product product = m_StoreController.products.WithID(productId);
  
          if (product != null &amp;&amp; product.availableToPurchase) {
              text.text = "Purchasing product asychronously: '{0}'";
              m_StoreController.InitiatePurchase(product);
          } else {
              text.text = "BuyProductID: FAIL. Not purchasing product, either is not found or is not available for purchase";
          }
      } else {
          text.text = "BuyProductID FAIL. Not initialized.";
      }
  }
  
  public void OnInitialized(IStoreController controller, IExtensionProvider extensions) {
      text.text = "OnInitialized: PASS";
  
      m_StoreController = controller;
  
      m_StoreExtensionProvider = extensions;
  }
  
  
  public void OnInitializeFailed(InitializationFailureReason error) {
      text.text = "OnInitializeFailed InitializationFailureReason:" + error;
  }
  
  
  public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args) {
      if (String.Equals(args.purchasedProduct.definition.id, kProductIDConsumable, StringComparison.Ordinal)) {
          text.text = "ProcessPurchase: PASS. Product: '{0}'";
  
  
      } else {
          text.text = "ProcessPurchase: FAIL. Unrecognized product: '{0}'";
      }
      return PurchaseProcessingResult.Complete;
  }
  
  
  public void OnPurchaseFailed(Product product, PurchaseFailureReason failureReason) {
      text.text = failureReason + "";
  }
  }
  </code></pre>
  
  <p>I am using the consumable item pile_shadycoin.
  In the picture you can see the id and that it's active (it's german)</p>
  
  <p><a href="https://i.stack.imgur.com/X1cNG.png" rel="nofollow noreferrer">Picture of Google Play</a></p>
  
  <p>If I build my project and put it on my smartphone and press the button, which is linked to BuyConsumable() it opens the menu and says: </p>
  
  <blockquote>
    <p>Fehler Der angeforderte Artikel kann nicht gekauft werden</p>
  </blockquote>
  
  <p>In English:</p>
  
  <blockquote>
    <p>Error The requested item cannot be purchased</p>
  </blockquote>