using System; using System.Collections.Generic; using System.Threading.Tasks; using asap.core; using cfg; using Newtonsoft.Json.Linq; namespace game { public class DevIAPService : IIAPService { private IDisposable disposable; public async Task> GetSKUs() { var IAPList = GContext.container.Resolve().TbIAPItemList.DataList; var result = new List(); foreach (var iap in IAPList) { result.Add(new SKUDetail { productId = iap.ProductId1, ProdKey = iap.ProductId1, ProdID = iap.ProductId1, title = iap.ID.ToString(), price = $"US${iap.PaymentAmount}", ProdPriceStr = $"US${iap.PaymentAmount}", ProdPrice = iap.PaymentAmount, price_currency_code = "USD", localeCurrencySymbol = "$", }); } await Awaiters.NextFrame; return result; } public async Task Pay(Action OnSuccessFromSdk,string replenishmentDataStr, SKUDetail sku, int count, float usdPrice, JObject extraPurcheInfo) { await Awaiters.NextFrame; return new PaymentInfo() { isSuccess = true, code = "0" }; } public void Release() { disposable?.Dispose(); disposable = null; } public void Init() { Release(); } public async Task> GetOrderUnreceived() { await Awaiters.NextFrame; return new Dictionary(); } public async Task ConfirmOrders(List orderIDs) { await Awaiters.NextFrame; return false; } } }