Example #1
0
 public override void Shutdown()
 {
     Debug.Log("cafebazaar: request shutdown.");
             #if UNITY_ANDROID_CAFE
     BazaarIAB.unbindService();
             #endif
 }
    private static void OnPurchase(string productId, bool bazaar)
    {
        string s = productId.ToLower();

        if (s.Trim().Contains("doubler"))
        {
            var        playerController = Singleton.Instance.PlayerController;
            PlayerInfo playerInfo       = playerController.PlayerInfo;
            playerInfo.HasDubler = true;
            playerInfo.Dirty     = true;
            Singleton.Instance.PlayerController.ChangePlayerInfo(playerInfo);
        }

        if (s.ToLower().Contains("coin"))
        {
            string id = s.Replace("coin", "").Trim();
            Debug.Log(id);
            id = id.Replace("coin", "").Trim();
            Debug.Log(id);

            int count = int.Parse(id);
            Singleton.Instance.PlayerController.ChangeCoin(count);
        }

        if (bazaar)
        {
            BazaarIAB.consumeProduct(s);
        }
    }
Example #3
0
    // Use this for initialization
    protected override void Start()
    {
                #if UNITY_ANDROID_CAFE
        if (iabCafebazaar == null)
        {
            iabCafebazaar            = this;
            preventOnDestroyShutDown = false;            //must shut down in app exit
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            /**
             * some drag and drop initialize in older object that need new object in current
             */
            ((AbstractBillingSystem)iabCafebazaar).consumeLoadingBar = consumeLoadingBar;

            preventOnDestroyShutDown = true;            //must not shut down service in copy object
            Destroy(gameObject);
            return;
        }

        base.Start();

        BazaarIAB.enableLogging(false);        //this is hard coded for debug log in service
        BazaarIAB.init(encode64BasePublicKey);
        Debug.Log("cafebazaar: Billing Initialize......");
                #endif

        setBillingProgress(BillingProgress.WAIT);
        StartCoroutine(WaitForResponse());
    }
    private void Start()
    {
        IABEventManager.purchaseSucceededEvent += OnPurchased;
        IABEventManager.billingSupportedEvent  += Support;
        ZarinpalStore.OnPurchaseDone           += s => { OnPurchase(s, false); };

        DontDestroyOnLoad(gameObject);
        BazaarIAB.init(key);
        BazaarIAB.enableLogging(true);
    }
Example #5
0
    //-------------------------------------------- Query Purchased section

    public override void LoadPurchase()
    {
        Debug.Log("cafebazaar: request load purchased item.");
                #if UNITY_ANDROID_CAFE
        if (CheckBillingSupported())
        {
            BazaarIAB.queryPurchases();
        }
                #endif
        setBillingProgress(BillingProgress.WAIT);
        StartCoroutine(WaitForResponse());
    }
Example #6
0
 //-------------------------------------------- Query Item section
 public override void LoadItems()
 {
     Debug.Log("cafebazaar: request load sku items.");
             #if UNITY_ANDROID_CAFE
     if (CheckBillingSupported())
     {
         BazaarIAB.querySkuDetails(allSKUs.ToArray());
     }
             #endif
     setBillingProgress(BillingProgress.WAIT);
     StartCoroutine(WaitForResponse());
 }
Example #7
0
    public override void ConsumePurchasedItem(List <string> skus)
    {
        Debug.Log(string.Format("cafebazaar: request consume sku: {0}", skus.ToArray()));
                #if UNITY_ANDROID_CAFE
        if (CheckBillingSupported())
        {
            BazaarIAB.consumeProducts(skus.ToArray());
        }
                #endif

        setBillingProgress(BillingProgress.WAIT);
        StartCoroutine(WaitForResponse());
    }
    void Start()
    {
        OnItemPurchased += PurchaseSucceed;

#if UNITY_ANDROID
        BazaarIAB.init(
            "MIHNMA0GCSqGSIb3DQEBAQUAA4G7ADCBtwKBrwDd+IlpeNJRf25jGcQxyNnaM2F7ieP5q6yt3PGnizCrzWIbHoLmquM3ZQbPWXSYjpYEJ2dbIHROEvZHD4+oQOEm2skVGCRpbq2nFZm9p1QKstTwbYnWI1bRmeRil/G56VrMt1CvmN3pmgQ/CW6N4aZJawbn/58M+2c0Fwz9AUIECYhB6GHrmqtmBVq2u8zVE62hjK/Ri1QH6bSspvl73feIfDA+yQ4NWV1gwNT9KXECAwEAAQ==");

        IABEventManager.purchaseSucceededEvent += purchase => OnItemPurchased.Invoke(purchase.ProductId);
#if UNITY_ANDROID
        IABEventManager.purchaseSucceededEvent += NewMethod;
#endif
        IABEventManager.purchaseFailedEvent += NewMethod2;
#endif
    }
Example #9
0
 //-------------------------------------------- Purchases Flow section
 public override void PurchaseItem(string sku, string developerPayload)
 {
     Debug.Log(string.Format("cafebazaar: request purchase item sku: {0} devPayload: {1}", sku, developerPayload));
             #if UNITY_ANDROID_CAFE
     if (CheckBillingSupported())
     {
         if (string.IsNullOrEmpty(developerPayload))
         {
             BazaarIAB.purchaseProduct(sku);
         }
         else
         {
             InProgressDeveloperPayload = developerPayload;
             BazaarIAB.purchaseProduct(sku, developerPayload);
         }
     }
             #endif
 }
Example #10
0
    //-------------------------------------------- Query Inventory section
    public override void LoadInventory()
    {
        base.LoadInventory();

        if (allSKUs.Count < 1)
        {
            Debug.Log("cafebazaar: ignore request load SKU because list is empty.");
            return;
        }

        Debug.Log("cafebazaar: request load sku and purchased items.");
                #if UNITY_ANDROID_CAFE
        if (CheckBillingSupported())
        {
            BazaarIAB.queryInventory(allSKUs.ToArray());
        }
                #endif
        setBillingProgress(BillingProgress.WAIT);
        StartCoroutine(WaitForResponse());
    }
Example #11
0
    void Start()
    {
        BazaarIAB.init("MIHNMA0GCSqGSIb3DQEBAQUAA4G7ADCBtwKBrwCsKayLopsdltsho45vsaVhWeamm89xS62xwub2QU8DF9AOndmaLr3yP+lP53tdwNc5V4wVEyb6/EIZWMEZdWAYH2oNOhLNkK2MBSaQ0fHWnXnVTnAoJUnzVJxzCVPOpXAtOK5SVZiDMjlx3q16eYZe6y1ams6+mIcTDpCogHBeQlKT3jWzhTIdyGsz+d7MhwYa5rNU/CzRN09L70XNWctFdF0VCXZkCCFhIgszExUCAwEAAQ==");

        BTN_close.onClick.AddListener(() =>
        {
            BazaarIAB.unbindService();
            Destroy(gameObject);
        });


        BTN_buy_800.onClick.AddListener(() =>
        {
            BazaarIAB.purchaseProduct("CH-V-C");
        });

        BTN_buy_1600.onClick.AddListener(() =>
        {
            BazaarIAB.purchaseProduct("CH-V-C-1");
        });

        BTN_buy_38000.onClick.AddListener(() =>
        {
            BazaarIAB.purchaseProduct("CH-V-C-2");
        });
        BTN_buy_72000.onClick.AddListener(() =>
        {
            BazaarIAB.purchaseProduct("72000");
        });
        BTN_buy_120000.onClick.AddListener(() =>
        {
            BazaarIAB.purchaseProduct("120000");
        });
        BTN_buy_205000.onClick.AddListener(() =>
        {
            BazaarIAB.purchaseProduct("205000");
        });
        BTN_buy_233000.onClick.AddListener(() =>
        {
            BazaarIAB.purchaseProduct("23300");
        });
        BTN_buy_280000.onClick.AddListener(() =>
        {
            BazaarIAB.purchaseProduct("280000");
        });


        //event manager bazaar

        IABEventManager.purchaseFailedEvent    += Event_faild;
        IABEventManager.purchaseSucceededEvent += Even_success;

        void Event_faild(string faild)
        {
            Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment failed", $"{faild}", Raw_model_massage_notifaction.Type.ERRoR, Raw_model_massage_notifaction.Theme.Night);
        }

        void Even_success(BazaarPurchase success)
        {
            //control product
            switch (success.ProductId)
            {
            case "CH-V-C":
            {
                inject_coin_to_server(75);
                BazaarIAB.consumeProduct("CH-V-C");
                Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment Successful", "75 coins have been added to your account\n" + "Thank you for your purchase", Raw_model_massage_notifaction.Type.Success, Raw_model_massage_notifaction.Theme.Night);
            }
            break;

            case "CH-V-C-1":
            {
                inject_coin_to_server(150);
                BazaarIAB.consumeProduct("CH-V-C-1");
                Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment Successful", "800 coins have been added to your account\n" + "Thank you for your purchase", Raw_model_massage_notifaction.Type.Success, Raw_model_massage_notifaction.Theme.Night);
            }
            break;

            case "CH-V-C-2":
            {
                inject_coin_to_server(350);
                BazaarIAB.consumeProduct("CH-V-C-2");
                Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment Successful", "350 coins have been added to your account\n" + "Thank you for your purchase", Raw_model_massage_notifaction.Type.Success, Raw_model_massage_notifaction.Theme.Night);
            }
            break;

            case "72000":
            {
                inject_coin_to_server(1500);
                BazaarIAB.consumeProduct("72000");
                Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment Successful", "1500 coins have been added to your account\n" + "Thank you for your purchase", Raw_model_massage_notifaction.Type.Success, Raw_model_massage_notifaction.Theme.Night);
            }
            break;

            case "120000":
            {
                inject_coin_to_server(1550);
                BazaarIAB.consumeProduct("120000");
                Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment Successful", "1550 coins have been added to your account\n" + "Thank you for your purchase", Raw_model_massage_notifaction.Type.Success, Raw_model_massage_notifaction.Theme.Night);
            }
            break;

            case "205000":
            {
                inject_coin_to_server(2700);
                BazaarIAB.consumeProduct("205000");
                Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment Successful", "2700 coins have been added to your account\n" + "Thank you for your purchase", Raw_model_massage_notifaction.Type.Success, Raw_model_massage_notifaction.Theme.Night);
            }
            break;

            case "23300":
            {
                inject_coin_to_server(6000);
                BazaarIAB.consumeProduct("23300");
                Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment Successful", "6000 coins have been added to your account\n" + "Thank you for your purchase", Raw_model_massage_notifaction.Type.Success, Raw_model_massage_notifaction.Theme.Night);
            }
            break;

            case "280000":
            {
                inject_coin_to_server(10000);
                BazaarIAB.consumeProduct("280000");
                Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment Successful", "10000 coins have been added to your account\n" + "Thank you for your purchase", Raw_model_massage_notifaction.Type.Success, Raw_model_massage_notifaction.Theme.Night);
            }
            break;
            }

            //update coin panel shop
            Text_coin_panel_shop.text = PlayerPrefs.GetInt("Coin").ToString();

            //add history to server
            Data_buy data_purchase = new Data_buy
            {
                developerid          = success.DeveloperPayload,
                Orderid              = success.OrderId,
                orginal_Json         = success.OriginalJson,
                Purchasses_pakage    = success.PackageName,
                Purchasses_productid = success.ProductId,
                Purchasses_state     = success.PurchaseState.ToString(),
                Purchasses_time      = success.PurchaseTime.ToString(),
                Purchasses_token     = success.PurchaseToken,
                Signuture            = success.Signature,
                Type = success.Type,
            };

            Chilligames_SDK.API_Client.Add_purchasses_history(new Req_add_purchasses_history {
                _id = _id, data_purchass = ChilligamesJson.SerializeObject(data_purchase), Name_app = "Venomic"
            }, () => { }, err => { });
        }
    }
    private static void Consume(string itemId)
    {
#if UNITY_ANDROID
        BazaarIAB.consumeProduct(itemId);
#endif
    }
Example #13
0
 private void purchaseSucceededEvent(BazaarPurchase purchase)
 {
     BazaarIAB.consumeProduct(products[productIndex].Id);
     PlayerPrefs.SetInt("Coin", PlayerPrefs.GetInt("Coin") + products[productIndex].Coin);
     CoinTxt.text = PlayerPrefs.GetInt("Coin").ToString();
 }
Example #14
0
 void Awake()
 {
     BazaarIAB.init(RSICode);
     CoinTxt.text = PlayerPrefs.GetInt("Coin").ToString();
 }
Example #15
0
 public void PurchaseProduct(string productId)
 {
     BazaarIAB.purchaseProduct(FilterAlias(productId));
 }
Example #16
0
 public void QuerySkuInfo(string[] productIds)
 {
     BazaarIAB.querySkuDetails(FilterAlias(productIds));
 }
Example #17
0
 public void Init()
 {
     BazaarIAB.init(_publicKey);
 }
Example #18
0
    private void Start()
    {
        //step1
        StartCoroutine(Destroy_offer());
        BTN_reject.onClick.AddListener(() =>
        {
            anim = 1;
        });

        BTN_accept.onClick.AddListener(() =>
        {
            anim = 2;
            StopAllCoroutines();
        });


        //step_2
        BTN_close_step_2.onClick.AddListener(() =>
        {
            anim = 3;
        });

        BTN_pluse_freeze.onClick.AddListener(() =>
        {
            if (PlayerPrefs.GetInt("Coin") >= 4)
            {
                PlayerPrefs.SetInt("Freeze", PlayerPrefs.GetInt("Freeze") + 1);
                PlayerPrefs.SetInt("Coin", PlayerPrefs.GetInt("Coin") - 4);
            }
            else
            {
                anim = 4;
            }
        });
        BTN_pluse_minuse.onClick.AddListener(() =>
        {
            if (PlayerPrefs.GetInt("Coin") >= 2)
            {
                PlayerPrefs.SetInt("Minuse", PlayerPrefs.GetInt("Minuse") + 1);
                PlayerPrefs.SetInt("Coin", PlayerPrefs.GetInt("Coin") - 2);
            }
            else
            {
                anim = 4;
            }
        });
        BTN_pluse_delete.onClick.AddListener(() =>
        {
            if (PlayerPrefs.GetInt("Coin") >= 3)
            {
                PlayerPrefs.SetInt("Delete", PlayerPrefs.GetInt("Delete") + 1);
                PlayerPrefs.SetInt("Coin", PlayerPrefs.GetInt("Coin") - 3);
            }
            else
            {
                anim = 4;
            }
        });
        BTN_pluse_chance.onClick.AddListener(() =>
        {
            if (PlayerPrefs.GetInt("Coin") >= 2)
            {
                PlayerPrefs.SetInt("Chance", PlayerPrefs.GetInt("Chance") + 1);
                PlayerPrefs.SetInt("Coin", PlayerPrefs.GetInt("Coin") - 2);
            }
            else
            {
                anim = 4;
            }
        });
        BTN_pluse_reset.onClick.AddListener(() =>
        {
            if (PlayerPrefs.GetInt("Coin") >= 4)
            {
                PlayerPrefs.SetInt("Reset", PlayerPrefs.GetInt("Reset") + 1);
                PlayerPrefs.SetInt("Coin", PlayerPrefs.GetInt("Coin") - 4);
            }
            else
            {
                anim = 4;
            }
        });


        //step_3

        BazaarIAB.init("MIHNMA0GCSqGSIb3DQEBAQUAA4G7ADCBtwKBrwCsKayLopsdltsho45vsaVhWeamm89xS62xwub2QU8DF9AOndmaLr3yP+lP53tdwNc5V4wVEyb6/EIZWMEZdWAYH2oNOhLNkK2MBSaQ0fHWnXnVTnAoJUnzVJxzCVPOpXAtOK5SVZiDMjlx3q16eYZe6y1ams6+mIcTDpCogHBeQlKT3jWzhTIdyGsz+d7MhwYa5rNU/CzRN09L70XNWctFdF0VCXZkCCFhIgszExUCAwEAAQ==");
        BTN_close.onClick.AddListener(() =>
        {
            anim = 5;
        });

        BTN_buy_800.onClick.AddListener(() =>
        {
            BazaarIAB.purchaseProduct("CH-V-C");
        });
        BTN_buy_1600.onClick.AddListener(() =>
        {
            BazaarIAB.purchaseProduct("CH-V-C-1");
        });
        BTN_buy_38000.onClick.AddListener(() =>
        {
            BazaarIAB.purchaseProduct("CH-V-C-2");
        });
        BTN_buy_72000.onClick.AddListener(() =>
        {
            BazaarIAB.purchaseProduct("72000");
        });
        BTN_buy_120000.onClick.AddListener(() =>
        {
            BazaarIAB.purchaseProduct("120000");
        });
        BTN_buy_205000.onClick.AddListener(() =>
        {
            BazaarIAB.purchaseProduct("205000");
        });
        BTN_buy_233000.onClick.AddListener(() =>
        {
            BazaarIAB.purchaseProduct("23300");
        });
        BTN_buy_280000.onClick.AddListener(() =>
        {
            BazaarIAB.purchaseProduct("280000");
        });


        //bazaar event
        IABEventManager.purchaseSucceededEvent +=
            Success =>
        {
            switch (Success.ProductId)
            {
            case "CH-V-C":
            {
                inject_coin(75);
                BazaarIAB.consumeProduct("CH-V-C");
                Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment Successful", "75 coins have been added to your account\n" + "Thank you for your purchase", Raw_model_massage_notifaction.Type.Success, Raw_model_massage_notifaction.Theme.Night);
            }
            break;

            case "CH-V-C-1":
            {
                inject_coin(150);
                BazaarIAB.consumeProduct("CH-V-C-1");
                Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment Successful", "150 coins have been added to your account\n" + "Thank you for your purchase", Raw_model_massage_notifaction.Type.Success, Raw_model_massage_notifaction.Theme.Night);
            }
            break;

            case "CH-V-C-2":
            {
                inject_coin(350);
                BazaarIAB.consumeProduct("CH-V-C-2");
                Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment Successful", "350 coins have been added to your account\n" + "Thank you for your purchase", Raw_model_massage_notifaction.Type.Success, Raw_model_massage_notifaction.Theme.Night);
            }
            break;

            case "72000":
            {
                inject_coin(1500);
                BazaarIAB.consumeProduct("72000");
                Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment Successful", "1500 coins have been added to your account\n" + "Thank you for your purchase", Raw_model_massage_notifaction.Type.Success, Raw_model_massage_notifaction.Theme.Night);
            }
            break;

            case "120000":
            {
                inject_coin(1550);
                BazaarIAB.consumeProduct("120000");
                Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment Successful", "1550 coins have been added to your account\n" + "Thank you for your purchase", Raw_model_massage_notifaction.Type.Success, Raw_model_massage_notifaction.Theme.Night);
            }
            break;

            case "205000":
            {
                inject_coin(2700);
                BazaarIAB.consumeProduct("205000");
                Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment Successful", "2700 coins have been added to your account\n" + "Thank you for your purchase", Raw_model_massage_notifaction.Type.Success, Raw_model_massage_notifaction.Theme.Night);
            }
            break;

            case "23300":
            {
                inject_coin(6000);
                BazaarIAB.consumeProduct("23300");

                Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment Successful", "6000coins have been added to your account\n" + "Thank you for your purchase", Raw_model_massage_notifaction.Type.Success, Raw_model_massage_notifaction.Theme.Night);
            }
            break;

            case "280000":
            {
                inject_coin(10000);
                BazaarIAB.consumeProduct("280000");
                Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment Successful", "10000 coins have been added to your account\n" + "Thank you for your purchase", Raw_model_massage_notifaction.Type.Success, Raw_model_massage_notifaction.Theme.Night);
            }
            break;
            }

            Data_buy data_Buy = new Data_buy
            {
                developerid          = Success.DeveloperPayload,
                Orderid              = Success.OrderId,
                orginal_Json         = Success.OriginalJson,
                Purchasses_pakage    = Success.PackageName,
                Purchasses_productid = Success.ProductId,
                Purchasses_state     = Success.PurchaseState.ToString(),
                Purchasses_time      = Success.PurchaseTime.ToString(),
                Purchasses_token     = Success.PurchaseToken,
                Signuture            = Success.Signature,
                Type = Success.Type
            };

            Chilligames_SDK.API_Client.Add_purchasses_history(new Chilligames.SDK.Model_Client.Req_add_purchasses_history {
                data_purchass = ChilligamesJson.SerializeObject(data_Buy), _id = _id, Name_app = "Venomic"
            }, () => { }, err => { });;
        };

        IABEventManager.purchaseFailedEvent +=
            faild =>
        {
            Instantiate(Raw_model_message_notifaction).GetComponent <Raw_model_massage_notifaction>().Change_value("Payment failed", $"{faild}", Raw_model_massage_notifaction.Type.ERRoR, Raw_model_massage_notifaction.Theme.Night);
        };


        //inject to server and game
        void inject_coin(int Coin_count)
        {
            PlayerPrefs.SetInt("Coin", PlayerPrefs.GetInt("Coin") + Coin_count);

            Chilligames_SDK.API_Client.Coin_Insert(new Chilligames.SDK.Model_Client.Req_Insert_coin {
            }, () => { }, err => { });
        }
    }
 private void Support()
 {
     Debug.Log("Init Done");
     BazaarIAB.queryInventory(skues);
     Debug.Log("Skus:\n" + skues);
 }
Example #20
0
 public void ConsumeProduct(string productId)
 {
     BazaarIAB.consumeProduct(FilterAlias(productId));
 }
    public void BuyItem(string itemId)
    {
#if UNITY_ANDROID
        BazaarIAB.purchaseProduct(itemId);
#endif
    }
Example #22
0
 public void Pardakht(int index)
 {
     productIndex = index;
     BazaarIAB.purchaseProduct(products[productIndex].Id);
 }
Example #23
0
 public void QueryNotConsumedPurchases()
 {
     BazaarIAB.queryPurchases();
 }
Example #24
0
 public void PurchaseWhitBazaar()
 {
     BazaarIAB.purchaseProduct(_sItem.ItemId);
     Close("Purchased");
 }
Example #25
0
    void OnGUI()
    {
        GUILayout.BeginArea(new Rect(10f, 10f, Screen.width - 15f, Screen.height - 15f));
        GUI.skin.button.fixedHeight = 50;
        GUI.skin.button.fontSize    = 20;

        if (Button("Initialize IAB"))
        {
            var key = "MIHNMA0GCSqGSIb3DQEBAQUAA4G7ADCBtwKBrwDN72wlPXo4pFK78rElKD+nwc9OnHHL+YYAt0o2Fm6H+7pNoOKLk/fbXrmV3jaL2cz99IClllFKEAvo6VbyRyIOD5cWpBCV+IFVobCPs9dtCV0M4DDqpVY2NUR9WownlNMwr/AwmwW750xS8BvQ9zt5+u7VEhLkAJPVxWJfr+kLHI7519s9T5eb58cdAM+bvJ1vT0pGx6te5DrV8IHUUCKpDYPy7kBfc9wdcT6EBUMCAwEAAQ==";
            BazaarIAB.init(key);
        }

        if (Button("Query Inventory"))
        {
            BazaarIAB.queryInventory(skus);
        }

        if (Button("Query SkuDetails"))
        {
            BazaarIAB.querySkuDetails(skus);
        }

        if (Button("Query Purchases"))
        {
            BazaarIAB.queryPurchases();
        }

        if (Button("Are subscriptions supported?"))
        {
            Debug.Log("subscriptions supported: " + BazaarIAB.areSubscriptionsSupported());
        }

        if (Button("Purchase Product Test1"))
        {
            BazaarIAB.purchaseProduct("com.fanafzar.bazaarplugin.test1");
        }

        if (Button("Purchase Product Test2"))
        {
            BazaarIAB.purchaseProduct("com.fanafzar.bazaarplugin.test2");
        }

        if (Button("Consume Purchase Test1"))
        {
            BazaarIAB.consumeProduct("com.fanafzar.bazaarplugin.test1");
        }

        if (Button("Consume Purchase Test2"))
        {
            BazaarIAB.consumeProduct("com.fanafzar.bazaarplugin.test2");
        }

        if (Button("Consume Multiple Purchases"))
        {
            var skus = new string[] { "com.fanafzar.bazaarplugin.test1", "com.fanafzar.bazaarplugin.test2" };
            BazaarIAB.consumeProducts(skus);
        }

        if (Button("Test Unavailable Item"))
        {
            BazaarIAB.purchaseProduct("com.fanafzar.bazaarplugin.unavailable");
        }

        if (Button("Purchase Monthly Subscription"))
        {
            BazaarIAB.purchaseProduct("com.fanafzar.bazaarplugin.monthly_subscribtion_test", "subscription payload");
        }

        if (Button("Purchase Annually Subscription"))
        {
            BazaarIAB.purchaseProduct("com.fanafzar.bazaarplugin.annually_subscribtion_test", "subscription payload");
        }

        if (Button("Enable High Details Logs"))
        {
            BazaarIAB.enableLogging(true);
        }

        GUILayout.EndArea();
    }