Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public async Task ProcessLogonTransactionRequestHandler_Handle_RequestIsHandled(
response.ShouldNotBeNull();
response.ResponseCode.ShouldBe(TestData.ResponseCode);
response.ResponseMessage.ShouldBe(TestData.ResponseMessage);
response.EstateId.ShouldBe(TestData.EstateId);
response.MerchantId.ShouldBe(TestData.MerchantId);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace TransactionProcessorACL.BusinessLogic.Requests
{
using System;
using System.Diagnostics.CodeAnalysis;
using MediatR;
using Models;

Expand All @@ -12,6 +13,7 @@ public class ProcessLogonTransactionRequest : IRequest<ProcessLogonTransactionRe
{
#region Constructors

[ExcludeFromCodeCoverage]
public ProcessLogonTransactionRequest()
{

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
namespace TransactionProcessorACL.BusinessLogic.Requests
{
using System;
using System.Diagnostics.CodeAnalysis;
using MediatR;
using Models;

public class ProcessSaleTransactionRequest : IRequest<ProcessSaleTransactionResponse>
{
/// <summary>
/// Initializes a new instance of the <see cref="ProcessSaleTransactionRequest"/> class.
/// </summary>
[ExcludeFromCodeCoverage]
public ProcessSaleTransactionRequest()
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ public async Task<ProcessLogonTransactionResponse> ProcessLogonTransaction(Guid
response = new ProcessLogonTransactionResponse
{
ResponseCode = logonTransactionResponse.ResponseCode,
ResponseMessage = logonTransactionResponse.ResponseMessage
ResponseMessage = logonTransactionResponse.ResponseMessage,
EstateId = estateId,
MerchantId = merchantId
};
}
catch(Exception ex)
Expand All @@ -111,8 +113,10 @@ public async Task<ProcessLogonTransactionResponse> ProcessLogonTransaction(Guid
response = new ProcessLogonTransactionResponse
{
ResponseCode = "0001", // Request Message error
ResponseMessage = ex.InnerException.Message
};
ResponseMessage = ex.InnerException.Message,
EstateId = estateId,
MerchantId = merchantId
};
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace TransactionProcessorACL.DataTransferObjects.Responses
{
using System;
using System.Diagnostics.CodeAnalysis;

[ExcludeFromCodeCoverage]
public class LogonTransactionResponseMessage : TransactionResponseMessage
{
/// <summary>
/// Gets or sets the estate identifier.
/// </summary>
/// <value>
/// The estate identifier.
/// </value>
public Guid EstateId { get; set; }

/// <summary>
/// Gets or sets the merchant identifier.
/// </summary>
/// <value>
/// The merchant identifier.
/// </value>
public Guid MerchantId { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace TransactionProcessorACL.DataTransferObjects.Responses
{
using System.Diagnostics.CodeAnalysis;

[ExcludeFromCodeCoverage]
public class SaleTransactionResponseMessage : TransactionResponseMessage
{

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,4 @@ public class TransactionResponseMessage
/// </value>
public String ResponseMessage { get; set; }
}

[ExcludeFromCodeCoverage]
public class LogonTransactionResponseMessage : TransactionResponseMessage
{

}

[ExcludeFromCodeCoverage]
public class SaleTransactionResponseMessage : TransactionResponseMessage
{

}
}
16 changes: 16 additions & 0 deletions TransactionProcessorACL.Models/ProcessLogonTransactionResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,21 @@ public class ProcessLogonTransactionResponse
/// The response message.
/// </value>
public String ResponseMessage { get; set; }

/// <summary>
/// Gets or sets the estate identifier.
/// </summary>
/// <value>
/// The estate identifier.
/// </value>
public Guid EstateId { get; set; }

/// <summary>
/// Gets or sets the merchant identifier.
/// </summary>
/// <value>
/// The merchant identifier.
/// </value>
public Guid MerchantId { get; set; }
}
}
4 changes: 3 additions & 1 deletion TransactionProcessorACL.Testing/TestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ public class TestData
public static ProcessLogonTransactionResponse ProcessLogonTransactionResponse = new ProcessLogonTransactionResponse
{
ResponseMessage = TestData.ResponseMessage,
ResponseCode = TestData.ResponseCode
ResponseCode = TestData.ResponseCode,
EstateId = TestData.EstateId,
MerchantId = TestData.MerchantId
};

public static SerialisedMessage SerialisedMessageResponse = new SerialisedMessage
Expand Down
2 changes: 2 additions & 0 deletions TransactionProcessorACL.Tests/General/ModelFactoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public void ModelFactory_ConvertFrom_ProcessLogonTransactionResponse_IsConverted
response.ShouldNotBeNull();
response.ResponseMessage.ShouldBe(processLogonTransactionResponse.ResponseMessage);
response.ResponseCode.ShouldBe(processLogonTransactionResponse.ResponseCode);
response.EstateId.ShouldBe(processLogonTransactionResponse.EstateId);
response.MerchantId.ShouldBe(processLogonTransactionResponse.MerchantId);
}

[Fact]
Expand Down
2 changes: 2 additions & 0 deletions TransactionProcessorACL/Factories/ModelFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public LogonTransactionResponseMessage ConvertFrom(ProcessLogonTransactionRespon

logonTransactionResponseMessage.ResponseMessage = processLogonTransactionResponse.ResponseMessage;
logonTransactionResponseMessage.ResponseCode = processLogonTransactionResponse.ResponseCode;
logonTransactionResponseMessage.MerchantId = processLogonTransactionResponse.MerchantId;
logonTransactionResponseMessage.EstateId = processLogonTransactionResponse.EstateId;

return logonTransactionResponseMessage;
}
Expand Down