using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CrazyStudio.Core.Common.Pay.TenPay.Eitities
{
    public class NotifyUrlModel
    {
        /// <summary>
        /// 通知的唯一ID
        /// </summary>
        public string id { get; set; } = string.Empty;
        /// <summary>
        /// 通知创建的时间，遵循rfc3339标准格式，
        /// </summary>
        public string create_time { get; set; } = string.Empty;
        /// <summary>
        /// 通知的资源数据类型，支付成功通知为encrypt-resource
        /// </summary>
        public string resource_type { get; set; } = string.Empty;
        /// <summary>
        /// 通知的类型，支付成功通知的类型为TRANSACTION.SUCCESS
        /// </summary>
        public string event_type { get; set; } = string.Empty;
        /// <summary>
        /// 回调摘要:如：支付成功
        /// </summary>
        public string summary { get; set; } = string.Empty;
        /// <summary>
        /// 通知资源数据 json格式，
        /// </summary>
        public ResourceModel? resource { get; set; }
    }

    /// <summary>
    /// 通知资源数据 json格式，
    /// </summary>
    public class ResourceModel
    {
        /// <summary>
        /// 原始回调类型，为transaction
        /// </summary>
        public string original_type { get; set; } = string.Empty;
        /// <summary>
        /// 对开启结果数据进行加密的加密算法，目前只支持AEAD_AES_256_GCM
        /// </summary>
        public string algorithm { get; set; } = string.Empty;
        /// <summary>
        /// Base64编码后的开启/停用结果数据密文
        /// </summary>
        public string ciphertext { get; set; } = string.Empty;
        /// <summary>
        /// 附加数据
        /// </summary>
        public string associated_data { get; set; } = string.Empty;
        /// <summary>
        /// 加密使用的随机串
        /// </summary>
        public string nonce { get; set; } = string.Empty;
    }
}
