private WP8PurchseResponce GetPurchaseResponseFromString(string data) { string[] storeData; storeData = data.Split("|" [0]); WP8PurchaseCodes code = (WP8PurchaseCodes)Enum.Parse(typeof(WP8PurchaseCodes), storeData[0]); string info_str = storeData[1]; string productID = storeData[2]; if (code == WP8PurchaseCodes.SUCCSES) { foreach (WP8ProductTemplate product in _products) { if (product.ProductId == productID && product.Type == WP8PurchaseProductType.Durable) { product.isPurchased = true; } } } WP8PurchseResponce recponce = new WP8PurchseResponce(code, info_str); recponce.productId = productID; return(recponce); }
private void ProductPurchseDelegate(string data) { string[] storeData; storeData = data.Split("|" [0]); WP8PurchaseCodes code = (WP8PurchaseCodes)Enum.Parse(typeof(WP8PurchaseCodes), storeData[0]); string info_str = storeData[1]; string productID = storeData[2]; if (code == WP8PurchaseCodes.SUCCSES) { foreach (WP8ProductTemplate product in _products) { if (product.ProductId == productID && product.Type == WP8PurchaseProductType.Durable) { product.isPurchased = true; } } } WP8PurchseResponce recponce = new WP8PurchseResponce(code, info_str); recponce.productId = productID; OnPurchaseFinished(recponce); dispatch(PRODUCT_PURCHASE_FINISHED, recponce); }
private static void HandleOnPurchaseFinished(WP8PurchseResponce responce) { if(responce.IsSuccses) { //Unlock logic for product with id recponce.productId should be here WP8Dialog.Create("Purchase Succse", "Product: " + responce.productId); } else { //Purchase fail logic for product with id recponce.productId should be here WP8Dialog.Create("Purchase Failed", "Product: " + responce.productId); } }
private static void HandleOnPurchaseFinished(WP8PurchseResponce responce) { if (responce.IsSuccses) { //Unlock logic for product with id recponce.productId should be here WP8Dialog.Create("Purchase Succse", "Product: " + responce.productId); } else { //Purchase fail logic for product with id recponce.productId should be here WP8Dialog.Create("Purchase Failed", "Product: " + responce.productId); } }
private void WP8_OnProductPurchased(WP8PurchseResponce resp) { UM_InAppProduct p = UltimateMobileSettings.Instance.GetProductByWp8Id(resp.ProductId); if (p != null) { UM_PurchaseResult r = new UM_PurchaseResult(); r.product = p; r.WP8_PurchaseInfo = resp; SendPurchaseEvent(r); } else { SendNoTemplateEvent(); } }
private void PurchaseCallback(string result) { string[] data = result.Split(new string[] { SPLITTER1 }, StringSplitOptions.None); int code = Int32.Parse(data[0]); WP8PurchseResponce response = null; if (code == RESULT_OK) { response = new WP8PurchseResponce((WP8PurchaseCodes)Enum.Parse(typeof(WP8PurchaseCodes), data[1]), data[2]); response.TransactionId = data[3]; } else { response = new WP8PurchseResponce((WP8PurchaseCodes)Enum.Parse(typeof(WP8PurchaseCodes), data[2]), data[1]); } OnPurchaseFinished(response); }
private void ProductPurchseDelegate(string data) { string[] storeData; storeData = data.Split("|" [0]); WP8PurchaseCodes code = (WP8PurchaseCodes)Enum.Parse(typeof(WP8PurchaseCodes), storeData[0]); string info_str = storeData[1]; string productID = storeData[2]; if ( code == WP8PurchaseCodes.SUCCSES ) { foreach ( WP8ProductTemplate product in _products) { if ( product.ProductId == productID && product.Type == WP8PurchaseProductType.Durable ) { product.isPurchased = true; } } } WP8PurchseResponce recponce = new WP8PurchseResponce(code, info_str); recponce.productId = productID; dispatch(PRODUCT_PURCHASE_FINISHED, recponce); }
private void DefferedProductPurchseDelegate(string data) { WP8PurchseResponce defferdResponse = GetPurchaseResponseFromString(data); _defferedPurchases.Add(defferdResponse); }
private void ProductPurchseDelegate(string data) { WP8PurchseResponce recponce = GetPurchaseResponseFromString(data); OnPurchaseFinished(recponce); }
private WP8PurchseResponce GetPurchaseResponseFromString(string data) { string[] storeData; storeData = data.Split("|" [0]); WP8PurchaseCodes code = (WP8PurchaseCodes)Enum.Parse(typeof(WP8PurchaseCodes), storeData[0]); string info_str = storeData[1]; string productID = storeData[2]; if ( code == WP8PurchaseCodes.SUCCSES ) { foreach ( WP8ProductTemplate product in _products) { if ( product.ProductId == productID && product.Type == WP8PurchaseProductType.Durable ) { product.isPurchased = true; } } } WP8PurchseResponce recponce = new WP8PurchseResponce(code, info_str); recponce.productId = productID; return recponce; }