public void onPurchaseSucceeded(string id, string receipt) { if (!verifyPlatformId(id)) { return; } if (null != receipt) { this.onPurchaseReceiptRetrieved(id, receipt); } PurchasableItem item = remapper.getPurchasableItemFromPlatformSpecificId(id); if (item.PurchaseType == PurchaseType.NonConsumable) { if (transactionDatabase.getPurchaseHistory(item) > 0) { logger.Log("Ignoring multi purchase of non consumable"); return; } } logger.Log("onPurchaseSucceeded({0})", item.Id); transactionDatabase.onPurchase(item); currencyManager.OnPurchased(item.Id); if (null != onPurchaseComplete) { onPurchaseComplete(new PurchaseEvent(item, receipt)); } }
public void purchase(string item) { purchaseCalled = true; // Our billing systems should only keep track of non consumables. if (remapper.getPurchasableItemFromPlatformSpecificId(item).PurchaseType == PurchaseType.NonConsumable) { purchasedItems.Add(item); } this.biller.onPurchaseSucceeded(item, "{ \"this\" : \"is a fake receipt\" }"); }
public void purchase(string item, string developerPayload) { purchaseCalled = true; // Our billing systems should only keep track of non consumables. if (remapper.getPurchasableItemFromPlatformSpecificId(item).PurchaseType == PurchaseType.NonConsumable) { purchasedItems.Add(item); } biller.onPurchaseReceiptRetrieved(item, "fake receipt"); this.biller.onPurchaseSucceeded(item, "{ \"this\" : \"is a fake receipt\" }", Guid.NewGuid().ToString()); }
public void onPurchaseSucceeded(string id, string receipt) { if (!verifyPlatformId(id)) { return; } PurchasableItem item = remapper.getPurchasableItemFromPlatformSpecificId(id); if (receipt != null && receipt.Length > 0) { // Take a note of the receipt. if (!receiptMap.ContainsKey(item)) { receiptMap.Add(item, new List <string> ()); } receiptMap [item].Add(receipt); } if (item.PurchaseType != PurchaseType.Consumable) { if (transactionDatabase.getPurchaseHistory(item) > 0) { logger.Log("Ignoring multi purchase of non consumable"); return; } } logger.Log("onPurchaseSucceeded({0})", item.Id); transactionDatabase.onPurchase(item); currencyManager.OnPurchased(item.Id); if (null != onPurchaseComplete) { onPurchaseComplete(new PurchaseEvent(item, receipt)); } }
private void onPurchaseSucceeded(string id, bool isNewPurchase, string receipt, string transactionId) { if (!verifyPlatformId(id)) { // We still need to close the transaction. billingSubsystem.finishTransaction(null, transactionId); return; } if (null != receipt) { this.onPurchaseReceiptRetrieved(id, receipt); } PurchasableItem item = remapper.getPurchasableItemFromPlatformSpecificId(id); if (item.PurchaseType == PurchaseType.NonConsumable) { if (transactionDatabase.getPurchaseHistory(item) > 0) { logger.Log("Ignoring multi purchase of non consumable " + item.Id); billingSubsystem.finishTransaction(item, transactionId); return; } } if (transactionDatabase.recordPurchase(item, transactionId)) { currencyManager.OnPurchased(item.Id); if (null != onPurchaseComplete) { logger.Log("onPurchaseSucceeded {0} {1})", item.Id, transactionId); onPurchaseComplete(new PurchaseEvent(item, isNewPurchase, receipt, transactionId)); } } // We don't put this in a try finally since we want any // exceptions to prevent the transaction closing. billingSubsystem.finishTransaction(item, transactionId); }