public IAPProduct(GoogleSkuInfo prod) { productId = prod.productId; title = prod.title; price = prod.price; description = prod.description; }
// 인앱결제 성공 웹서버 콜백 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(); //} }
public IAPProduct( GoogleSkuInfo prod ) { productId = prod.productId; title = prod.title; price = prod.price; description = prod.description; }
void queryInventorySucceededEvent(List <GooglePurchase> purchases, List <GoogleSkuInfo> skus) { Debug.Log(string.Format("queryInventorySucceededEvent. total purchases: {0}, total skus: {1}", purchases.Count, skus.Count)); for (int i = 0; i < skus.Count; i++) { GoogleSkuInfo sku = skus[i]; foreach (ShopGoldInfo info in mGoldList) { if (info.productCode.Equals(sku.productId)) { info.priceDesc = sku.price; } } } IsSupported = true; InitGoldList(); // Prime31.Utils.logObject( purchases ); // Prime31.Utils.logObject( skus ); if (purchases.Count > 0) { mPurchase = purchases[0]; foreach (ShopGoldInfo info in mGoldList) { if (info.productCode.Equals(mPurchase.productId)) { mItemcode = info.productCode; mItemname = info.productName; purchaseSucceededEvent(mPurchase); break; } } } }
/// <summary> /// create new instance based on OS. Android version /// </summary> public IAPArticle(GoogleSkuInfo prod) { id = prod.productId; title = prod.title; description = prod.description; price = prod.price; }
void queryInventorySucceededEvent(List <GooglePurchase> purchases, List <GoogleSkuInfo> skus) { Dictionary <string, PurchaseData> inventory = new Dictionary <string, PurchaseData>(); Prime31.Utils.logObject(purchases); Prime31.Utils.logObject(skus); ShopEvents.purchasedProductIds = new ArrayList(); for (int i = 0; i < purchases.Count; i++) { GooglePurchase purchase = purchases[i]; ShopEvents.purchasedProductIds.Add(purchase.productId); } for (int i = 0; i < skus.Count; i++) { GoogleSkuInfo sku = skus[i]; PurchaseData purchaseData = new PurchaseData(); string productId = sku.productId; string id = GetIdFromProductId(productId); purchaseData.id = id; purchaseData.name = sku.title; purchaseData.description = sku.description; purchaseData.price = sku.price; purchaseData.productId = productId; inventory.Add(id, purchaseData); } ShopEvents.QueryInventorySucceeded(inventory); }
public GoogleSkuInfo Get_AOSgoogleSkuInfo(ushort _shopIdx) { GoogleSkuInfo _sku = null; if (Dic_ProductInfo.ContainsKey(Get_ProductID(_shopIdx))) { _sku = Dic_ProductInfo[Get_ProductID(_shopIdx)]; } return(_sku); }
// 소모되않은 상품 소모처리완료 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); }
public static string[] GetPreciosOrdenados() { if (InventarioTienda == null) { string[] res = { "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?" }; return(res); } GoogleSkuInfo[] aux = new GoogleSkuInfo[skus.Length]; for (int i = 0; i < skus.Length; i++) { string id = skus[i]; foreach (GoogleSkuInfo info in InventarioTienda) { if (info.productId == id) { aux[i] = info; break; } } } string[] results = new string[skus.Length]; for (int j = 0; j < aux.Length; j++) { if (aux[j] != null) { results[j] = aux[j].price; } else { results[j] = "?"; } } return(results); }
public void queryInventorySucceeded(string json) { if (queryInventorySucceededEvent != null) { var dict = json.dictionaryFromJson(); queryInventorySucceededEvent(GooglePurchase.fromList(dict["purchases"] as List <object>), GoogleSkuInfo.fromList(dict["skus"] as List <object>)); } }
public void queryInventorySucceeded(string json) { if (GoogleIABManager.queryInventorySucceededEvent != null) { Dictionary <string, object> dictionary = json.dictionaryFromJson(); GoogleIABManager.queryInventorySucceededEvent(GooglePurchase.fromList(dictionary["purchases"] as List <object>), GoogleSkuInfo.fromList(dictionary["skus"] as List <object>)); } }