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); } } }
// 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); }
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); }
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); }
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 ); }