Esempio n. 1
0
    void purchaseSuccessfulEvent(StoreKitTransaction transaction)
    {
        if (transaction.productIdentifier == Constants.PRODUCT_ID)
        {
//			Debug.Log("Product purchased");
            HZBannerAd.Hide();
            Main.Instance.isNoads = true;
            PlayerPrefs.SetBool(Constants.NO_ADS, Main.Instance.isNoads);
            PlayerPrefs.Flush();

            if (isRestoring)
            {
                CreateAlertForRestore("Purchase Restored", "Ads removed", "Ok");
            }

//			if(Main.Instance.isNoads)
//			{
//				if(noAddButtonHome != null)
//				{
//					noAddButtonHome.interactable = false;
//				}
//			}
//
        }
    }
Esempio n. 2
0
 void purchaseSuccessfulEvent(StoreKitTransaction transaction)
 {
     Debug.Log("purchaseSuccessfulEvent: " + transaction);
     //InAppPersistenceManager.instance.SetPurchaseInfo(transaction.productIdentifier, InAppPersistenceManager.InAppPersistenceState.purchase_verification_pending);
     //productID = transaction.productIdentifier;
     //BillingManager.instance.CallVerificationBackendService(Trunk.verificationURL + Trunk.userToken, productID, transaction.base64EncodedTransactionReceipt, "2", onVerificationSucceeded, onVerificationError);
 }
Esempio n. 3
0
 void purchaseSuccessful(StoreKitTransaction transaction)
 {
     for (int i = 0; i < items.Length; i++)
     {
         items[i].purchaseItem(transaction.productIdentifier);
     }
 }
Esempio n. 4
0
    void purchaseSuccessfulEvent(StoreKitTransaction transaction)
    {
        if (transaction.productIdentifier == Constants.PRODUCT_ID)
        {
            HZBannerAd.hide();
            Main.Instance.isNoAdsPurchased = true;
            PlayerPrefs.SetBool(Constants.KEY_NOADS, Main.Instance.isNoAdsPurchased);
            PlayerPrefs.Flush();

            if (Main.Instance.isNoAdsPurchased)
            {
                if (noAddButtonHome != null)
                {
                    noAddButtonHome.interactable = false;
                }
            }

            if (Main.Instance.isNoAdsPurchased)
            {
                if (noAddButtonGameOver != null)
                {
                    noAddButtonGameOver.interactable = false;
                }
            }
        }
    }
    public static StoreKitTransaction transactionFromDictionary(Dictionary <string, object> dict)
    {
        var transaction = new StoreKitTransaction();

        if (dict.ContainsKey("productIdentifier"))
        {
            transaction.productIdentifier = dict["productIdentifier"].ToString();
        }

        if (dict.ContainsKey("transactionIdentifier"))
        {
            transaction.transactionIdentifier = dict["transactionIdentifier"].ToString();
        }

        if (dict.ContainsKey("base64EncodedReceipt"))
        {
            transaction.base64EncodedTransactionReceipt = dict["base64EncodedReceipt"].ToString();
        }

        if (dict.ContainsKey("quantity"))
        {
            transaction.quantity = int.Parse(dict["quantity"].ToString());
        }

        return(transaction);
    }
Esempio n. 6
0
    public static StoreKitTransaction transactionFromHashtable(Hashtable ht)
    {
        var transaction = new StoreKitTransaction();

        if (ht.ContainsKey("productIdentifier"))
        {
            transaction.productIdentifier = ht["productIdentifier"].ToString();
        }

        if (ht.ContainsKey("transactionIdentifier"))
        {
            transaction.transactionIdentifier = ht["transactionIdentifier"].ToString();
        }

        if (ht.ContainsKey("base64EncodedReceipt"))
        {
            transaction.base64EncodedTransactionReceipt = ht["base64EncodedReceipt"].ToString();
        }

        if (ht.ContainsKey("quantity"))
        {
            transaction.quantity = int.Parse(ht["quantity"].ToString());
        }

        return(transaction);
    }
Esempio n. 7
0
 void purchaseSuccessful( StoreKitTransaction transaction )
 {
     for(int i=0; i<items.Length; i++)
     {
         items[i].purchaseItem( transaction.productIdentifier );
     }
 }
Esempio n. 8
0
 public void productPurchased(string json)
 {
     if (purchaseSuccessfulEvent != null)
     {
         purchaseSuccessfulEvent(StoreKitTransaction.transactionFromJson(json));
     }
 }
 public void transactionUpdated(string json)
 {
     if (transactionUpdatedEvent != null)
     {
         transactionUpdatedEvent(StoreKitTransaction.transactionFromJson(json));
     }
 }
Esempio n. 10
0
    void purchaseSuccessfulEvent(StoreKitTransaction transaction)
    {
        switch (transaction.productIdentifier)
        {
        case MainMenuController.GOLD_200:
            DBAccess.instance.userPrefs.Gold += 200;
            DBAccess.instance.userPrefs.CommitToDB(true);
            break;

        case MainMenuController.GOLD_500:
            DBAccess.instance.userPrefs.Gold += 500;
            DBAccess.instance.userPrefs.CommitToDB(true);
            break;

        case MainMenuController.GOLD_4000:
            DBAccess.instance.userPrefs.Gold += 4000;
            DBAccess.instance.userPrefs.CommitToDB(true);
            break;

        default:
            break;
        }

        EtceteraBinding.hideActivityView();
        tweenOut();
    }
 public void ConfirmPurchase(StoreKitTransaction transaction)
 {
     if (transaction != null)
     {
         StoreKitBinding.finishPendingTransaction(transaction.transactionIdentifier);
     }
 }
Esempio n. 12
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 productPurchaseAwaitingConfirmationEvent( StoreKitTransaction transaction )
    {
        //Debug.Log( "productPurchaseAwaitingConfirmationEvent: " + transaction );

        currentTransaction = transaction;
        byte[] reciept = Convert.FromBase64String(transaction.base64EncodedTransactionReceipt);
        FuseAPI.RegisterInAppPurchase(transaction.productIdentifier, reciept, FuseAPI.TransactionState.PURCHASING);
    }
    void purchaseSuccessful( StoreKitTransaction transaction )
    {
        //Debug.Log( "purchased product: " + transaction );

        currentTransaction = null;
        byte[] reciept = Convert.FromBase64String(transaction.base64EncodedTransactionReceipt);
        FuseAPI.RegisterInAppPurchase(transaction.productIdentifier, reciept, FuseAPI.TransactionState.PURCHASED);
    }
Esempio n. 15
0
 void productPurchaseAwaitingConfirmationEvent(StoreKitTransaction transaction)
 {
     Debug.Log("productPurchaseAwaitingConfirmationEvent: " + transaction);
     InAppPersistenceManager.instance.SetPurchaseInfo(transaction.productIdentifier, InAppPersistenceManager.InAppPersistenceState.purchase_verification_pending);
     productID = transaction.productIdentifier;
     BillingManager.instance.HandlePurchase(null, productID); //modificado porque no tenemos backend
     //BillingManager.instance.CallVerificationBackendService(Trunk.verificationURL + Trunk.userToken, productID, transaction.base64EncodedTransactionReceipt, "2", onVerificationSucceeded, onVerificationError);
 }
    protected void OnVerificationSuccess(StoreKitTransaction transaction)
    {
        StoreKitManager.purchaseSuccessfulEvent -= OnVerificationSuccess;
        StoreKitManager.purchaseFailedEvent     -= OnProductFailed;
        StoreKitManager.purchaseCancelledEvent  -= OnProductCanceled;

        OnVerificationSuccess();
    }
    protected void OnProductAwaitingVerification(StoreKitTransaction transaction)
    {
        StoreKitManager.productPurchaseAwaitingConfirmationEvent -= OnProductAwaitingVerification;

        StoreKitManager.purchaseSuccessfulEvent += OnVerificationSuccess;

        OnProductAwaitingVerification();
    }
Esempio n. 18
0
 void purchaseSuccessful(StoreKitTransaction transaction)
 {
     Debug.Log("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA :" + transaction);
     if (isFree)
     {
         if (transaction.productIdentifier == "com.DMDEnterprise.kicktheballfree.100coins")
         {
             PlayerPrefs.SetInt("coins", PlayerPrefs.GetInt("coins", 0) + 100);
         }
         else if (transaction.productIdentifier == "com.DMDEnterprise.kicktheballfree.250coins")
         {
             PlayerPrefs.SetInt("coins", PlayerPrefs.GetInt("coins", 0) + 250);
         }
         else if (transaction.productIdentifier == "com.DMDEnterprise.kicktheballfree.500coins")
         {
             PlayerPrefs.SetInt("coins", PlayerPrefs.GetInt("coins", 0) + 500);
         }
         else if (transaction.productIdentifier == "com.DMDEnterprise.kicktheballfree.1500coins")
         {
             PlayerPrefs.SetInt("coins", PlayerPrefs.GetInt("coins", 0) + 1500);
         }
         else if (transaction.productIdentifier == "com.DMDEnterprise.kicktheballfree.3000coins")
         {
             PlayerPrefs.SetInt("coins", PlayerPrefs.GetInt("coins", 0) + 3000);
         }
         else if (transaction.productIdentifier == "com.DMDEnterprise.kicktheballfree.5000coins")
         {
             PlayerPrefs.SetInt("coins", PlayerPrefs.GetInt("coins", 0) + 5000);
         }
     }
     else
     {
         if (transaction.productIdentifier == "com.immanitas.KickTheBall.100coins")
         {
             PlayerPrefs.SetInt("coins", PlayerPrefs.GetInt("coins", 0) + 100);
         }
         else if (transaction.productIdentifier == "com.immanitas.KickTheBall.250coins")
         {
             PlayerPrefs.SetInt("coins", PlayerPrefs.GetInt("coins", 0) + 250);
         }
         else if (transaction.productIdentifier == "com.immanitas.KickTheBall.500coins")
         {
             PlayerPrefs.SetInt("coins", PlayerPrefs.GetInt("coins", 0) + 500);
         }
         else if (transaction.productIdentifier == "com.immanitas.KickTheBall.1500coins")
         {
             PlayerPrefs.SetInt("coins", PlayerPrefs.GetInt("coins", 0) + 1500);
         }
         else if (transaction.productIdentifier == "com.immanitas.KickTheBall.3000coins")
         {
             PlayerPrefs.SetInt("coins", PlayerPrefs.GetInt("coins", 0) + 3000);
         }
         else if (transaction.productIdentifier == "com.immanitas.KickTheBall.5000coins")
         {
             PlayerPrefs.SetInt("coins", PlayerPrefs.GetInt("coins", 0) + 5000);
         }
     }
 }
Esempio n. 19
0
    void purchaseSuccessfulEvent(StoreKitTransaction transaction)
    {
        LanguageManager thisLanguageManager = LanguageManager.Instance;

        Debug.Log("purchaseSuccessfulEvent: " + transaction);

        switch (transaction.productIdentifier)
        {
        case "coin1":

            GameController.dustPoints += 10000;
            resultWindow.GetComponent <StoreResult>().result = thisLanguageManager.GetTextValue("Store.Result1");
            resultWindow.SetActive(true);
            break;

        case "coin2":
            resultWindow.GetComponent <StoreResult>().result = thisLanguageManager.GetTextValue("Store.Result2");
            resultWindow.SetActive(true);
            // 보석 80개 주기 처리
            GameController.dustPoints += 50000;
            break;

        case "coin3":
            resultWindow.GetComponent <StoreResult>().result = thisLanguageManager.GetTextValue("Store.Result3");
            resultWindow.SetActive(true);
            // 보석 180개 주기 처리
            GameController.dustPoints += 100000;
            break;

        case "coin4":
            resultWindow.GetComponent <StoreResult>().result = thisLanguageManager.GetTextValue("Store.Result4");
            resultWindow.SetActive(true);
            // "에러 관련 메시지 처리 "
            GameController.dustPoints += 250000;
            break;

        case "VIP":
            GameController.isVip = 1;
            PlayerPrefs.SetInt("isVip", GameController.isVip);

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

            break;

        case "wingman":

            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);
            break;
        }
    }
Esempio n. 20
0
 void purchaseSuccessfulEvent(StoreKitTransaction transaction)
 {
     if (transaction.productIdentifier == Constants.PRODUCT_ID)
     {
         Main.Instance.isNoAdsPurchased = true;
         PlayerPrefs.SetBool(Constants.KEY_NOADS, Main.Instance.isNoAdsPurchased);
         PlayerPrefs.Flush();
     }
 }
Esempio n. 21
0
        // online verification request (iOS version)
        // here we build the POST request to our external server,
        // that will forward the request to Apple's servers
        private void MakeRequest(StoreKitTransaction prod)
        {
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("store", "IOS");
            dic.Add("pid", prod.productIdentifier);
            dic.Add("rec", prod.base64EncodedTransactionReceipt);
            StartCoroutine(WaitForRequest(dic));
        }
 void purchaseCancelled( string error )
 {
     //Debug.Log( "purchase cancelled with error: " + error );
     if( currentTransaction != null )
     {
         byte[] reciept = Convert.FromBase64String(currentTransaction.base64EncodedTransactionReceipt);
         FuseAPI.RegisterInAppPurchase(currentTransaction.productIdentifier, reciept, FuseAPI.TransactionState.FAILED);
         currentTransaction = null;
     }
 }
Esempio n. 23
0
 void purchaseCancelled(string error)
 {
     //FuseLog( "purchase cancelled with error: " + error );
     if (currentTransaction != null)
     {
         byte[] receipt = readReceiptData();
         FuseSDK.RegisterIOSInAppPurchase(currentTransaction.productIdentifier, currentTransaction.transactionIdentifier, receipt, FuseMisc.IAPState.FAILED);
         currentTransaction = null;
     }
 }
 void purchaseCancelled(string error)
 {
     //FuseLog( "purchase cancelled with error: " + error );
     if (currentTransaction != null)
     {
         byte[] reciept = Convert.FromBase64String(currentTransaction.base64EncodedTransactionReceipt);
         FuseSDK.RegisterIOSInAppPurchase(currentTransaction.productIdentifier, currentTransaction.transactionIdentifier, reciept, FuseMisc.IAPState.FAILED);
         currentTransaction = null;
     }
 }
Esempio n. 25
0
    // Returns a list of all the transactions that occured on this device.  They are stored in the Document directory.
    public static List <StoreKitTransaction> getAllSavedTransactions()
    {
        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            // Grab the transactions and parse them out
            var json = _storeKitGetAllSavedTransactions();
            return(StoreKitTransaction.transactionsFromJson(json));
        }

        return(new List <StoreKitTransaction>());
    }
Esempio n. 26
0
	private void startServerVerify(StoreKitTransaction transaction)
	{
		string url = "http://frozen.microfunplus.com/v101/net";
 
        WWWForm form = new WWWForm();
		form.AddField ("cmd", "inAppPurchase");  
		form.AddField ("data", transaction.base64EncodedTransactionReceipt); 
        WWW www = new WWW(url, form);
 
        StartCoroutine(WaitForRequest(www, transaction));
	}
    private void startServerVerify(StoreKitTransaction transaction)
    {
        string url = "http://frozen.microfunplus.com/v101/net";

        WWWForm form = new WWWForm();

        form.AddField("cmd", "inAppPurchase");
        form.AddField("data", transaction.base64EncodedTransactionReceipt);
        WWW www = new WWW(url, form);

        StartCoroutine(WaitForRequest(www, transaction));
    }
Esempio n. 28
0
    public void productPurchaseAwaitingConfirmation(string json)
    {
        if (productPurchaseAwaitingConfirmationEvent != null)
        {
            productPurchaseAwaitingConfirmationEvent(StoreKitTransaction.transactionFromJson(json));
        }

        if (autoConfirmTransactions)
        {
            StoreKitBinding.finishPendingTransactions();
        }
    }
Esempio n. 29
0
	/// <summary>
	/// 内购成功返回
	/// </summary>
	/// <param name="transaction">Transaction.</param>
	public static void onPurchaseSuccessful (StoreKitTransaction transaction)
	{
//		UIController.Instance.HideWaiting ();
		string idStr = transaction.productIdentifier;
		idStr = idStr.Substring (idStr.Length - 6, 6);
//		Debuger.Log ("purchaseSuccessful idStr:" + idStr);
//		DataManager.instance.OnGetProp (System.Convert.ToInt32(idStr));
//		MainTop.Instance.UpdateData();
//		if (OnPurchaseSucc != null) OnPurchaseSucc ();
//		OnPurchaseSucc = null;
//		UIController.Instance.ShowAlertUI (UIController.ALERT_YESUI_PATH,"提示","购买成功!");
	}
Esempio n. 30
0
    void purchaseSuccessful( StoreKitTransaction transaction )
    {
        Debug.Log( "purchased product: " + transaction );

        switch(transaction.productIdentifier)
        {
            case "jp.ne.sakura.charorin.lastInvader.powerup":
                Debug.Log("powerUp !");
                ZDatabase.instance.WriteEnc("powerup", "ON");

            break;
        }
    }
Esempio n. 31
0
        // fired when a purchase succeeds, iOS version.
        // also fired for each transaction when restoring transactions
        // Optionally: verify new product transaction online
        private void PurchaseSucceeded(StoreKitTransaction prod)
        {
            string id = GetIAPIdentifier(prod.productIdentifier);

            if ((verificationType == VerificationType.onPurchase || verificationType == VerificationType.both) &&
                !string.IsNullOrEmpty(serverUrl))
            {
                MakeRequest(prod);
                return;
            }

            PurchaseVerified(id);
        }
Esempio n. 32
0
    public static StoreKitDownload downloadFromDictionary(Dictionary <string, object> dict)
    {
        var download = new StoreKitDownload();

        if (dict.ContainsKey("downloadState"))
        {
            download.downloadState = (StoreKitDownloadState)int.Parse(dict["downloadState"].ToString());
        }

        if (dict.ContainsKey("contentLength"))
        {
            download.contentLength = double.Parse(dict["contentLength"].ToString());
        }

        if (dict.ContainsKey("contentIdentifier"))
        {
            download.contentIdentifier = dict["contentIdentifier"].ToString();
        }

        if (dict.ContainsKey("contentURL"))
        {
            download.contentURL = dict["contentURL"].ToString();
        }

        if (dict.ContainsKey("contentVersion"))
        {
            download.contentVersion = dict["contentVersion"].ToString();
        }

        if (dict.ContainsKey("error"))
        {
            download.error = dict["error"].ToString();
        }

        if (dict.ContainsKey("progress"))
        {
            download.progress = float.Parse(dict["progress"].ToString());
        }

        if (dict.ContainsKey("timeRemaining"))
        {
            download.timeRemaining = double.Parse(dict["timeRemaining"].ToString());
        }

        if (dict.ContainsKey("transaction"))
        {
            download.transaction = StoreKitTransaction.transactionFromDictionary(dict["transaction"] as Dictionary <string, object>);
        }

        return(download);
    }
Esempio n. 33
0
    public static StoreKitDownload downloadFromHashtable(Hashtable ht)
    {
        var download = new StoreKitDownload();

        if (ht.ContainsKey("downloadState"))
        {
            download.downloadState = (StoreKitDownloadState)int.Parse(ht["downloadState"].ToString());
        }

        if (ht.ContainsKey("contentLength"))
        {
            download.contentLength = double.Parse(ht["contentLength"].ToString());
        }

        if (ht.ContainsKey("contentIdentifier"))
        {
            download.contentIdentifier = ht["contentIdentifier"].ToString();
        }

        if (ht.ContainsKey("contentURL"))
        {
            download.contentURL = ht["contentURL"].ToString();
        }

        if (ht.ContainsKey("contentVersion"))
        {
            download.contentVersion = ht["contentVersion"].ToString();
        }

        if (ht.ContainsKey("error"))
        {
            download.error = ht["error"].ToString();
        }

        if (ht.ContainsKey("progress"))
        {
            download.progress = float.Parse(ht["progress"].ToString());
        }

        if (ht.ContainsKey("timeRemaining"))
        {
            download.timeRemaining = double.Parse(ht["timeRemaining"].ToString());
        }

        if (ht.ContainsKey("transaction"))
        {
            download.transaction = StoreKitTransaction.transactionFromHashtable(ht["transaction"] as Hashtable);
        }

        return(download);
    }
    void productPurchaseAwaitingConfirmationEvent(StoreKitTransaction transaction)
    {
        //FuseLog( "productPurchaseAwaitingConfirmationEvent: " + transaction );

        if (transactionIDPurchasing == transaction.transactionIdentifier)
        {
            FuseLog("Duplicate transaction " + transactionIDPurchasing);
            return;
        }
        transactionIDPurchasing = transaction.transactionIdentifier;
        currentTransaction      = transaction;
        byte[] reciept = Convert.FromBase64String(transaction.base64EncodedTransactionReceipt);
        FuseSDK.RegisterIOSInAppPurchase(transaction.productIdentifier, transaction.transactionIdentifier, reciept, FuseMisc.IAPState.PURCHASING);
    }
    void productPurchaseAwaitingConfirmationEvent( StoreKitTransaction transaction )
    {
        //FuseLog( "productPurchaseAwaitingConfirmationEvent: " + transaction );

        if( transactionIDPurchasing == transaction.transactionIdentifier )
        {
            FuseLog("Duplicate transaction " + transactionIDPurchasing);
            return;
        }
        transactionIDPurchasing = transaction.transactionIdentifier;
        currentTransaction = transaction;
        byte[] receipt = readReceiptData();
        FuseSDK.RegisterIOSInAppPurchase(transaction.productIdentifier, transaction.transactionIdentifier, receipt, FuseMisc.IAPState.PURCHASING);
    }
Esempio n. 36
0
	void productPurchaseAwaitingConfirmationEvent (StoreKitTransaction transaction)
	{
//		Debuger.Log( "productPurchaseAwaitingConfirmationEvent: " + transaction );
//
//		StoreKitHandler.finishPendingTransactions();
//
//		rq_storekit_result result = new rq_storekit_result ();
//		result.receipt = transaction.base64EncodedTransactionReceipt;
//		result.quantity = transaction.quantity;
//		result.identifier = transaction.productIdentifier;
//		result.transactionid = transaction.transactionIdentifier;
//
//		GameController.Instance.GameNet.storekitCall (OnStoreKitCallback, result);
	}
    public static StoreKitTransaction transactionFromString( string transactionString )
    {
        StoreKitTransaction transaction = new StoreKitTransaction();

        string[] transactionParts = transactionString.Split( new string[] { "|||" }, StringSplitOptions.None );
        if( transactionParts.Length == 3 )
        {
            transaction.productIdentifier = transactionParts[0];
            transaction.base64EncodedTransactionReceipt = transactionParts[1];
            transaction.quantity = int.Parse( transactionParts[2] );
        }

        return transaction;
    }
Esempio n. 38
0
    public static StoreKitTransaction transactionFromString(string transactionString)
    {
        StoreKitTransaction transaction = new StoreKitTransaction();

        string[] transactionParts = transactionString.Split(new string[] { "|||" }, StringSplitOptions.None);
        if (transactionParts.Length == 3)
        {
            transaction.productIdentifier = transactionParts[0];
            transaction.base64EncodedTransactionReceipt = transactionParts[1];
            transaction.quantity = int.Parse(transactionParts[2]);
        }

        return(transaction);
    }
Esempio n. 39
0
    void purchaseSuccessful(StoreKitTransaction transaction)
    {
        if (transactionIDPurchased == transaction.transactionIdentifier)
        {
            FuseLog("Duplicate transaction " + transactionIDPurchased);
            return;
        }
        transactionIDPurchased = transaction.transactionIdentifier;

        //FuseLog( "purchased product: " + transaction );

        currentTransaction = null;
        byte[] receipt = readReceiptData();
        FuseSDK.RegisterIOSInAppPurchase(transaction.productIdentifier, transaction.transactionIdentifier, receipt, FuseMisc.IAPState.PURCHASED);
    }
    public static StoreKitTransaction transactionFromHashtable( Hashtable ht )
    {
        var transaction = new StoreKitTransaction();

        if( ht.ContainsKey( "productIdentifier" ) )
            transaction.productIdentifier = ht["productIdentifier"].ToString();

        if( ht.ContainsKey( "base64EncodedReceipt" ) )
            transaction.base64EncodedTransactionReceipt = ht["base64EncodedReceipt"].ToString();

        if( ht.ContainsKey( "quantity" ) )
            transaction.quantity = int.Parse( ht["quantity"].ToString() );

        return transaction;
    }
    void purchaseSuccessful(StoreKitTransaction transaction)
    {
        if (transactionIDPurchased == transaction.transactionIdentifier)
        {
            FuseLog("Duplicate transaction " + transactionIDPurchased);
            return;
        }
        transactionIDPurchased = transaction.transactionIdentifier;

        //FuseLog( "purchased product: " + transaction );

        currentTransaction = null;
        byte[] reciept = Convert.FromBase64String(transaction.base64EncodedTransactionReceipt);
        FuseSDK.RegisterIOSInAppPurchase(transaction.productIdentifier, transaction.transactionIdentifier, reciept, FuseMisc.IAPState.PURCHASED);
    }
Esempio n. 42
0
    void purchaseSuccessful(StoreKitTransaction transaction)
    {
        Debug.Log("purchased product: " + transaction);

        Debug.Log("purchased product: " + transaction);
        Debug.Log("buy success");

        CurProduct.tid     = transaction.transactionIdentifier;
        CurProduct.count   = transaction.quantity;
        CurProduct.pid     = transaction.productIdentifier;
        CurProduct.receipt = transaction.base64EncodedTransactionReceipt;
        if (null != m_delFinish)
        {
            m_delFinish(true);
        }
    }
Esempio n. 43
0
	IEnumerator WaitForRequest(WWW www, StoreKitTransaction transaction)
    {
        yield return www;
 
        // check for errors
        if (www.error == null)
        {
            Debug.Log("WWW Ok!: " + www.data);
			if (www.text == "0")
			{
				GameObject mallTableObj = GameObject.Find("MallDragPanel");
				mallTableObj.SendMessage("addDiamond", transaction.productIdentifier);
//				foreach (DiamondProductData diamondProduct in ItemModel.Instance.diamondProducts) 
//				{
//					if(diamondProduct.productID == transaction.productIdentifier)
//					{
//						UserManagerCloud.Instance.CurrentUser.UserGoldCoins += diamondProduct.diamondNum;
//						// Update user.data
//						UserCloud.Serialize(UserManagerCloud.FILE_NAME_LOCAL);
//						Debug.Log("Purchase has success,"+ diamondProduct.diamondNum +" diamonds added!");
//					}
//				}
			}
        } else {
			GameObject mallTableObj = GameObject.Find("MallDragPanel");
			mallTableObj.SendMessage("addDiamond", transaction.productIdentifier);
//            Debug.Log("WWW Error: "+ www.error);
//			int times = PlayerPrefs.GetInt(transaction.transactionIdentifier, 0);
//			Debug.Log("restore transaction times:" + times);
//			if(times > tryTimes)
//			{
//				PlayerPrefs.DeleteKey(transaction.transactionIdentifier);
//				StoreKitBinding.finishPendingTransaction(transaction.transactionIdentifier);
//			}
//			else
//			{
//				times += 1;
//				PlayerPrefs.SetInt(transaction.transactionIdentifier, times);
//				productPurchaseFailed("Server Verify Failed!!");
//			}
//			PlayerPrefs.Save();
        }
		
		StoreKitBinding.finishPendingTransaction(transaction.transactionIdentifier);
    } 
Esempio n. 44
0
    public static StoreKitTransaction transactionFromDictionary( Dictionary<string,object> dict )
    {
        var transaction = new StoreKitTransaction();

        if( dict.ContainsKey( "productIdentifier" ) )
            transaction.productIdentifier = dict["productIdentifier"].ToString();

        if( dict.ContainsKey( "transactionIdentifier" ) )
            transaction.transactionIdentifier = dict["transactionIdentifier"].ToString();

        if( dict.ContainsKey( "base64EncodedReceipt" ) )
            transaction.base64EncodedTransactionReceipt = dict["base64EncodedReceipt"].ToString();

        if( dict.ContainsKey( "quantity" ) )
            transaction.quantity = int.Parse( dict["quantity"].ToString() );

        return transaction;
    }
    public void PurchaseSuccessfulEvent(StoreKitTransaction transaction)
    {
        // only do this if the user is making a single purchase
        if (rivetyPaymentManager.state == RivetyPaymentManager.State.MakingPurchase)
        {
            // TODO: apple quivalent of this google code

            // IDictionary signedDataDict = (IDictionary)Json.Deserialize(this._signedData);
            // IList orders = (IList)signedDataDict["orders"];
            // IDictionary order = (IDictionary)orders[0];
            // string productId2 = order["productId"].ToString();
            // string orderId = order["orderId"].ToString();
            // string purchaseTime = order["purchaseTime"].ToString();
            // if (productId2 == "android.test.purchased") Debug.Log("Skipped backing up test product.");
            // else rivetyProductManager.BackupProductForCurrentUser(productId2, orderId, purchaseTime);
        }
        // TODO: maybe this should happen in the backup response handler to verify total success
        if (testbedGui.state == TestbedGUI.State.PurchasingProduct)
        {
            spinner.Hide();
            testbedGui.stateMessage = "Purchase Succeeded";
            testbedGui.state = TestbedGUI.State.BrowsingProductList;
        }
    }
Esempio n. 46
0
 void productPurchaseAwaitingConfirmationEvent( StoreKitTransaction transaction )
 {
     Debug.Log( "productPurchaseAwaitingConfirmationEvent: " + transaction );
 }
 void purchaseSuccessfulEvent( StoreKitTransaction transaction )
 {
     evented = true;
     PlayerPrefs.SetInt(transaction.productIdentifier, 1);
     Debug.Log( "purchaseSuccessfulEvent: " + transaction );
 }
	void purchaseSuccessful( StoreKitTransaction transaction )
	{
		Debug.Log( "purchased product: " + transaction );
		_currentCallbackOnFinishedTransaction ( true );
	}
Esempio n. 49
0
 }
 void purchaseSuccessful( StoreKitTransaction transaction )
 {
     Debug.Log( "purchased product: " + transaction );
 }
    void purchaseFailed( string error )
    {
        //FuseLog( "purchase failed with error: " + error );

        if( currentTransaction != null )
        {
            byte[] receipt = readReceiptData();
            FuseSDK.RegisterIOSInAppPurchase(currentTransaction.productIdentifier, currentTransaction.transactionIdentifier, receipt, FuseMisc.IAPState.FAILED);
            currentTransaction = null;
        }
    }
Esempio n. 52
0
	private static void PurchaseSuccessful(StoreKitTransaction transaction)
	{
		Debug.Log("****PURCHASE SUCCESSFUL");
		if(_callback != null)
			_callback(IAPState.Success, "");
	}
 private void purchaseSuccessfulEvent(StoreKitTransaction transaction)
 {
     if ((this.confirmingTransaction == null) || (this.confirmingTransaction.transactionIdentifier != transaction.transactionIdentifier))
     {
         this.OnPurchaseSuccess(transaction);
     }
 }
 void transactionUpdatedEvent( StoreKitTransaction transaction )
 {
     Debug.Log( "transactionUpdatedEvent: " + transaction );
 }
 void purchaseSuccessfulEvent( StoreKitTransaction transaction )
 {
     Debug.Log( "purchaseSuccessfulEvent: " + transaction );
 }
Esempio n. 56
0
 void purchaseSuccessful( StoreKitTransaction transaction )
 {
     Debug.Log( "purchased product: " + transaction );
     permanentlyRemoveAds();
 }
	void purchaseSuccessfulEvent( StoreKitTransaction transaction )
	{
		Debug.Log("purchaseSuccessfulEvent");
		//complete purchase
		Debug.Log("productIdentifier = "+transaction.productIdentifier);
		hideActivityView();
		string productIdentifer = transaction.productIdentifier;
		int addPoint = 0;
		if(productIdentifer == "100pt_quiz"){
			addPoint = 100;
		}
		if(productIdentifer == "600pt_quiz"){
			addPoint = 600;
		}
		if(productIdentifer == "1350pt_quiz"){
			addPoint = 1350;
		}
		if(productIdentifer == "3000pt_quiz"){
			addPoint = 3000;
		}
		if(productIdentifer == "7800pt_quiz"){
			addPoint = 7800;
		}
		if(productIdentifer == "25000pt_quiz"){
			addPoint = 25000;
		}
		Debug.Log("addPoint = "+addPoint);
		PrefsManager.Instance.AddUserPoint(addPoint);
		TopController.instance.UpdateUserPointLabel ();
	}
 private void productPurchaseAwaitingConfirmationEvent(StoreKitTransaction transaction)
 {
     if (transaction != null)
     {
         this.confirmingTransaction = transaction;
         Debug.Log("productPurchaseAwaitingConfirmationEvent: " + transaction);
         this.OnPurchaseNeedConfirmEvent(EventArgs.Empty);
     }
 }
 public void OnPurchaseSuccess(StoreKitTransaction transaction)
 {
     if (transaction != null)
     {
         this.lastSuccessTransaction = transaction;
         Debug.Log(this + " OnPurchaseSuccess " + transaction.transactionIdentifier);
         this.OnPurchaseSuccessEvent(EventArgs.Empty);
     }
 }
 public ReqShop VerifyIosTransaction(StoreKitTransaction transaction, [Optional, DefaultParameterValue(false)] bool isRetrying)
 {
     ReqShop component = GameObjectUtil.InstantiateItemAsChildOf(this.reqShopPrefab, base.gameObject).GetComponent<ReqShop>();
     component.VerifyTransaction(transaction, isRetrying);
     return component;
 }