Esempio n. 1
0
 public void BuyProVersion()
 {
     if (StoreLoaded == true && IOSInAppPurchaseManager.Instance.IsInAppPurchasesEnabled)
     {
         PaymentManagerExample.buyItem(PaymentManagerExample.Pro_Version);
     }
 }
Esempio n. 2
0
 public void BuyRemoveAds()
 {
     if (StoreLoaded == true && IOSInAppPurchaseManager.Instance.IsInAppPurchasesEnabled)
     {
         PaymentManagerExample.buyItem(PaymentManagerExample.No_Ads);
     }
 }
Esempio n. 3
0
    /// <summary>
    /// 支付
    /// </summary>
    public static void PayForProduct(string productId)
    {
        string ipaValue = string.Format(productId);

        PaymentManagerExample.buyItem(ipaValue);
        LoadingBlockCtrl.Show();
    }
Esempio n. 4
0
    //--------------------------------------
    //  PUBLIC METHODS
    //--------------------------------------

    void OnGUI()
    {
        UpdateToStartPos();

        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "In-App Purchases", style);


        StartY += YLableStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Perfrom Buy"))
        {
            PaymentManagerExample.buyItem(PaymentManagerExample.SMALL_PACK);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Perfrom Buy2"))
        {
            PaymentManagerExample.buyItem(PaymentManagerExample.NC_PACK);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Restore Purshases"))
        {
            IOSInAppPurchaseManager.instance.restorePurchases();
        }


        StartX  = XStartPos;
        StartY += YButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Verifay Last Purshase"))
        {
            IOSInAppPurchaseManager.instance.verifyLastPurchase(IOSInAppPurchaseManager.SANDBOX_VERIFICATION_SERVER);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Load Product View"))
        {
            IOSStoreProductView view = new IOSStoreProductView("333700869");
            view.Load();
        }
    }
Esempio n. 5
0
    //--------------------------------------
    //  PUBLIC METHODS
    //--------------------------------------

    void OnGUI()
    {
        UpdateToStartPos();

        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "In-App Purchases", style);



        StartY += YLableStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Init"))
        {
            PaymentManagerExample.init();
        }


        if (IOSInAppPurchaseManager.Instance.IsStoreLoaded)
        {
            GUI.enabled = true;
        }
        else
        {
            GUI.enabled = false;
        }


        StartX  = XStartPos;
        StartY += YButtonStep;

        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Perform Buy #1"))
        {
            PaymentManagerExample.buyItem(PaymentManagerExample.SMALL_PACK);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Perform Buy #2"))
        {
            PaymentManagerExample.buyItem(PaymentManagerExample.NC_PACK);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Restore Purchases"))
        {
            IOSInAppPurchaseManager.Instance.restorePurchases();
        }


        StartX  = XStartPos;
        StartY += YButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Verify Last Purchases"))
        {
            IOSInAppPurchaseManager.Instance.VerifyLastPurchase(IOSInAppPurchaseManager.SANDBOX_VERIFICATION_SERVER);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Load Product View"))
        {
            IOSStoreProductView view = new IOSStoreProductView("333700869");
            view.Disnissed += StoreProductViewDisnissed;
            view.Load();
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Is Payments Enabled On device"))
        {
            IOSInAppPurchaseManager.Instance.OnPurchasesStateSettingsLoaded += OnPurchasesStateSettingsLoaded;
            IOSInAppPurchaseManager.Instance.RequestInAppSettingState();
        }


        StartX  = XStartPos;
        StartY += YButtonStep;
        StartY += YLableStep;

        GUI.enabled = true;
        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Local Receipt Validation", style);

        StartY += YLableStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth + 10, buttonHeight), "Load Receipt"))
        {
            ISN_Security.OnReceiptLoaded += OnReceiptLoaded;
            ISN_Security.Instance.RetrieveLocalReceipt();
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Retrive Device GUID"))
        {
            ISN_Security.OnGUIDLoaded += OnGUIDLoaded;
            ISN_Security.Instance.RetrieveDeviceGUID();
        }
    }
Esempio n. 6
0
 // Update is called once per frame
 public void Buy()
 {
     PaymentManagerExample.buyItem(PaymentManagerExample.SMALL_PACK);
 }