Esempio n. 1
0
        private static async void GetRemainingBalanceForConsumableAddOnAsync(string storeId, Action <WSAStoreConsumableResult> response)
        {
            StoreConsumableResult result = await StoreContext.GetDefault().GetConsumableBalanceRemainingAsync(storeId);

            WSAStoreConsumableResult wsaStoreConsumableResult = new WSAStoreConsumableResult()
            {
                BalanceRemaining = (int)result.BalanceRemaining,
                Status           = (WSAStoreConsumableStatus)result.Status,
                TrackingId       = result.TrackingId,
                Error            = result.ExtendedError
            };

            if (response != null)
            {
                response(wsaStoreConsumableResult);
            }
        }
Esempio n. 2
0
        private static async void ConsumeAddOnAsync(string storeId, int quantity, Action <WSAStoreConsumableResult> response)
        {
            StoreConsumableResult result = await StoreContext.GetDefault().ReportConsumableFulfillmentAsync(storeId, (uint)quantity, Guid.NewGuid());

            WSAStoreConsumableResult wsaStoreConsumableResult = new WSAStoreConsumableResult()
            {
                BalanceRemaining = (int)result.BalanceRemaining,
                Status           = (WSAStoreConsumableStatus)result.Status,
                TrackingId       = result.TrackingId,
                Error            = result.ExtendedError
            };

            if (response != null)
            {
                response(wsaStoreConsumableResult);
            }
        }