/// <summary>
    /// 캐쉬 소모후 나타내는 팝업
    /// </summary>

    void PopupAfterUserCash()
    {
        InitPopupList();
        mServer = new AmServer();
        switch (mServer.KindOfPopup("AfterCashUse", Ag.mySelf.myRank.WAS.weekScore))
        {
        case AmServer.PopupStore.DiscCash:
            Productid = "com.appsgraphy.kvsskakao.popupstore06";
            #if UNITY_ANDROID
            GoogleIAB.consumeProduct(Productid);
            GoogleIABManager.purchaseSucceededEvent += PurchaseSuccessed;
            #endif
            GetTranjectionkey();
            mProductCode  = "1000007369";
            mPaymentPrice = 50000;
            MenuCommonOpen("Ui_popupstore", "PopupBuyEventCash", true);

            /*
             * ShowSalePrice (dicMenuList["PopupBuyEventCash"].transform.FindChild ("btn_item/Label_cost_before").GetComponent<UILabel>(),
             *             "0",
             *             dicMenuList["PopupBuyEventCash"].transform.FindChild ("btn_item/Label_cost").GetComponent<UILabel>(),
             *             "0");
             * dicMenuList["PopupBuyEventCash"].transform.FindChild ("btngrid/btn_cash").gameObject.SetActive(false);
             * dicMenuList["PopupBuyEventCash"].transform.FindChild ("btngrid/btn_point").gameObject.SetActive(false);
             */
            break;
        }
    }
Exemplo n.º 2
0
        // set product to purchased after successful verification (or without)
        // Consumable IAPs must be consumed
        // For non consumable IAPs or subscriptions, alter database entry
        private void PurchaseVerified(string id)
        {
            if (!IAPObjects.ContainsKey(id))
            {
                return;
            }
            IAPObject obj = IAPObjects[id];

            #if UNITY_ANDROID
            if (obj.type == IAPType.consumable)
            {
                GoogleIAB.consumeProduct(obj.GetIdentifier()); //local id
                return;
            }
            #endif

            //don't continue if the product is already purchased,
            //for example if we just want to verify an existing product again
            if (DBManager.isPurchased(id))
            {
                return;
            }

            if (obj.type == IAPType.nonConsumable || obj.type == IAPType.subscription)
            {
                DBManager.SetToPurchased(id);
            }

            purchaseSucceededEvent(id);
        }
Exemplo n.º 3
0
 public void ConsumeProduct()
 {
     if (this.m_RecoveryItem != null)
     {
         GoogleIAB.consumeProduct(this.m_RecoveryItem.productId);
     }
 }
Exemplo n.º 4
0
        void OnReceiptVerificationComplete()
        {
            Debug.Log("OnReceiptVerificationComplete");
            KongregateAPI kongregate = KongregateAPI.GetAPI();
            // we keep a list of transactions here so that we don't run into race conditions
            Dictionary <string, object> stillInVerification = new Dictionary <string, object> ();

            foreach (var transactionId in mTransactionsInVerification.Keys)
            {
                string status = kongregate.Mtx.ReceiptVerificationStatus(transactionId);
                if (status != KongregateAPI.RECEIPT_VERIFICATION_STATUS_PROCESSING)
                {
                    Debug.Log("Verification for " + transactionId + " is " + status);
                                        #if UNITY_IPHONE
                    if (status == KongregateAPI.RECEIPT_VERIFICATION_STATUS_VALID)
                    {
                        StoreKitTransaction transaction = (StoreKitTransaction)mTransactionsInVerification[transactionId];
                        KongregateAPI.GetAPI().Analytics.FinishPurchase(KongregateAPI.PURCHASE_SUCCESS,
                                                                        transactionId, getPurchaseFields());

                        // Below is an alternative iOS FinishPurchase() call. This version may be used if your plugin
                        // does not make the transaction Id available or finishes the transaction before passing control
                        // back to Unity. FinishPurchase() is preferred because purchase details may be pulled directly from
                        // the transaction.

                        // KongregateAPI.GetAPI().Analytics.FinishPurchaseWithProductId(KongregateAPI.PURCHASE_SUCCESS,
                        //  transaction.productIdentifier, transaction.base64EncodedTransactionReceipt, getPurchaseFields());
                    }
                    else if (status == KongregateAPI.RECEIPT_VERIFICATION_STATUS_INVALID)
                    {
                        KongregateAPI.GetAPI().Analytics.FinishPurchase(KongregateAPI.PURCHASE_RECEIPT_FAIL,
                                                                        transactionId, getPurchaseFields());
                    }
                    // call to finish the transaction regardless of it we are valid or not
                    StoreKitBinding.finishPendingTransaction(transactionId);
                                        #elif UNITY_ANDROID
                    GooglePurchase transaction = (GooglePurchase)mTransactionsInVerification [transactionId];
                    if (status == KongregateAPI.RECEIPT_VERIFICATION_STATUS_VALID)
                    {
                        KongregateAPI.GetAPI().Analytics.FinishPurchase(KongregateAPI.PURCHASE_SUCCESS,
                                                                        transaction.originalJson, getPurchaseFields(), transaction.signature);
                    }
                    else if (status == KongregateAPI.RECEIPT_VERIFICATION_STATUS_INVALID)
                    {
                        KongregateAPI.GetAPI().Analytics.FinishPurchase(KongregateAPI.PURCHASE_RECEIPT_FAIL,
                                                                        transaction.originalJson, getPurchaseFields());
                    }
                    // call to finish transaction regardless of it we are valid or not
                    GoogleIAB.consumeProduct(transaction.productId);
                                        #endif
                    mPurchaseReady = true;
                }
                else
                {
                    Debug.Log("Still waiting on verification for " + transactionId);
                    stillInVerification [transactionId] = mTransactionsInVerification [transactionId];
                }
            }
            mTransactionsInVerification = stillInVerification;
        }
    // 인앱결제 성공 웹서버 콜백
    void callback_complete_buyGem()
    {
        //결제 성공 시 바로 소모 전송
        UserEditor.Getsingleton.EditLog("인앱결제상품 소모하기 ~~ : " + buyProductID);
        GoogleIAB.consumeProduct(buyProductID);


        //구매완료했으니 통계에 넣자
        GoogleSkuInfo buyProductInfo = Dic_ProductInfo[buyProductID];
        string        reStr          = buyProductInfo.price.Remove(0, 1); //\  문자 지우기
        double        dprice         = Convert.ToDouble(reStr);

        //AnalysisManager.instance.Anl_Purchace(buyProductInfo.title, buyProductInfo.priceCurrencyCode, dprice);


        if (nextPrcs != null)
        {
            nextPrcs();
        }
        ////top 갱신
        //UI_Top.Getsingleton.set_refresh();

        //if (Get_GemShopIdx(buyProductID) == 301) // 월정액 상품 이라면 상점ui 자체를 refresh하자
        //{
        //    UI_Top.Getsingleton.popupStore.Refresh_store();
        //}
    }
    void PopupAfterCombi()
    {
        // show image
        InitPopupList();
        int ranN = AgUtil.RandomInclude(1, 999);

        if (ranN % 5 == 1)
        {
            if (ranN % 2 == 0)
            {
                Productid     = "com.appsgraphy.kvsskakao.popupstore04";
                mProductCode  = "1000007367";
                mPaymentPrice = 20000;
                GetTranjectionkey();
                popupCode = "DiscCombi";
                #if UNITY_ANDROID
                GoogleIAB.consumeProduct(Productid);
                GoogleIABManager.purchaseSucceededEvent += PurchaseSuccessed;
                #endif
                MenuCommonOpen("Ui_popupstore", "PopupCardMixLuckTicket", true);

                /*
                 * ShowSalePrice (dicMenuList["PopupCardMixLuckTicket"].transform.FindChild ("btn_item/Label_cost_before1").GetComponent<UILabel>(),
                 *             (ItemPrice("CardCombiAdvtHigh")*AfterEa ("DiscCombi")).ToString(),
                 *             dicMenuList["PopupCardMixLuckTicket"].transform.FindChild ("btn_item/Label_cost1").GetComponent<UILabel>(),
                 *             AfterPrice ("DiscCombi").ToString());
                 *
                 * dicMenuList["PopupCardMixLuckTicket"].transform.FindChild ("btn_item/Label_gold").GetComponent<UILabel>().text = "X "+ AfterEa ("DiscCombi").ToString();
                 */

                // General Show ...
            }
            else
            {
                Productid = "com.appsgraphy.kvsskakao.popupstore05";
                GetTranjectionkey();
                mProductCode  = "1000007368";
                mPaymentPrice = 20000;
                popupCode     = "DiscSave";


                #if UNITY_ANDROID
                GoogleIAB.consumeProduct(Productid);
                GoogleIABManager.purchaseSucceededEvent += PurchaseSuccessed;
                #endif
                MenuCommonOpen("Ui_popupstore", "PopupCardMixGradeReserveTicket", true);

                /*
                 * ShowSalePrice (dicMenuList["PopupCardMixGradeReserveTicket"].transform.FindChild ("btn_item/Label_cost_before1").GetComponent<UILabel>(),
                 *             (ItemPrice("CardCombiGrade")* AfterEa ("DiscSave")).ToString(),
                 *             dicMenuList["PopupCardMixGradeReserveTicket"].transform.FindChild ("btn_item/Label_cost1").GetComponent<UILabel>(),
                 *             AfterPrice ("DiscSave").ToString());
                 * dicMenuList["PopupCardMixGradeReserveTicket"].transform.FindChild ("btn_item/Label_safe").GetComponent<UILabel>().text = "X "+ AfterEa ("DiscSave").ToString();
                 */
            }
            // Show --- Grade retain ...
        }
        // button Action ...
    }
Exemplo n.º 7
0
    private IEnumerator OnConsume(IAPUnit mIap)
    {
        yield return(new WaitForSeconds(0.1f));

        #if UNITY_ANDROID
        GoogleIAB.consumeProduct(mIap.IAP_Id);
        #endif
    }
Exemplo n.º 8
0
 // Fired when a purchase succeeds
 public void purchaseSucceededEvent(GooglePurchase purchase)
 {
     Debug.Log("GoogleIABManager:purchaseSucceededEvent product: " + purchase.productId);
     SetContentAccessPermissions(purchase.productId);
     GoogleIAB.consumeProduct(purchase.productId);
     purchaseProcessCompleted = true;
     //HandleSuccess();
 }
Exemplo n.º 9
0
 // tries to consume all previous purchases stored on Google Servers.
 // Do not use for production versions! this is for testing only
 private void DebugConsumeProducts()
 {
     Debug.Log("Attempting to consume all purchases.");
     for (int i = 0; i < prods.Count; i++)
     {
         GoogleIAB.consumeProduct(prods[i].productId);
     }
 }
Exemplo n.º 10
0
    //////////////////// B. 결제 성공 / 실패 ////////////////////////////////////////////////////////////

    /* 결제 성공 시 호출되는 콜백 함수.
     * GoogleIAB.purchaseProduct(purchaseKey); 실행 후 호출되는 콜백 함수.
     * 반드시 소비 요청  GoogleIAB.consumeProduct(productId); 을 해야 재구매가 가능.
     */
    #region
    void purchaseSucceededEvent(GooglePurchase purchase)
    {
        Debug.Log("purchaseSucceededEvent: " + purchase);


        // 해당 Product ID 의 소비 요청 반드시 시작 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.
        GoogleIAB.consumeProduct(purchase.productId);
    }
Exemplo n.º 11
0
        //
        void IABQueryInventorySucceeded(List <GooglePurchase> purchases, List <GoogleSkuInfo> skus)
        {
            GameUtility.Me.HideProgressDialog();
            MyDebug.Log("InAppManager::IABQueryInventorySucceeded => " + purchases.Count + " : " + skus.Count);
            if (purchases == null || skus == null)
            {
                MyDebug.Log("Not able to retrive product list from Google, please try after some time.");
                PopupMessages.Me.PurchaseFailMessage();
                CoreUtility.Me.OnInAppFail(pID);
                return;
            }

            if (purchases.Count <= 0 && !isRestore)
            {
                //Fresh Purchase
                GoogleIAB.purchaseProduct(pID);
            }
            else if (purchases.Count > 0 && !isRestore)
            {
                //Conuseme and Purchase
                for (int i = 0; i < purchases.Count; i++)
                {
                    if (!NON_CONSU_PRODUCTS.Contains("," + purchases[i].productId + ","))
                    {
                        GoogleIAB.consumeProduct(purchases[i].productId);
                    }
                    else if (pID == purchases[i].productId)
                    {
                        PurchaseSuccessful(purchases[i].productId, purchases[i].orderId);
                        return;
                    }
                }
                GoogleIAB.purchaseProduct(pID);
            }
            else if (isRestore && purchases.Count > 0)
            {
                //Restore
                for (int i = 0; i < purchases.Count; i++)
                {
                    if (!NON_CONSU_PRODUCTS.Contains("," + purchases[i].productId + ","))
                    {
                        GoogleIAB.consumeProduct(purchases[i].productId);
                    }
                    else
                    {
                        PurchaseSuccessful(purchases[i].productId, purchases[i].orderId);
                    }
                }
                PopupMessages.Me.RestoreSuccessfulMessage();
                isRestore = false;
            }
            else if (purchases.Count <= 0 && isRestore)
            {
                MyDebug.Log("Nothing to Restore");
                PopupMessages.Me.NothingToRestoreMessage();
                isRestore = false;
            }
        }
 void purchaseSucceededEvent(GooglePurchase purchase)
 {
     Debug.Log("purchaseSucceededEvent: " + purchase);
     gpderID     = purchase.orderId;
     gpproduceID = purchase.productId;
     Debug.Log("order id is :" + gpderID);
     iabPurchaseFinish(0, "purchase Success");
     GoogleIAB.consumeProduct(purchase.productId);
 }
Exemplo n.º 13
0
 private void EndPurchase(AndroidPurchase _purchase)
 {
     if ((_purchase.State == EPurchaseState.Commited) && (_purchase.GooglePurchase != null))
     {
         GoogleIAB.consumeProduct(_purchase.GooglePurchase.productId);
     }
     else if (this.currentPurchase == _purchase)
     {
         this.currentPurchase = null;
     }
 }
Exemplo n.º 14
0
    public static void InitStore()
    {
        InAppPersistenceManager.instance.Init(skus);
        BillingManager.instance.init("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqke5E4wdSbtxFRGTHNH5HoPcj/t7wSwxNSIGODE72Rpp1PoU378SRTUD2i0LotYyQeRtQRDEcivcmUsAYRA23RzXPaRUL0aLAfoaDIw2LbXk7cxHGzyrBVdtqj7+a6+uTLoSo7/WKZAxiWitjDcsE93WTL5d60M/SAcEcfQah1opzMXPGvEGbKb2l+c90P4mjuvckbzvtNzk57UWh76MJrGZCFveU9AcBP4MpJNM57fANGamS83cPzbElrUUyzO/4LKLpkvLu2y4vZipHM89p4RnTIL07SFl4Fon42BNuwkVe/XqOY3luj70UHlzsTakBD7kaRFDSyJRshtQyCup1QIDAQAB", skus);
#if UNITY_ANDROID
        foreach (string s in skus)
        {
            GoogleIAB.consumeProduct(s);
        }
#endif
    }
Exemplo n.º 15
0
    protected void OnVerificationSuccess(GooglePurchase purchase)
    {
#if UNITY_ANDROID
        GoogleIABManager.purchaseCompleteAwaitingVerificationEvent -= OnProductAwaitingVerificationAndroid;
        GoogleIABManager.purchaseSucceededEvent -= OnVerificationSuccess;
        GoogleIABManager.purchaseFailedEvent    -= OnProductFailed;

        GoogleIAB.consumeProduct(purchase.productId);
#endif

        OnVerificationSuccess();
    }
Exemplo n.º 16
0
    public void HandlePurchase(Dictionary <string, object> resp, string productID)
    {
        //User.UserHardCurrency =     (int) System.Convert.ToInt32(resp["hardCurrency"]);
        //User.UserSoftcurrency =     (int) System.Convert.ToInt32(resp["softCurrency"]);
        //User.UserExternalCurrency = (int) System.Convert.ToInt32(resp["externalCurrency"]);
        //UI_SoftCoins.Instance.updateCoins();
        //UI_CompraMonedaPremium.Instance.update();
#if UNITY_ANDROID
        GoogleIAB.consumeProduct(productID);
#endif
        PurchaseManager.PerformPurchase(productID);
    }
    // 소모되않은 상품 소모처리완료
    void callback_complete_NoneConsumeProduct(GooglePurchase noneConsumePt)
    {
        //결제 성공 시 바로 소모 전송
        UserEditor.Getsingleton.EditLog("소모되않은 상품 소모처리 완료 ~~ : " + buyProductID);
        GoogleIAB.consumeProduct(noneConsumePt.productId);


        //구매완료했으니 통계에 넣자
        GoogleSkuInfo buyProductInfo = Dic_ProductInfo[noneConsumePt.productId];
        string        reStr          = buyProductInfo.price.Remove(0, 1); //\  문자 지우기
        double        dprice         = Convert.ToDouble(reStr);
        //AnalysisManager.instance.Anl_Purchace(buyProductInfo.title, buyProductInfo.priceCurrencyCode, dprice);
    }
Exemplo n.º 18
0
 public void Purchase(string productId)
 {
             #if UNITY_ANDROID
     if (ShopEvents.purchasedProductIds.Contains(productId))
     {
         GoogleIAB.consumeProduct(productId);
     }
     else
     {
         GoogleIAB.purchaseProduct(productId);
     }
             #endif
 }
Exemplo n.º 19
0
    public IEnumerator SendPurchasedLog20(string purchasedData, string signature)
    {
        Debug.Log(purchasedData);
        Debug.Log(signature);
        string  hash                    = Md5Sum(secretKey).ToLower();
        string  price                   = "1.99";
        string  userUniNumber           = ValueDeliverScript.UserID;
        float   tempTime                = 0;
        float   ServerConnectionTimeout = 10.0f;
        WWWForm form                    = new WWWForm();

        form.AddField("Unique_number", userUniNumber);
        form.AddField("Price", price);
        form.AddField("Detail_Data", purchasedData);
        form.AddField("Signature", signature);
        form.AddField("hash", hash);

        WWW www = new WWW(UpdatePurchasedLogUrl, form);

        yield return(www);

        while (!www.isDone && www.error == null && tempTime < ServerConnectionTimeout)
        {
            tempTime += Time.deltaTime;
            yield return(0);
        }
        if (www.error != null || tempTime >= ServerConnectionTimeout)
        {
            Debug.Log("Disconnected!!!!!!!!!!!!!!!!!!!!!!!!!!!");
            Debug.Log(www.error);
        }
        else
        {
            wwwResult = www.text;

            if (wwwResult == "PurchaseLogUpdateSuccess")
            {
                Debug.Log(wwwResult);
                Goods01.GetComponent <StoreCoinGoodScript>().Purchase();
                GoogleIAB.consumeProduct("com.joywinggames.maydayaos001");
            }
            else
            {
                Debug.Log("PurchaseLogUpdate Fail!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
                Debug.Log(wwwResult);
                Debug.Log(www.error);
            }
        }
    }
Exemplo n.º 20
0
    void queryInventorySucceededEvent(List <GooglePurchase> purchases, List <GoogleSkuInfo> skus)
    {
        Debug.Log(string.Format("queryInventorySucceededEvent. total purchases: {0}, total skus: {1}", purchases.Count, skus.Count));

        if (purchases.Count > 0)
        {
            for (int i = 0; i < purchases.Count; i++)
            {
                GoogleIAB.consumeProduct(purchases[i].productId);
            }
        }

        Prime31.Utils.logObject(purchases);
        Prime31.Utils.logObject(skus);
    }
Exemplo n.º 21
0
    //////////////////// D. 소비 요청 확인 성공 / 실패 ////////////////////////////////////////////////////////////

    /* 구글 결제 정상 처리 후, 소비 요청이 실패 된 것이 있는 지 확인 성공 시 콜백 함수.
     * GoogleIAB.queryInventory( skus ); 실행 후 호출되는 콜백 함수.
     * purchases.Count 값이 0 이면 문제가 없음. (해당 product id 재구매 가능).
     * purchases.Count 값이 0보다 크면 갯수만큼 소비가 안되어 재구매가 안됨.
     * GoogleIAB.consumeProduct(productId); 함수를 사용해서 소비시켜야 함.
     */
    #region
    void queryInventorySucceededEvent(List <GooglePurchase> purchases, List <GoogleSkuInfo> skus)
    {
        Debug.Log(string.Format("DDDDDDDDD sss queryInventorySucceededEvent. total purchases: {0}, total skus: {1}", purchases.Count, skus.Count));
        Prime31.Utils.logObject(purchases);
        Prime31.Utils.logObject(skus);

        // 소비 요청이 안된 아이템이 있는지 확인해서, 소비 요청이 안된 아이템 들에 대한 재요청.
        if (purchases.Count > 0)
        {
            for (int i = 0; i < purchases.Count; i++)
            {
                Debug.Log("DDDDDDD consumeProduct Start,  Product ID  : " + purchases[i].productId);
                GoogleIAB.consumeProduct(purchases[i].productId);
            }
        }
    }
    public void Btn_Fun_Cash55()
    {
        mProductCode  = "1000007358";
        mPaymentPrice = 5000;

        Productid = "com.appsgraphy.kvsskakao.cash0050";
        dicMenuList ["popup_buycash"].SetActive(true);

        #if UNITY_ANDROID
        GoogleIAB.consumeProduct(Productid);
        #endif

        GetTranjectionkey();
        SetPopupPriceLabel("50", "4.99", "5,000");
        Ag.LogString(" MenuManager_Shop ::   Btn_Fun_Cash55   >>>  ProductID " + Productid);
    }
    public void Btn_Fun_Cash1500()
    {
        Productid = "com.appsgraphy.kvsskakao.cash1300";
        dicMenuList ["popup_buycash"].SetActive(true);
        GetTranjectionkey();
        mProductCode  = "1000007363";
        mPaymentPrice = 100000;


        #if UNITY_ANDROID
        GoogleIAB.consumeProduct(Productid);
        #endif

        SetPopupPriceLabel("1300", "99.99", "100,000");
        Ag.LogString(" MenuManager_Shop ::   Btn_Fun_Cash1500   >>>  ProductID " + Productid);
    }
Exemplo n.º 24
0
 public void FinishIAP()
 {
     if (mIAPEvent.Response.code == 0)
     {
                     #if (UNITY_ANDROID)
         GoogleIAB.consumeProduct(itemcode);
                     #else
         mDoneIAP();
                     #endif
     }
     else
     {
         //failed
         DialogueMgr.ShowDialogue("구매 실패", itemproduct + " 구매를 실패 했습니다.", DialogueMgr.DIALOGUE_TYPE.Alert, null);
     }
 }
    //구매상품 강제소모하기
    public void ForceConsumePurchase()
    {
        Loadmanager.instance.LoadingUI(true);

        if (lst_NoneConsumedProduct.Count > 0)
        {
            UserEditor.Getsingleton.EditLog("강제 소모 처리 Product ID : " + lst_NoneConsumedProduct[0].productId);
            GoogleIAB.consumeProduct(lst_NoneConsumedProduct[0].productId);
        }
        else
        {
            Loadmanager.instance.LoadingUI(false);
            UserEditor.Getsingleton.EditLog("강제소모 종료 => lst_NoneConsumedProduct.Count : " + lst_NoneConsumedProduct.Count);
            isForceConsume = false;
        }
    }
Exemplo n.º 26
0
    // 구입자의 계정에 소모되지 않은 sku가 있는지
    void queryInventorySucceededEvent(List <GooglePurchase> purchases, List <GoogleSkuInfo> skus)
    {
        Debug.Log(string.Format("queryInventorySucceededEvent. total purchases: {0}, total skus: {1}", purchases.Count, skus.Count));
        Prime31.Utils.logObject(purchases);
        Prime31.Utils.logObject(skus);

        foreach (GooglePurchase obj in purchases)
        {
            // 저 결재 정보 리스트 안의 놈들을 꺼내서 죄다 컨슘을 불러줌.
            if (obj.productId == "intotheblack.vip")
            {
                Debug.Log("VIP");
                GameController.isVip = 1;
                PlayerPrefs.SetInt("isVip", GameController.isVip);
            }
            else if (obj.productId == "intotheblack.venus")
            {
                Debug.Log("Venus");

                GameController.wingMercury = 1;
                GameController.wingVenus   = 1;
                PlayerPrefs.SetInt("mercury", GameController.wingMercury);
                PlayerPrefs.SetInt("venus", GameController.wingVenus);

                PlayerController.Instance.UpdateWing();
                //script.UpdateWing();
            }
            else if (obj.productId == "intotheblack.shield")
            {
                Debug.Log("shield");

                PlayerController.infinityShield = 1;
                PlayerPrefs.SetInt("infinityShield", PlayerController.infinityShield);
            }
            else
            {
                GoogleIAB.consumeProduct(obj.productId);
            }
        }

        // 여기는 첨에 쿼리 인벤토리 날렸을 때 소모 못시킨게 있음 여기로 들어와요.
        // 여기서 소모 안된게 있으면 싹 소모를 시켜줘야해요.
        // 분명 코드를 소모 시키라고 짯는데 무슨 이유에서든 소모 안된게 남아 있는거.
        // 그래서 게임 초기화할 시점에 한번 싹 해주는게 좋아영.
        // 죠기 skus 리스트 안에 소모 안된 놈들이 들어 있을거에요. 죄다 소모 ㄱㄱ
        // 그럼 자동으로 소모 성공 이벤트를 또 탈거고 거기서 자동으로 쭈주죽 함수가 타겠죠!
    }
    public void PurchaseSuccessed(GooglePurchase purchase)
    {
        GoogleIAB.consumeProduct(Productid);
        AgStt.mIAB.ProductID = Productid;
        AgStt.mIAB.Signature = purchase.signature;
        AgStt.mIAB.BuyCode   = purchase.orderId;
        //AgStt.mIAB.Receipt = '"'+purchase.originalJson.Replace("\"","\\\"")+'"';
        AgStt.mIAB.Receipt   = purchase.originalJson.Replace("\"", "\\\"");
        AgStt.mIAB.StoreType = 2;

        Debug.Log(AgStt.mIAB.ProductID);
        Debug.Log(AgStt.mIAB.Signature);
        Debug.Log(AgStt.mIAB.BuyCode + "BuyCode");
        Debug.Log(AgStt.mIAB.TransactionKey);
        Debug.Log(AgStt.mIAB.Receipt);
        GetCash();
    }
    public void Btn_Fun_Cash120()
    {
        Productid = "com.appsgraphy.kvsskakao.cash0100";
        dicMenuList ["popup_buycash"].SetActive(true);
        GetTranjectionkey();

        mProductCode  = "1000007359";
        mPaymentPrice = 10000;

        #if UNITY_ANDROID
        GoogleIAB.consumeProduct(Productid);
        #endif

        SetPopupPriceLabel("100", "9.99", "10,000");
        //mRscrcMan.FindChild (dicMenuList ["popup_buycash"], "Label_num", true).GetComponent<UILabel> ().text = "100";


        Ag.LogString(" MenuManager_Shop ::   Btn_Fun_Cash120   >>>  ProductID " + Productid);
    }
Exemplo n.º 29
0
    // 구입 성공 완료
    void purchaseSucceededEvent(GooglePurchase purchase)
    {
        LanguageManager thisLanguageManager = LanguageManager.Instance;

        Debug.Log("purchaseSucceededEvent: " + purchase);
        // 구입이 성공하면 불리는 함수.
        // 구입한 항목이 관리되지 않는 제품(캐시보석 같은) 놈이면, 요기서 소모를 시켜줌. 결재 성공했으니까.

        if (purchase.productId == "intotheblack.vip")
        {
            GameController.isVip = 1;
            PlayerPrefs.SetInt("isVip", GameController.isVip);

            resultWindow.GetComponent <StoreResult>().result = thisLanguageManager.GetTextValue("Store.Product1Result");
            resultWindow.SetActive(true);
        }
        else if (purchase.productId == "intotheblack.venus")
        {
            GameController.wingMercury = 1;
            GameController.wingVenus   = 1;
            PlayerPrefs.SetInt("mercury", GameController.wingMercury);
            PlayerPrefs.SetInt("venus", GameController.wingVenus);
            PlayerController.Instance.UpdateWing();

            resultWindow.GetComponent <StoreResult>().result = thisLanguageManager.GetTextValue("Store.Product2Result");
            resultWindow.SetActive(true);

            //script.UpdateWing();
        }
        else if (purchase.productId == "intotheblack.shield")
        {
            Debug.Log("shield");

            PlayerController.infinityShield = 1;
            PlayerPrefs.SetInt("infinityShield", PlayerController.infinityShield);
        }
        else
        {
            GoogleIAB.consumeProduct(purchase.productId);
        }

        // 아이템 넣는 처리는 죠 아래 소모 성공 함수가 실행되는 곳에서. void consumePurchaseSucceededEvent()
    }
Exemplo n.º 30
0
    public void FinishIAP()
    {
        UtilMgr.DismissLoading();
        if (mIAPEvent.Response.code == 0)
        {
                        #if (UNITY_ANDROID)
            GoogleIAB.consumeProduct(mItemcode);
                        #else
            mDoneIAP();
                        #endif
//			mDoneIAP();
        }
        else
        {
            //failed
            DialogueMgr.ShowDialogue(UtilMgr.GetLocalText("StrPurchaseFailed"),
                                     string.Format(UtilMgr.GetLocalText("StrPurchaseFailed2"), mItemname),
                                     DialogueMgr.DIALOGUE_TYPE.Alert, null);
        }
    }