Files
hjha-server/ObjectModel/Config/HuaWei/InappPurchaseDetails.cs
xiaoou e9616125ce feat: initial commit - HJHA game server full source
6 major server modules (PdkFriendServer/GlobalSever/ServerCore/GameModule/GameNetModule) +
game logic (GameFix/GameDAL/ServerData) +
network layer (NetWorkMessage) +
data layer (ObjectModel) +
utilities (MrWu/Core/Config/CloudAPI/dll) +
adapters (zyxAdapter/base)

.NET 8.0 C# solution, 16 projects, 958 source files
2026-07-07 12:02:15 +08:00

126 lines
4.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ObjectModel.Config.HuaWei
{
public class InappPurchaseDetails
{
/// <summary>
/// 消耗型商品或者非消耗型商品固定为false。
/// </summary>
public bool autoRenewing { get; set; }
/// <summary>
/// 订单ID唯一标识一笔需要收费的收据
/// </summary>
public string orderId { get; set; }
/// <summary>
/// 应用安装包名。
/// </summary>
public string packageName { get; set; }
/// <summary>
/// 应用ID。
/// </summary>
public long applicationId { get; set; }
/// <summary>
/// 应用ID
/// </summary>
public string applicationIdString { get; set; }
/// <summary>
/// 商品类别,取值包括
/// 0消耗型商品 1非消耗型商品 2订阅型商品
/// </summary>
public int kind { get; set; }
/// <summary>
/// 商品ID。每种商品必须有唯一的ID
/// </summary>
public string productId { get; set; }
/// <summary>
/// 商品名称。
/// </summary>
public string productName { get; set; }
/// <summary>
/// 商品购买时间UTC时间戳以毫秒为单位
/// </summary>
public long purchaseTime { get; set; }
/// <summary>
/// 历史接口兼容用同purchaseTime新接入无需关注本字段。
/// </summary>
public long purchaseTimeMillis { get; set; }
/// <summary>
/// 订单交易状态。
/// -1初始化 0已购买 1已取消 2已撤销或已退款 3待处理
/// </summary>
public int purchaseState { get; set; }
/// <summary>
/// 商户侧保留信息,由您在调用支付接口时传入
/// </summary>
public string developerPayload { get; set; }
/// <summary>
/// 用于唯一标识商品和用户对应关系的购买令牌,在支付完成时由华为应用内支付服务器生成。
/// </summary>
public string purchaseToken { get; set; }
/// <summary>
/// 消耗状态,仅一次性商品存在,取值包括 0未消耗 1已消耗
/// </summary>
public int consumptionState { get; set; }
/// <summary>
/// 确认状态,取值包括 0 :未确认 1已确认
/// </summary>
public int confirmed { get; set; }
/// <summary>
/// 购买类型。 0沙盒环境
/// </summary>
public int purchaseType { get; set; }
/// <summary>
/// 定价货币的币种 CNY
/// </summary>
public string currency { get; set; }
/// <summary>
/// 商品实际价格*100以后的值
/// </summary>
public long price { get; set; }
/// <summary>
/// 国家/地区码
/// </summary>
public string country { get; set; }
/// <summary>
/// 交易单号,用户支付成功后生成
/// </summary>
public string payOrderId { get; set; }
/// <summary>
/// 支付方式,
/// </summary>
public string payType { get; set; }
/// <summary>
///
/// </summary>
public string sdkChannel { get; set; }
/// <summary>
/// 购买的商品是否数据合格
/// </summary>
/// <returns>true合格false不合格</returns>
public bool IsOk(string id)
{
bool b = false;
b = id == productId;
if (!b) return b;
b = purchaseState == 0;
if (!b) return b;
b = consumptionState == 0;
if (!b) return b;
b = confirmed == 0;
if (!b) return b;
return b;
}
public override string ToString()
{
return $"id:{productId},name:{productName},price:{price},orderid:{orderId}";
}
}
}