private async void FulfillProduct(string productId, Guid transactionId) { try { FulfillmentResult result = await IAPs.ReportConsumableFulfillmentAsync(productId, transactionId); switch (result) { case FulfillmentResult.Succeeded: break; case FulfillmentResult.NothingToFulfill: //rootPage.NotifyUser("There is no purchased product 1 to fulfill.", NotifyType.StatusMessage); break; case FulfillmentResult.PurchasePending: //rootPage.NotifyUser("You bought product 1. The purchase is pending so we cannot fulfill the product.", NotifyType.StatusMessage); break; case FulfillmentResult.PurchaseReverted: //rootPage.NotifyUser("You bought product 1, but your purchase has been reverted.", NotifyType.StatusMessage); // Since the user's purchase was revoked, they got their money back. // You may want to revoke the user's access to the consumable content that was granted. break; case FulfillmentResult.ServerError: //rootPage.NotifyUser("You bought product 1. There was an error when fulfilling.", NotifyType.StatusMessage); break; } } catch (Exception) { //rootPage.NotifyUser("You bought Product 1. There was an error when fulfilling.", NotifyType.ErrorMessage); } ResourceLoader resource = ResourceLoader.GetForCurrentView(); var dlg = DialogHelper.GetSimpleContentDialog( resource.GetString("IAPs/Donation/Thanks/Title"), resource.GetString("IAPs/Donation/Thanks/Content"), resource.GetString("Button/Ok/Content")); await dlg.ShowAsync(); App.ContentDlgOp = null; }
private async void RetriveIAPsListingInformation(Message <ListingInformation> msg) { var listingInformation = await IAPs.LoadListingInformationAsync(); msg.Action.Invoke(listingInformation); }