123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- 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
- {
- /// <summary>
- /// 发送实际支付金额给油机数据对象
- /// </summary>
- public class SendActuallyPaid : CommonMessage
- {
- /// <summary>
- /// 油枪号
- /// </summary>
- public int NozzleNum { get; set; }
- /// <summary>
- /// 流水号
- /// </summary>
- public int TTC { get; set; }
- /// <summary>
- /// 实付金额
- /// </summary>
- 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<Byte> list = new List<Byte>();
- 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;
- }
- }
- }
|