AuthRequest.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. using Edge.Core.Parser.BinaryParser.Attributes;
  2. using HengshanPaymentTerminal.Support;
  3. namespace HengshanPaymentTerminal.MessageEntity.Incoming
  4. {
  5. /// <summary>
  6. /// Authorization request from terminal to system, 0x17.
  7. /// 授权请求,命令字0x17。
  8. /// </summary>
  9. public class AuthRequest : CardMessageBase
  10. {
  11. /// <summary>
  12. /// Constructor
  13. /// </summary>
  14. public AuthRequest() : base(Command.AuthRequest)
  15. {
  16. }
  17. /// <summary>
  18. /// Id of the terminal.
  19. /// 终端编号。
  20. /// </summary>
  21. [Format(4, EncodingType.BcdString, -90)]
  22. public string TerminalId { get; set; }
  23. /// <summary>
  24. /// Logical card number.
  25. /// 逻辑卡号。
  26. /// </summary>
  27. [Format(10, EncodingType.BcdString, -89)]
  28. public string Asn { get; set; }
  29. [Format(3, EncodingType.BIN, -88)]
  30. public int MaxAmount { get; set; }
  31. [Format(3, EncodingType.BIN, -87)]
  32. public int MaxVolume { get; set; }
  33. [Format(7, EncodingType.BcdString, -86)]
  34. public string TransactionTime { get; set; }
  35. [Format(4, EncodingType.BIN, -85)]
  36. public int PosTtc { get; set; }
  37. [Format(2, EncodingType.BIN, -84)]
  38. public ushort SeqNo { get; set; }
  39. [Format(1, EncodingType.BIN, -83)]
  40. public byte PresetType { get; set; }
  41. [Format(2, EncodingType.HexString, -82)]
  42. public string FPCode { get; set; }
  43. [Format(2, EncodingType.HexString, -81)]
  44. public string FuelProductCode { get; set; }
  45. [Format(3, EncodingType.HexString, -80)]
  46. public string CardInfo { get; set; }
  47. [Format(1, EncodingType.BIN, -79)]
  48. public byte PaymentType { get; set; }
  49. public CardInfo CurrentCardInfo
  50. {
  51. get
  52. {
  53. return new CardInfo
  54. {
  55. CardType = CardInfo.Substring(0, 2).ToByte(),
  56. CardCtc = CardInfo.Substring(2, 4).ToUInt16()
  57. };
  58. }
  59. }
  60. public FuelingPointCode FuelingPoint
  61. {
  62. get
  63. {
  64. return new FuelingPointCode
  65. {
  66. NozzleNo = FPCode.Substring(0, 2).ToByte(),
  67. PumpNo = FPCode.Substring(2, 2).ToByte()
  68. };
  69. }
  70. }
  71. }
  72. }