using System; using System.Collections.Generic; using Windows.ApplicationModel.Store; using Windows.Foundation; namespace UnityEngine.Purchasing.Default { /// /// Wrapper class for the Windows Store API CurrentApp class. /// public class CurrentApp : ICurrentApp { /// /// Returns a list of purchased consumable in-app products that have not been reported to the Microsoft Store as fulfilled.. /// /// The list of purchased consumable products that have not been reported as fulfilled. public IAsyncOperation> GetUnfulfilledConsumablesAsync() { return global::Windows.ApplicationModel.Store.CurrentApp.GetUnfulfilledConsumablesAsync(); } /// /// Loads the app's listing information asynchronously. /// Additionally, the listing information for available in-app products is also provided. /// /// The ListingInformation that contains info (ex: name, price) specific to the market the user currently resides in. public IAsyncOperation LoadListingInformationAsync() { return global::Windows.ApplicationModel.Store.CurrentApp.LoadListingInformationAsync(); } /// /// Notifies the Microsoft Store that the purchase of a consumable add-on (also called an in-app product or IAP) /// is fulfilled and that the user has the right to access the content. /// /// The product ID of the consumable add-on to report as fulfilled. /// The transaction ID for the purchase of the consumable add-on. /// An async operation for a FulfillmentResult value that indicates the status for the consumable add-on. public IAsyncOperation ReportConsumableFulfillmentAsync(string productId, Guid transactionId) { return global::Windows.ApplicationModel.Store.CurrentApp.ReportConsumableFulfillmentAsync(productId, transactionId); } /// /// Requests the purchase of an add-on (also called an in-app product or IAP). /// Additionally, calling this method displays the UI that is used to complete the transaction via the Microsoft Store. /// /// The product ID of the add-on to purchase. /// An async operation for a PurchaseResults containing the results of the product purchase request. public IAsyncOperation RequestProductPurchaseAsync(string productId) { return global::Windows.ApplicationModel.Store.CurrentApp.RequestProductPurchaseAsync(productId); } /// /// Requests the purchase of an add-on (also called an in-app product or IAP). /// Additionally, calling this method displays the UI that is used to complete the transaction via the Microsoft Store. /// /// The product ID of the add-on to purchase. /// An async operation for a string providing in-app transaction details for the provided productId. public IAsyncOperation RequestProductReceiptAsync(string productId) { return global::Windows.ApplicationModel.Store.CurrentApp.GetProductReceiptAsync(productId); } /// /// Read access to the current app's license metadata. /// public LicenseInformation LicenseInformation { get { return global::Windows.ApplicationModel.Store.CurrentApp.LicenseInformation; } } /// /// Requests all receipts for the purchase of the app and any in-app products. /// /// An async operation for an XML-formatted string containing all receipt information for the purchases of the app and of its products.. public IAsyncOperation RequestAppReceiptAsync() { return global::Windows.ApplicationModel.Store.CurrentApp.GetAppReceiptAsync(); } /// /// Dummy function implementing the building of Mock Products. /// /// The list of product descriptions. public void BuildMockProducts(List products) { // Only implemented by the mock store. } } }