using Edge.Core.Parser.BinaryParser.Attributes;
using System;
using System.Collections.Generic;
using System.Text;

namespace HengshanPaymentTerminal.MessageEntity.Outgoing
{
    public class CancelAuthResult : CardMessageBase
    {
        public CancelAuthResult() : base(Command.CancelAuthResult)
        {

        }

        /// <summary>
        /// Logical card number.
        /// 逻辑卡号，10字节，BCD。
        /// </summary>
        [Format(10, EncodingType.BcdString, -89)]
        public string Asn { get; set; }

        [Format(4, EncodingType.BIN, -88)]
        public int PosTtc { get; set; }

        [Format(2, EncodingType.BIN, -87)]
        public ushort SeqNo { get; set; }

        [Format(2, EncodingType.BIN, -86)]
        public ushort FPCode { get; set; }

        [Format(1, EncodingType.BIN, -85)]
        public byte Result { get; set; }

        /// <summary>
        /// Length of additional information.
        /// 附加信息长度，1字节。
        /// </summary>
        [Format(1, EncodingType.BIN, -84)]
        public byte AdditionalInfoLength { get; set; }

        /// <summary>
        /// Additional information.
        /// 附加信息，2-20字节。
        /// </summary>
        [EnumerableFormat("AdditionalInfoLength", 1)]
        public string AdditionalInfo { get; set; }
    }
}
