using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace UnityEngine.Purchasing.Default
{
///
/// Interface for Universal Windows Platform purchasing callbacks.
///
public interface IWindowsIAPCallback
{
///
/// Callback received when receiving the list of products.
///
/// The products retrieved.
void OnProductListReceived(WinProductDescription[] winProducts);
///
/// Callback received when receiving an error when attempting to get the list of products.
///
/// The error message explaining the failure.
void OnProductListError(string message);
///
/// Callback received after making a successful purchase.
///
/// The ID of the product purchased.
/// The receipt of the purchase.
/// The ID of the transaction event.
void OnPurchaseSucceeded(string productId, string receipt, string transactionId);
///
/// Callback received after making a failed purchase.
///
/// The ID of the product purchased.
/// The error explaining the failure.
void OnPurchaseFailed(string productId, string error);
///
/// Call used to log messsages during the callbacks in this interface.
///
/// The message to be logged.
void log(string message);
///
/// Call used to log various errors during the callbacks in this interface.
///
/// The error message to be logged.
void logError(string error);
}
///
/// Interface for Universal Windows Platform purchasing calls.
///
public interface IWindowsIAP
{
///
/// Builds a set of local products to be used as a proxy for what's on the Windows Store.
///
/// The products used.
void BuildDummyProducts(List products);
///
/// Initializes the Windows Store.
///
/// The implementation of IWindowsIAPCallback used to handle events.
void Initialize(IWindowsIAPCallback callback);
///
/// Retrieve products from the Windows Store.
///
/// Whether or not to retry the retrieval if it fails due to lack of an Internet connection.
void RetrieveProducts(bool retryIfOffline);
///
/// Purchases a product.
///
/// The ID product to be purchased.
void Purchase(string productId);
///
/// Finalizes a transaction.
///
/// The ID of transaction to be finalzed.
void FinaliseTransaction(string transactionId);
}
}