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
4 changes: 1 addition & 3 deletions TransactionProcessorACL.BusinessLogic.Tests/RequestTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ public void ProcessLogonTransactionRequest_CanBeCreated_IsCreated()
TestData.MerchantId,
TestData.TransactionDateTime,
TestData.TransactionNumber,
TestData.DeviceIdentifier,
TestData.RequireConfigurationInResponseTrue);
TestData.DeviceIdentifier);

request.EstateId.ShouldBe(TestData.EstateId);
request.MerchantId.ShouldBe(TestData.MerchantId);
request.TransactionDateTime.ShouldBe(TestData.TransactionDateTime);
request.TransactionNumber.ShouldBe(TestData.TransactionNumber);
request.DeviceIdentifier.ShouldBe(TestData.DeviceIdentifier);
request.RequireConfigurationInResponse.ShouldBe(TestData.RequireConfigurationInResponseTrue);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<DebugType>None</DebugType>
<DebugType>Full</DebugType>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async Task TransactionProcessorACLApplicationService_ProcessLogonTransact
{
Mock<ITransactionProcessorClient> transactionProcessorClient = new Mock<ITransactionProcessorClient>();
transactionProcessorClient.Setup(t => t.PerformTransaction(It.IsAny<String>(), It.IsAny<SerialisedMessage>(), It.IsAny<CancellationToken>()))
.ReturnsAsync(TestData.SerialisedMessageResponse);
.ReturnsAsync(TestData.SerialisedMessageResponseLogon);
Mock<ISecurityServiceClient> securityServiceClient = new Mock<ISecurityServiceClient>();
securityServiceClient.Setup(s => s.GetToken(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<CancellationToken>())).ReturnsAsync(TestData.TokenResponse);

Expand Down Expand Up @@ -136,7 +136,7 @@ public async Task TransactionProcessorACLApplicationService_ProcessSaleTransacti
{
Mock<ITransactionProcessorClient> transactionProcessorClient = new Mock<ITransactionProcessorClient>();
transactionProcessorClient.Setup(t => t.PerformTransaction(It.IsAny<String>(), It.IsAny<SerialisedMessage>(), It.IsAny<CancellationToken>()))
.ReturnsAsync(TestData.SerialisedMessageResponse);
.ReturnsAsync(TestData.SerialisedMessageResponseSale);
Mock<ISecurityServiceClient> securityServiceClient = new Mock<ISecurityServiceClient>();
securityServiceClient.Setup(s => s.GetToken(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<CancellationToken>())).ReturnsAsync(TestData.TokenResponse);

Expand Down Expand Up @@ -252,7 +252,7 @@ public async Task TransactionProcessorACLApplicationService_ProcessReconciliatio
{
Mock<ITransactionProcessorClient> transactionProcessorClient = new Mock<ITransactionProcessorClient>();
transactionProcessorClient.Setup(t => t.PerformTransaction(It.IsAny<String>(), It.IsAny<SerialisedMessage>(), It.IsAny<CancellationToken>()))
.ReturnsAsync(TestData.SerialisedMessageResponse);
.ReturnsAsync(TestData.SerialisedMessageResponseReconciliation);
Mock<ISecurityServiceClient> securityServiceClient = new Mock<ISecurityServiceClient>();
securityServiceClient.Setup(s => s.GetToken(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<CancellationToken>())).ReturnsAsync(TestData.TokenResponse);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ private ProcessLogonTransactionRequest(Guid estateId,
Guid merchantId,
DateTime transactionDateTime,
String transactionNumber,
String deviceIdentifier,
Boolean requireConfigurationInResponse)
String deviceIdentifier)
{
this.EstateId = estateId;
this.MerchantId = merchantId;
this.DeviceIdentifier = deviceIdentifier;
this.RequireConfigurationInResponse = requireConfigurationInResponse;
this.TransactionDateTime = transactionDateTime;
this.TransactionNumber = transactionNumber;
}
Expand Down Expand Up @@ -71,14 +69,6 @@ private ProcessLogonTransactionRequest(Guid estateId,
/// </value>
public Guid MerchantId { get; }

/// <summary>
/// Gets a value indicating whether [require configuration in response].
/// </summary>
/// <value>
/// <c>true</c> if [require configuration in response]; otherwise, <c>false</c>.
/// </value>
public Boolean RequireConfigurationInResponse { get; }

/// <summary>
/// Gets the transaction date time.
/// </summary>
Expand Down Expand Up @@ -107,16 +97,14 @@ private ProcessLogonTransactionRequest(Guid estateId,
/// <param name="transactionDateTime">The transaction date time.</param>
/// <param name="transactionNumber">The transaction number.</param>
/// <param name="deviceIdentifier">The device identifier.</param>
/// <param name="requireConfigurationInResponse">if set to <c>true</c> [require configuration in response].</param>
/// <returns></returns>
public static ProcessLogonTransactionRequest Create(Guid estateId,
Guid merchantId,
DateTime transactionDateTime,
String transactionNumber,
String deviceIdentifier,
Boolean requireConfigurationInResponse)
String deviceIdentifier)
{
return new ProcessLogonTransactionRequest(estateId, merchantId, transactionDateTime, transactionNumber, deviceIdentifier, requireConfigurationInResponse);
return new ProcessLogonTransactionRequest(estateId, merchantId, transactionDateTime, transactionNumber, deviceIdentifier);
}

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageReference Include="MediatR" Version="9.0.0" />
<PackageReference Include="SecurityService.Client" Version="1.0.5" />
<PackageReference Include="Shared" Version="1.0.5" />
<PackageReference Include="TransactionProcessor.Client" Version="1.0.11" />
<PackageReference Include="TransactionProcessor.Client" Version="1.0.11.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
using System;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;

/// <summary>
///
Expand All @@ -10,16 +11,6 @@
[ExcludeFromCodeCoverage]
public class LogonTransactionRequestMessage : TransactionRequestMessage
{
#region Properties

/// <summary>
/// Gets or sets a value indicating whether [require configuration in response].
/// </summary>
/// <value>
/// <c>true</c> if [require configuration in response]; otherwise, <c>false</c>.
/// </value>
public Boolean RequireConfigurationInResponse { get; set; }

#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
using System;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;

[ExcludeFromCodeCoverage]
public class OperatorTotalRequest
Expand All @@ -14,6 +15,7 @@ public class OperatorTotalRequest
/// <value>
/// The contract identifier.
/// </value>
[JsonProperty("contract_id")]
public Guid ContractId { get; set; }

/// <summary>
Expand All @@ -22,6 +24,7 @@ public class OperatorTotalRequest
/// <value>
/// The operator identifier.
/// </value>
[JsonProperty("operator_identifier")]
public String OperatorIdentifier { get; set; }

/// <summary>
Expand All @@ -30,6 +33,7 @@ public class OperatorTotalRequest
/// <value>
/// The transaction count.
/// </value>
[JsonProperty("transaction_count")]
public Int32 TransactionCount { get; set; }

/// <summary>
Expand All @@ -38,6 +42,7 @@ public class OperatorTotalRequest
/// <value>
/// The transaction value.
/// </value>
[JsonProperty("transaction_value")]
public Decimal TransactionValue { get; set; }

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;

[ExcludeFromCodeCoverage]
public class ReconciliationRequestMessage : TransactionRequestMessage
Expand All @@ -13,6 +14,7 @@ public class ReconciliationRequestMessage : TransactionRequestMessage
/// <value>
/// The operator totals.
/// </value>
[JsonProperty("operator_totals")]
public List<OperatorTotalRequest> OperatorTotals { get; set; }

/// <summary>
Expand All @@ -21,6 +23,7 @@ public class ReconciliationRequestMessage : TransactionRequestMessage
/// <value>
/// The transaction count.
/// </value>
[JsonProperty("transaction_count")]
public Int32 TransactionCount { get; set; }

/// <summary>
Expand All @@ -29,6 +32,7 @@ public class ReconciliationRequestMessage : TransactionRequestMessage
/// <value>
/// The transaction value.
/// </value>
[JsonProperty("transaction_value")]
public Decimal TransactionValue { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
using System;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;

/// <summary>
///
Expand All @@ -11,37 +12,41 @@
public class SaleTransactionRequestMessage : TransactionRequestMessage
{
#region Properties

/// <summary>
/// Gets or sets the contract identifier.
/// </summary>
/// <value>
/// The contract identifier.
/// </value>
[JsonProperty("contract_id")]
public Guid ContractId { get; set; }

/// <summary>
/// Gets or sets the customer email address.
/// Gets or sets the operator identifier.
/// </summary>
/// <value>
/// The customer email address.
/// The operator identifier.
/// </value>
public String CustomerEmailAddress { get; set; }
[JsonProperty("operator_identifier")]
public String OperatorIdentifier { get; set; }

/// <summary>
/// Gets or sets the operator identifier.
/// Gets or sets the customer email address.
/// </summary>
/// <value>
/// The operator identifier.
/// The customer email address.
/// </value>
public String OperatorIdentifier { get; set; }
[JsonProperty("customer_email_address")]
public String CustomerEmailAddress { get; set; }

/// <summary>
/// Gets or sets the product identifier.
/// </summary>
/// <value>
/// The product identifier.
/// </value>
[JsonProperty("product_id")]
public Guid ProductId { get; set; }

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;

/// <summary>
///
Expand All @@ -18,6 +19,7 @@ public class TransactionRequestMessage
/// <value>
/// The application version.
/// </value>
[JsonProperty("application_version")]
public String ApplicationVersion { get; set; }

/// <summary>
Expand All @@ -26,6 +28,7 @@ public class TransactionRequestMessage
/// <value>
/// The device identifier.
/// </value>
[JsonProperty("device_identifier")]
public String DeviceIdentifier { get; set; }

/// <summary>
Expand All @@ -34,6 +37,7 @@ public class TransactionRequestMessage
/// <value>
/// The transaction date time.
/// </value>
[JsonProperty("transaction_date_time")]
public DateTime TransactionDateTime { get; set; }

/// <summary>
Expand All @@ -42,6 +46,7 @@ public class TransactionRequestMessage
/// <value>
/// The transaction number.
/// </value>
[JsonProperty("transaction_number")]
public String TransactionNumber { get; set; }

/// <summary>
Expand All @@ -50,6 +55,7 @@ public class TransactionRequestMessage
/// <value>
/// The additional request meta data.
/// </value>
[JsonProperty("additional_request_metadata")]
public Dictionary<String,String> AdditionalRequestMetaData { get; set; }

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace TransactionProcessorACL.DataTransferObjects.Responses
{
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;

[ExcludeFromCodeCoverage]
public class TransactionResponseMessage
Expand All @@ -15,6 +16,7 @@ public class TransactionResponseMessage
/// <value>
/// The response code.
/// </value>
[JsonProperty("response_code")]
public String ResponseCode { get; set; }

/// <summary>
Expand All @@ -23,6 +25,7 @@ public class TransactionResponseMessage
/// <value>
/// The response message.
/// </value>
[JsonProperty("response_message")]
public String ResponseMessage { get; set; }

/// <summary>
Expand All @@ -31,6 +34,7 @@ public class TransactionResponseMessage
/// <value>
/// The additional response meta data.
/// </value>
[JsonProperty("additional_response_metadata")]
public Dictionary<String, String> AdditionalResponseMetaData { get; set; }

/// <summary>
Expand All @@ -39,6 +43,7 @@ public class TransactionResponseMessage
/// <value>
/// The estate identifier.
/// </value>
[JsonProperty("estate_id")]
public Guid EstateId { get; set; }

/// <summary>
Expand All @@ -47,6 +52,7 @@ public class TransactionResponseMessage
/// <value>
/// The merchant identifier.
/// </value>
[JsonProperty("merchant_id")]
public Guid MerchantId { get; set; }

/// <summary>
Expand All @@ -55,6 +61,7 @@ public class TransactionResponseMessage
/// <value>
/// <c>true</c> if [requires application update]; otherwise, <c>false</c>.
/// </value>
[JsonProperty("requires_application_update")]
public Boolean RequiresApplicationUpdate { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Scenario: Logon Transaction
| DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName |
| Today | 3 | Logon | Test Merchant 3 | 123456789 | Test Estate 2 |

Then transaction response should contain the following information
Then the logon transaction response should contain the following information
| EstateName | MerchantName | TransactionNumber | TransactionType | ResponseCode | ResponseMessage |
| Test Estate 1 | Test Merchant 1 | 1 | Logon | 0000 | SUCCESS |
| Test Estate 1 | Test Merchant 2 | 2 | Logon | 0000 | SUCCESS |
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Scenario: Reconciliation Transaction
| DateTime | MerchantName | DeviceIdentifier | EstateName | TransactionCount | TransactionValue |
| Today | Test Merchant 3 | 123456782 | Test Estate 2 | 3 | 300.00 |

Then reconciliation response should contain the following information
Then the reconciliation response should contain the following information
| EstateName | MerchantName | ResponseCode | ResponseMessage |
| Test Estate 1 | Test Merchant 1 | 0000 | SUCCESS |
| Test Estate 1 | Test Merchant 2 | 0000 | SUCCESS |
Expand Down
Loading