using System.Xml.Serialization;
using Hncore.Infrastructure.Common;

namespace Hncore.Pass.PaymentCenter.WeiFuTong.AliJsPay
{
    /// <summary>
    /// 支付宝支付窗支付
    /// </summary>
    [XmlRoot("xml", Namespace = "")]
    public class AliJsPayRequest : WeiFuTongRequestBase
    {
        /// <summary>
        /// 买家支付宝账号，和buger_id不能同时为空
        /// </summary>
        [XmlElement("buyer_logon_id")]
        public string BuyerLogonId { get; set; }

        /// <summary>
        /// 买家支付宝用户ID，和buyer_logon_id不能同时
        /// </summary>
        [XmlElement("buyer_id")]
        public string BuyerId { get; set; }
        
        /// <summary>
        /// 商户系统内部的订单号 ,5到32个字符、 只能包含字母数字或者下划线，区分大小写，每次下单请求确保在商户系统唯一
        /// </summary>
        [XmlElement("out_trade_no")]
        public string OutTradeNo { get; set; }

        /// <summary>
        /// 商品描述
        /// </summary>
        [XmlElement("body")]
        public string Body { get; set; }

        /// <summary>
        /// 总金额，以分为单位，不允许包含任何字、符号
        /// </summary>
        [XmlElement("total_fee")]
        public int TotalFee { get; set; }

        /// <summary>
        /// 订单生成的机器 IP
        /// </summary>
        [XmlElement("mch_create_ip")]
        public string MchCreateIp { get; set; } = NetworkHelper.GetPublicIp();

        [XmlElement("notify_url")] public string NotifyUrl { get; set; }

        public AliJsPayRequest() : base("pay.alipay.jspay")
        {
        }
    }
}