Exemplo n.º 1
0
 void purchaseSucceededEvent(string receipt)
 {
     UtilMgr.DismissLoading();
     byte[] bytes = System.Text.Encoding.UTF8.GetBytes(receipt);
     mIAPEvent = new InAppPurchaseEvent(FinishIAP);
     NetMgr.InAppPurchase(false, mItemcode, System.Convert.ToBase64String(bytes), "", mIAPEvent);
 }
    public static void LogInApp(string productId, InAppPurchaseEvent action, string failureReason = "")
    {
        if (userData != null)
        {
            if (action == InAppPurchaseEvent.Succeeded)
            {
                userData.TotalPurchased++;
            }

            var log = new Dictionary <string, object>
            {
                { "product_id", productId }
            };

            if (!string.IsNullOrEmpty(failureReason))
            {
                log.Add("failure", failureReason);
            }

            if (action == InAppPurchaseEvent.Succeeded || action == InAppPurchaseEvent.Failed)
            {
                LogEvent("in_app_" + action.ToString(), log);
                LogEvent("in_app_" + productId, log);
            }
        }
    }
Exemplo n.º 3
0
//	public void purchaseInit(){
//		string msg = IOSMgr.GetMsg();
//		if(msg.Equals("NO")){
//			billingNotSupportedEvent("");
//		} else{
//			billingSupportedEvent();
//			IOSProducts products = Newtonsoft.Json.JsonConvert.DeserializeObject<IOSProducts>(msg);
//			foreach(ItemShopRubyInfo rubyInfo in getruby.Response.data){
//				switch(rubyInfo.productCode){
//				case "ruby_50" : rubyInfo.productPriceIOS = products.ruby_50;
//					break;
//				case "ruby_100" : rubyInfo.productPriceIOS = products.ruby_100;
//					break;
//				case "ruby_200" : rubyInfo.productPriceIOS = products.ruby_200;
//					break;
//				case "ruby_300" : rubyInfo.productPriceIOS = products.ruby_300;
//					break;
//				case "ruby_500" : rubyInfo.productPriceIOS = products.ruby_500;
//					break;
//				}
//			}
//		}
////		InitRubyList();
//		GetAblePP();
//	}

    void purchaseSucceededEvent(string receipt)
    {
        byte[] bytes = System.Text.Encoding.UTF8.GetBytes(receipt);
//		ComsumeIAP  = new IAPEvent (new EventDelegate (this, "mComsumeIAP"));
//		NetMgr.ComsumeIAP (orderNo,System.Convert.ToBase64String(bytes),IsTest,ComsumeIAP);
//		orderNo = ComsumeIAP.Response.data.orderNo;
        mIAPEvent = new InAppPurchaseEvent(new EventDelegate(this, "FinishIAP"));
        NetMgr.InAppPurchase(IsTest, itemcode, System.Convert.ToBase64String(bytes), "", mIAPEvent);
    }
Exemplo n.º 4
0
    void purchaseSucceededEvent(GooglePurchase purchase)
    {
        UtilMgr.DismissLoading();
        mIAPEvent = new InAppPurchaseEvent(FinishIAP);

        byte[] bytes     = System.Text.Encoding.UTF8.GetBytes(purchase.originalJson);
        string basedJson = System.Convert.ToBase64String(bytes);

        bytes = System.Text.Encoding.UTF8.GetBytes(purchase.signature);
        string basedSign = System.Convert.ToBase64String(bytes);

//		NetMgr.InAppPurchase(false, purchase.productId, basedJson, basedSign, mIAPEvent);
        NetMgr.InAppPurchase(false, purchase.productId, basedSign, basedJson, mIAPEvent);

        Debug.Log("purchaseSucceededEvent: " + purchase);
    }
Exemplo n.º 5
0
    void purchaseSucceededEvent(GooglePurchase purchase)
    {
//		ComsumeIAP  = new IAPEvent (new EventDelegate (this, "mComsumeIAP"));
//		NetMgr.ComsumeIAP (orderNo,purchase.purchaseToken,IsTest,ComsumeIAP);
//		orderNo = ComsumeIAP.Response.data.orderNo;

        mIAPEvent = new InAppPurchaseEvent(new EventDelegate(this, "FinishIAP"));
//		Debug.Log("purchase : "+Newtonsoft.Json.JsonConvert.SerializeObject(purchase));

        byte[] bytes     = System.Text.Encoding.UTF8.GetBytes(purchase.originalJson);
        string basedJson = System.Convert.ToBase64String(bytes);

        Debug.Log("purchase.signature : " + purchase.signature);
        bytes = System.Text.Encoding.UTF8.GetBytes(purchase.signature);
        string basedSign = System.Convert.ToBase64String(bytes);

        NetMgr.InAppPurchase(IsTest, purchase.productId, basedJson, basedSign, mIAPEvent);

        Debug.Log("purchaseSucceededEvent: " + purchase);
    }
Exemplo n.º 6
0
	void purchaseSucceededEvent(string receipt)
	{	
		UtilMgr.DismissLoading();
		byte[] bytes = System.Text.Encoding.UTF8.GetBytes(receipt);
		mIAPEvent = new InAppPurchaseEvent(FinishIAP);
		NetMgr.InAppPurchase(false, mItemcode, System.Convert.ToBase64String(bytes), "", mIAPEvent);
	}
Exemplo n.º 7
0
	void purchaseSucceededEvent( GooglePurchase purchase )
	{	
		UtilMgr.DismissLoading();
		mIAPEvent = new InAppPurchaseEvent(FinishIAP);

		byte[] bytes = System.Text.Encoding.UTF8.GetBytes(purchase.originalJson);
		string basedJson = System.Convert.ToBase64String(bytes);
		bytes = System.Text.Encoding.UTF8.GetBytes(purchase.signature);
		string basedSign = System.Convert.ToBase64String(bytes);
//		NetMgr.InAppPurchase(false, purchase.productId, basedJson, basedSign, mIAPEvent);
		NetMgr.InAppPurchase(false, purchase.productId, basedSign, basedJson, mIAPEvent);
		
		Debug.Log( "purchaseSucceededEvent: " + purchase );
	}