title: How to use Prime31 Google In App Billing Plugin
body: <p>I just bought "Google In App Billing Plugin for unity3d" by Prime31. I don't understand how to use it in the game that I want to develop.</p>
  
  <p>Can you please show me a code example? I understand I need to use my app key, but I don't know what to do next.
  And how to a I make test purchases with this plugin?</p>
  
  <p>Please help as much as you can, because I am really stuck on this subject for quite a while.</p>
  
  <p>This is some of my "purchase maker" object called MoneyTakerScript (inherits from MonoBehaviour):</p>
  
  <pre><code>void Start()
  {
  
      string key = "My App Key...";
  
  
      GoogleIAB.init(key);
  
      var skus = new string[] { "cl.48931", "tp.58932", "mmm.68393" };
      GoogleIAB.queryInventory( skus );
  
      TPS = GameObject.Find("TPBtn").GetComponent(typeof(TPScript)) as TPScript;
      CLS = GameObject.Find("CLBtn").GetComponent(typeof(CLScript)) as CLScript;
      MMM = GameObject.Find("MMBtn").GetComponent(typeof(MMMScript)) as MMMScript;
  }
  
  
  public void Purchase(string ProductId)
  {
      GoogleIAB.purchaseProduct(ProductId);
  
  }
  
  
  
  public void UseProduct(string ProductId)
  {
  
  
      if (ProductId.Contains("cl"))
      {
          CLS.MakeCL();
  
      }
      if (ProductId.Contains("tp"))
      {
          TPS.MakeTP();
  
      }
      if (ProductId.Contains("mmm"))
      {
          MMM.MakeMMM();
  
      }
  
      GoogleIAB.consumeProduct(ProductId);
  }
  </code></pre>
  
  <p>And this is some of my "purchase listner" object code:</p>
  
  <pre><code> void purchaseSucceededEvent(GooglePurchase purchase)
  {
      //Debug.Log( "purchaseSucceededEvent: " + purchase );
      MoneyScript.UseProduct(purchase.productId);
  
  }
  
    void Start()
  {
      MoneyScript = GameObject.Find("MoneyTaker").GetComponent(typeof(MoneyTakerScript)) as 
      MoneyTakerScript;        
  }
  </code></pre>