Files
MinFt/Client/Assets/Scripts/Services/DevIAPService.cs
2026-04-27 12:07:32 +08:00

75 lines
1.9 KiB
C#

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<IList<SKUDetail>> GetSKUs()
{
var IAPList = GContext.container.Resolve<Tables>().TbIAPItemList.DataList;
var result = new List<SKUDetail>();
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<PaymentInfo> Pay(Action<string> 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<Dictionary<string,string>> GetOrderUnreceived()
{
await Awaiters.NextFrame;
return new Dictionary<string,string>();
}
public async Task<bool> ConfirmOrders(List<string> orderIDs)
{
await Awaiters.NextFrame;
return false;
}
}
}