protected override void CompleteTransaction(string productId)
 {
     if (productId == ConsumableViewController.Buy5ProductId)
     {
         CreditManager.Add(5);                 // 5 * qty
     }
     else if (productId == ConsumableViewController.Buy10ProductId)
     {
         CreditManager.Add(10);                 // 10 * qty
     }
     else
     {
         Console.WriteLine("Shouldn't happen, there are only two products");
     }
 }
Ejemplo n.º 2
0
        public void CompleteTransaction(SKPaymentTransaction transaction)
        {
            Console.WriteLine("CompleteTransaction " + transaction.TransactionIdentifier);
            var productId = transaction.Payment.ProductIdentifier;

            //var qty = transaction.Payment.Quantity;
            if (productId == ConsumableViewController.Buy5ProductId)
            {
                CreditManager.Add(5);                 // 5 * qty
            }
            else if (productId == ConsumableViewController.Buy10ProductId)
            {
                CreditManager.Add(10);                 // 10 * qty
            }
            else
            {
                Console.WriteLine("Shouldn't happen, there are only two products");
            }

            FinishTransaction(transaction, true);
        }