2025-04-29 14:35:29 +08:00
|
|
|
namespace GameWrapper.Pay
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 支付服务接口
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface IPaymentService
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 初始化支付服务
|
|
|
|
|
/// </summary>
|
|
|
|
|
void Initialize();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 检查应用是否已初始化
|
|
|
|
|
/// </summary>
|
|
|
|
|
bool IsAppInitialized();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 购买商品
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="currencyID">货币ID</param>
|
|
|
|
|
/// <param name="count">数量</param>
|
2025-06-04 14:17:30 +08:00
|
|
|
/// <param name="itemID">售出物品ID</param>
|
2025-06-09 16:46:13 +08:00
|
|
|
/// <param name="shopID">商店ID</param>
|
|
|
|
|
/// <param name="goodsID">商品ID</param>
|
|
|
|
|
/// <param name="index">商品在商店中的位置</param>
|
2025-11-19 19:40:14 +08:00
|
|
|
void BuyGoods(string currencyID, int count, int itemID,
|
2026-05-14 16:18:48 +08:00
|
|
|
int shopID = 0, int goodsID = 0, int index = 0, bool isRefundPunish = false);
|
2025-04-29 14:35:29 +08:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 支付回调
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="result">结果码</param>
|
|
|
|
|
void OnPaymentCallback(string result);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 检测用户是否直接返回至游戏
|
|
|
|
|
/// </summary>
|
|
|
|
|
void OnApplicationPause(bool pauseStatus);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 是否在支付流程中
|
|
|
|
|
/// </summary>
|
|
|
|
|
bool IsPaying();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 支付相关服务定位器
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class PaymentServiceLocator
|
|
|
|
|
{
|
2025-11-19 19:14:48 +08:00
|
|
|
public static IPaymentService DebuggerPaymentService { get; set; }
|
2025-04-29 14:35:29 +08:00
|
|
|
public static IPaymentService WxPaymentService { get; set; }
|
2025-10-16 16:27:39 +08:00
|
|
|
public static IPaymentService AliPaymentService { get; set; }
|
2025-11-19 19:14:48 +08:00
|
|
|
|
2025-11-11 13:28:42 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// B站支付服务
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static IPaymentService BiliPaymentService { get; set; }
|
2026-04-07 18:35:11 +08:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// iOS支付服务
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static IPaymentService ApplePaymentService { get; set; }
|
2026-05-27 18:00:20 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// Harmony支付服务
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static IPaymentService HarmonyPaymentService { get; set; }
|
2025-04-29 14:35:29 +08:00
|
|
|
}
|
|
|
|
|
}
|