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

        PaymentManagerExample.buyItem(ipaValue);
        LoadingBlockCtrl.Show();
    }
Example #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();
        }
    }
Example #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();
        }
    }
Example #6
0
 // Use this for initialization
 public void Init()
 {
     Debug.Log("Init");
     //IOSMessage.Create("Init", "Init");
     PaymentManagerExample.init();
 }
Example #7
0
 // Update is called once per frame
 public void Buy()
 {
     PaymentManagerExample.buyItem(PaymentManagerExample.SMALL_PACK);
 }
Example #8
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------

    void Awake()
    {
        PaymentManagerExample.init();
    }