public static async Task <string> GetProductReceiptAsync(string selectedProductId) { MockIAP.CheckIfInitialized(); string receipt = null; if (!MockIAP.MockMode) { receipt = await Windows.ApplicationModel.Store.CurrentApp.GetProductReceiptAsync(selectedProductId); } else { var rs = new MockReceiptStore(); Dictionary <string, string> receipts = rs.EnumerateReceipts(); if (receipts.ContainsKey(selectedProductId)) { receipt = receipts[selectedProductId]; } } return(receipt); }
public static async Task <ListingInformation> LoadListingInformationAsync() { MockIAP.CheckIfInitialized(); ListingInformation listingInformation; if (!MockIAP.MockMode) { Windows.ApplicationModel.Store.ListingInformation li = await Windows.ApplicationModel.Store.CurrentApp.LoadListingInformationAsync(); listingInformation = new ListingInformation(li); LicenseInformation = new LicenseInformation(Windows.ApplicationModel.Store.CurrentApp.LicenseInformation); } else { listingInformation = MockIAP.GetListingInformation(); listingInformation.ProductListings = MockIAP.allProducts; } return(listingInformation); }