public void OnPurchaseFailed(Product i, PurchaseFailureReason p)
 {
     MessageDialogs.ShowMessageDialog(
         "Store Error",
         "Failed to purchase product " + i.definition.storeSpecificId + ":\n" + p,
         "OK", null);
 }
    public void BuyProductID(string id)
    {
        if (!IsInitialized( ))
        {
            MessageDialogs.ShowMessageDialog(
                "Store Error",
                "Store is not yet initialized.",
                "OK", null);
            return;
        }

        Product product = _storeController.products.WithID(productID);

        if (product == null)
        {
            MessageDialogs.ShowMessageDialog(
                "Store Error",
                "Problem retrieving product.",
                "OK", null);
            return;
        }

        // starting purchase, is async so will need some sort of loading pop-up
        _storeController.InitiatePurchase(product);
    }
 public void OnInitializeFailed(InitializationFailureReason error)
 {
     MessageDialogs.ShowMessageDialog(
         "Store Error",
         "Problem initializing:\n" + error,
         "OK", null);
 }
    public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs e)
    {
        if (string.Equals(e.purchasedProduct.definition.id, productID, StringComparison.Ordinal))
        {
            MessageDialogs.ShowMessageDialog(
                "Purchase Complete",
                "Thanks for your money!",
                "OK", null);
        }

        return(PurchaseProcessingResult.Complete);
    }