private void NotifyFullfillment(PurchaseReceipt receipt, bool fulfilled) { var notify_fulfillment = new NotifyFulfillmentInput { ReceiptId = receipt.ReceiptId, FulfillmentResult = fulfilled ? "FULFILLED" : "UNAVAILABLE" }; this.amazonIapV2.NotifyFulfillment(notify_fulfillment); }
/// <summary> /// Notifies fullfillment after a purchase /// </summary> /// <param name="receiptID"></param> /// <returns></returns> private bool NotifyFullFillment(string receiptID) { IAmazonIapV2 iapService = AmazonIapV2Impl.Instance; // Construct object passed to operation as input NotifyFulfillmentInput request = new NotifyFulfillmentInput(); // Set input values request.ReceiptId = receiptID; request.FulfillmentResult = "FULFILLED"; // Call synchronous operation with input object iapService.NotifyFulfillment(request); return(true); }
void PurchaseSuccessful(string data, string transID, string amazonReceiptId = "") { MyDebug.Log("InAppManager::PurchaseSuccessful => Item: " + data); #if AMAZONSTORE && UNDERGROUND data = data.Replace("supercell.underground.", "supercell."); #endif switch (data) { case "balldance.removeads": MyDebug.Log("RemoveAds Done"); //TODO Set your Remove Ads Variable here to save value accros sessions AdsMCG.Me.HideBannerAd(); GameUtility.Me.playerData.isRemoveAds = true; if (!isRestore) { #if GOOGLE_TRAK GoogleTracking.Me.LogInApp("Remove Ads", (long)0.99f); GoogleTracking.Me.LogInAppItem(transID, "Remove Ads", data, InAppTypes.NonConsumable.ToString(), (double)0.99f, (long)1); #endif PopupMessages.Me.PurchaseSuccessfulMessage("Ads have been\nremoved successfully"); } else { isRestoreItemSuccess = true; } break; default: InAppDetail iad = new InAppDetail(); iad = GetIDInfo(data); if (iad == null) { break; } #if GOOGLE_TRAK GoogleTracking.Me.LogInApp(iad.DisplayName, (long)iad.CostUSD); GoogleTracking.Me.LogInAppItem(transID, iad.DisplayName, data, iad.InAppType.ToString(), (double)iad.CostUSD, (long)1); #endif if (iad.RewardType == RewardTypes.Coin) { //TODO: Awared Coins to user } string coststring; coststring = isProductReceived && isLocalStoreCost ? iad.CostStringLocaleBase : "$" + iad.CostUSD; string message = "You got {0} coins from\n\"{1}\" for {3}"; message = string.Format(message, iad.Reward.ToString("n0"), iad.DisplayName, coststring); PopupMessages.Me.PurchaseSuccessfulMessage(message); break; } #if UNITY_ANDROID && AMAZONSTORE if (!isRestore && !string.IsNullOrEmpty(amazonReceiptId)) { NotifyFulfillmentInput nfi = new NotifyFulfillmentInput(); nfi.ReceiptId = amazonReceiptId; nfi.FulfillmentResult = "FULFILLED"; iapService.NotifyFulfillment(nfi); } #endif GameUtility.Me.SavePlayerData(); CoreUtility.Me.OnInAppSucess(data); }