Exemplo n.º 1
0
 public (GetEMVCommandsResponseDto Response, RawSoapDetails SoapDetails) GetEMVCommands(GetEMVCommandsRequestDto dto)
 {
     (GetEMVCommandsResponseDto Response, RawSoapDetails SoapDetails)result = (default, default);
Exemplo n.º 2
0
        private void ShowGetEMVCommandsUI()
        {
            var request = new GetEMVCommandsRequestDto();

            try
            {
                WriteLine("=====================Request building start======================");
                request.CustomerCode          = Read_String_Input("Please enter the CustomerCode:", false);
                request.Username              = Read_String_Input("Please enter the Username:"******"Please enter the Password:"******"Please enter the BillingLabel:", true);
                request.CustomerTransactionId = Read_String_Input("Please enter the CustomerTransactionID:", true);
                request.AdditionalRequestData = Read_MultipleKeysInput("AdditionalRequestData");
                request.EMVCommandType        = Read_EMVCommandType_Input("Please enter the EMVCommandType:");
                request.DeviceType            = Read_DeviceType_Input("Please enter the DeviceType:", request.EMVCommandType);
                request.KSN          = Read_String_Input("Please enter the KSN:", false);
                request.KeyName      = Read_String_Input("Please enter the KeyName:", false);
                request.SerialNumber = Read_String_Input("Please enter the SerialNumber:", false);
                request.XMLString    = Read_LongString_Input("Please enter the XMLString:", false);

                WriteLine("=====================Request building End======================");
                var svc    = _serviceProvider.GetService <IEMVClient>();
                var result = svc.GetEMVCommands(request);
                if ((result.Response != null) && (result.SoapDetails != null))
                {
                    WriteLine("Request:");
                    Write(PrettyXml(result.SoapDetails.RequestXml) + "\n");
                    WriteLine("=====================Response Start======================");
                    WriteLine("Response:");
                    Write(PrettyXml(result.SoapDetails.ResponseXml) + "\n");
                    WriteLine("=====================Response End======================");
                    WriteLine("=====================Parsed Response Start======================");
                    WriteLine($"{nameof(result.Response.AdditionalOutputData)} : { result.Response.AdditionalOutputData }");
                    result.Response.Commands.ForEach(cmd =>
                    {
                        WriteLine($"{nameof(cmd.CommandType)} : { cmd.CommandType}");
                        WriteLine($"{nameof(cmd.Description)} : { cmd.Description}");
                        WriteLine($"{nameof(cmd.ID)} : { cmd.ID}");
                        WriteLine($"{nameof(cmd.Name)} : { cmd.Name}");
                        WriteLine($"{nameof(cmd.Value)} : { cmd.Value}");
                        WriteLine($"{nameof(cmd.ExecutionTypeEnum)} : { cmd.ExecutionTypeEnum}");
                    });
                    WriteLine($"{nameof(result.Response.CustomerTransactionId)} : { result.Response.CustomerTransactionId }");
                    WriteLine($"{nameof(result.Response.MagTranId)} : { result.Response.MagTranId }");
                    result.Response.PostloadCommands.ForEach(cmd =>
                    {
                        WriteLine($"{nameof(cmd.CommandType)} : { cmd.CommandType}");
                        WriteLine($"{nameof(cmd.Description)} : { cmd.Description}");
                        WriteLine($"{nameof(cmd.ID)} : { cmd.ID}");
                        WriteLine($"{nameof(cmd.Name)} : { cmd.Name}");
                        WriteLine($"{nameof(cmd.Value)} : { cmd.Value}");
                        WriteLine($"{nameof(cmd.ExecutionTypeEnum)} : { cmd.ExecutionTypeEnum}");
                    });
                    result.Response.PreloadCommands.ForEach(cmd =>
                    {
                        WriteLine($"{nameof(cmd.CommandType)} : { cmd.CommandType}");
                        WriteLine($"{nameof(cmd.Description)} : { cmd.Description}");
                        WriteLine($"{nameof(cmd.ID)} : { cmd.ID}");
                        WriteLine($"{nameof(cmd.Name)} : { cmd.Name}");
                        WriteLine($"{nameof(cmd.Value)} : { cmd.Value}");
                        WriteLine($"{nameof(cmd.ExecutionTypeEnum)} : { cmd.ExecutionTypeEnum}");
                    });
                    WriteLine("=====================Parsed Response End======================");
                }
                else
                {
                    WriteLine("Response is null, Please check with input values given and try again");
                }
            }
            catch (Exception ex)
            {
                WriteLine("Error: " + ex.Message.ToString());
            }
        }