using Edge.Core.Parser.BinaryParser;
using Edge.Core.Parser.BinaryParser.MessageEntity;
using Edge.Core.Parser.BinaryParser.Util;
using ShellChina_EPS_Project_CarPlatePay_EpsClient_App.MessageEntity.Incoming;
using System.Linq;
namespace ShellChina_EPS_Project_CarPlatePay_EpsClient_App.MessageEntity
{
///
///
public class MessageTemplateLookup : IMessageTemplateLookup
{
///
///
///
///
///
public MessageTemplateBase GetMessageTemplateByRawBytes(byte[] bytes)
{
int identity = bytes.Skip(15).Take(3).GetBCD();
if (identity == 020031)
{
return new MembershipInquiryResponse();
}
else if (identity == 020032)
{
return new PaymentResponse();
}
throw new System.InvalidOperationException("message with identity: " + identity + " is not known.");
}
}
}