using Edge.Core.Domain.FccOrderInfo.Output; using Edge.Core.Parser.BinaryParser.MessageEntity; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HengshanPaymentTerminal.MessageEntity.Outgoing { /// /// 发送实际支付金额给油机数据对象 /// public class SendActuallyPaid : CommonMessage { /// /// 油枪号 /// public int NozzleNum { get; set; } /// /// 流水号 /// public int TTC { get; set; } /// /// 实付金额 /// public decimal Amount { get; set; } public SendActuallyPaid(int nozzleNum, int tTC, decimal amount,byte frame) { this.Handle = (byte)Command.SEND_NEED_AMOUNT; NozzleNum = nozzleNum; TTC = tTC; Amount = amount; this.FrameNum = frame; } public override byte[] ToCommonByteArray() { List list = new List(); byte[] commandAndNozzle = { this.Handle, (byte)this.NozzleNum }; byte[] ttcBytes = NumberToByteArrayWithPadding(this.TTC, 4); byte[] amountPayableBytes = FormatDecimal(this.Amount); list.AddRange(commandAndNozzle); //添加命令字和枪号 list.AddRange(ttcBytes); //添加流水号 list.Add(0x21); //由fcc推送实付金额表示该订单是二维码小程序支付的 list.AddRange(amountPayableBytes); //添加实付金额 //添加3位交易金额1,3位交易金额2,2位优惠规则代码,10位卡应用号,4位消息鉴别码 list.AddRange(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }); byte[] sendBytes = content2data(list.ToArray()); return sendBytes; } public override CommonMessage ToObject(byte[] datas) { return this; } } }