From 37216776f03c515e3bd8fc8dc102c54ea483c557 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Wed, 8 Oct 2025 17:38:26 +0100 Subject: [PATCH 1/3] :| --- .../Services/TransactionDomainService.cs | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs b/TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs index 4e7d6ea..265d303 100644 --- a/TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs +++ b/TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs @@ -1,5 +1,7 @@ -using Newtonsoft.Json; +using System.Security.Cryptography; +using Newtonsoft.Json; using Shared.Exceptions; +using Shared.General; using Shared.Results; using SimpleResults; using TransactionProcessor.Aggregates; @@ -114,8 +116,7 @@ public async Task> ProcessLogonTransacti } // Record the successful validation - // TODO: Generate local authcode - stateResult = transactionAggregate.AuthoriseTransactionLocally("ABCD1234", ((Int32)validationResult.Data.ResponseCode).ToString().PadLeft(4, '0'), validationResult.Data.ResponseMessage); + stateResult = transactionAggregate.AuthoriseTransactionLocally(GenerateAuthCode(), ((Int32)validationResult.Data.ResponseCode).ToString().PadLeft(4, '0'), validationResult.Data.ResponseMessage); if (stateResult.IsFailed) return ResultHelpers.CreateFailure(stateResult); } @@ -150,6 +151,15 @@ public async Task> ProcessLogonTransacti } } + public static string GenerateAuthCode() + { + // 8 hex characters == 4 random bytes + byte[] bytes = RandomNumberGenerator.GetBytes(4); // .NET 6+; for older frameworks use RandomNumberGenerator.Create().GetBytes(bytes) + // Convert to uppercase hex string (0-9, A-F). Convert.ToHexString returns uppercase. + string hex = Convert.ToHexString(bytes); + return hex.Substring(0, 8); + } + public async Task> ProcessReconciliationTransaction(TransactionCommands.ProcessReconciliationCommand command, CancellationToken cancellationToken) { try{ @@ -414,8 +424,7 @@ public async Task CalculateFeesForTransaction(TransactionCommands.Calcul if (merchantResult.IsFailed) return ResultHelpers.CreateFailure(merchantResult); if (merchantResult.Data.SettlementSchedule == Models.Merchant.SettlementSchedule.NotSet) { - // TODO: Result - //throw new NotSupportedException($"Merchant {merchant.MerchantId} does not have a settlement schedule configured"); + return Result.Failure($"Merchant {merchantResult.Data.MerchantId} does not have a settlement schedule configured"); } foreach (CalculatedFee calculatedFee in merchantFees) { @@ -572,7 +581,6 @@ private async Task>> GetTransactionFeesFo private async Task AddDeviceToMerchant(Guid merchantId, String deviceIdentifier, CancellationToken cancellationToken) { - // TODO: Should this be firing a command to add the device?? // Add the device to the merchant Result merchantAggregate = await this.AggregateService.GetLatest(merchantId, cancellationToken); if (merchantAggregate.IsFailed) @@ -650,14 +658,12 @@ private async Task SendEmailMessage(String accessToken, MessageId = messageId, Body = body, ConnectionIdentifier = estateId, - FromAddress = "golfhandicapping@btinternet.com", // TODO: lookup from config + FromAddress = ConfigurationReader.GetValueOrDefault("AppSettings", "FromEmailAddress", "golfhandicapping@btinternet.com"), IsHtml = true, Subject = subject, ToAddresses = new List { emailAddress } }; - // TODO: may decide to record the message Id againsts the Transaction Aggregate in future, but for now - // we wont do this... try { return await this.MessagingServiceClient.SendEmail(accessToken, sendEmailRequest, cancellationToken); } From 8713595e69a4e046a28fe7eefe551ce3c4e608eb Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Wed, 8 Oct 2025 18:07:29 +0100 Subject: [PATCH 2/3] some refactoring --- .../Services/TransactionDomainServiceTests.cs | 14 ++-- .../Common/TransactionHelpers.cs | 60 +++++++++++++++ .../Services/TransactionDomainService.cs | 73 ++++--------------- .../Features/Contract.feature.cs | 8 +- .../Features/LogonTransaction.feature.cs | 4 +- .../Features/Merchant.feature.cs | 8 +- .../Features/ReconciliationFeature.feature.cs | 8 +- .../Features/RedeemVoucher.feature.cs | 4 +- .../SaleTransactionFeature.feature.cs | 16 ++-- .../Features/Settlement.feature.cs | 8 +- .../Features/SettlementReporting.feature.cs | 8 +- 11 files changed, 114 insertions(+), 97 deletions(-) create mode 100644 TransactionProcessor.BusinessLogic/Common/TransactionHelpers.cs diff --git a/TransactionProcessor.BusinessLogic.Tests/Services/TransactionDomainServiceTests.cs b/TransactionProcessor.BusinessLogic.Tests/Services/TransactionDomainServiceTests.cs index 28d80f8..8d5e616 100644 --- a/TransactionProcessor.BusinessLogic.Tests/Services/TransactionDomainServiceTests.cs +++ b/TransactionProcessor.BusinessLogic.Tests/Services/TransactionDomainServiceTests.cs @@ -506,7 +506,7 @@ public async Task TransactionDomainService_RequireFeeCalculation_IsNotAuthorised transactionAggregate.DeclineTransaction(TestData.OperatorId, "111", "SUCCESS", "0000", "SUCCESS"); // TODO: maybe move this to an extension on aggregate - var result = TransactionDomainService.RequireFeeCalculation(transactionAggregate); + var result = TransactionHelpers.RequireFeeCalculation(transactionAggregate); result.ShouldBeFalse(); } @@ -520,7 +520,7 @@ public async Task TransactionDomainService_RequireFeeCalculation_IsNotCompelted_ TestData.TransactionAmount); transactionAggregate.AuthoriseTransaction(TestData.OperatorId, "111", "111", "SUCCESS", "1234", "0000", "SUCCESS"); - var result = TransactionDomainService.RequireFeeCalculation(transactionAggregate); + var result = TransactionHelpers.RequireFeeCalculation(transactionAggregate); result.ShouldBeFalse(); } @@ -536,7 +536,7 @@ public async Task TransactionDomainService_RequireFeeCalculation_IsALogon_Return transactionAggregate.CompleteTransaction(); - var result = TransactionDomainService.RequireFeeCalculation(transactionAggregate); + var result = TransactionHelpers.RequireFeeCalculation(transactionAggregate); result.ShouldBeFalse(); } @@ -552,7 +552,7 @@ public async Task TransactionDomainService_RequireFeeCalculation_NoContractId_Re transactionAggregate.CompleteTransaction(); - var result = TransactionDomainService.RequireFeeCalculation(transactionAggregate); + var result = TransactionHelpers.RequireFeeCalculation(transactionAggregate); result.ShouldBeFalse(); } @@ -569,7 +569,7 @@ public async Task TransactionDomainService_RequireFeeCalculation_NullAmount_Retu transactionAggregate.CompleteTransaction(); - var result = TransactionDomainService.RequireFeeCalculation(transactionAggregate); + var result = TransactionHelpers.RequireFeeCalculation(transactionAggregate); result.ShouldBeFalse(); } @@ -586,7 +586,7 @@ public async Task TransactionDomainService_RequireFeeCalculation_ReturnsTrue() transactionAggregate.CompleteTransaction(); - var result = TransactionDomainService.RequireFeeCalculation(transactionAggregate); + var result = TransactionHelpers.RequireFeeCalculation(transactionAggregate); result.ShouldBeTrue(); } @@ -599,7 +599,7 @@ public async Task TransactionDomainService_CalculateSettlementDate_CorrectDateRe DateTime completedDate = DateTime.ParseExact(completedDateString, "yyyy-MM-dd", null); DateTime expectedDate = DateTime.ParseExact(expectedDateString, "yyyy-MM-dd", null); - DateTime result = TransactionDomainService.CalculateSettlementDate(settlementSchedule, completedDate); + DateTime result = TransactionHelpers.CalculateSettlementDate(settlementSchedule, completedDate); result.Date.ShouldBe(expectedDate.Date); } diff --git a/TransactionProcessor.BusinessLogic/Common/TransactionHelpers.cs b/TransactionProcessor.BusinessLogic/Common/TransactionHelpers.cs new file mode 100644 index 0000000..51ca44c --- /dev/null +++ b/TransactionProcessor.BusinessLogic/Common/TransactionHelpers.cs @@ -0,0 +1,60 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using System.Security.Cryptography; +using TransactionProcessor.Aggregates; +using TransactionProcessor.Models; + +namespace TransactionProcessor.BusinessLogic.Common; + +public static class TransactionHelpers { + [ExcludeFromCodeCoverage] + public static String GenerateTransactionReference() + { + Int64 i = 1; + foreach (Byte b in Guid.NewGuid().ToByteArray()) + { + i *= (b + 1); + } + + return $"{i - DateTime.Now.Ticks:x}"; + } + + [ExcludeFromCodeCoverage] + public static string GenerateAuthCode() + { + // 8 hex characters == 4 random bytes + byte[] bytes = RandomNumberGenerator.GetBytes(4); // .NET 6+; for older frameworks use RandomNumberGenerator.Create().GetBytes(bytes) + // Convert to uppercase hex string (0-9, A-F). Convert.ToHexString returns uppercase. + string hex = Convert.ToHexString(bytes); + return hex.Substring(0, 8); + } + + public static DateTime CalculateSettlementDate(Models.Merchant.SettlementSchedule merchantSettlementSchedule, + DateTime completeDateTime) + { + if (merchantSettlementSchedule == Models.Merchant.SettlementSchedule.Weekly) + { + return completeDateTime.Date.AddDays(7).Date; + } + + if (merchantSettlementSchedule == Models.Merchant.SettlementSchedule.Monthly) + { + return completeDateTime.Date.AddMonths(1).Date; + } + + return completeDateTime.Date; + } + + public static Boolean RequireFeeCalculation(TransactionAggregate transactionAggregate) + { + return transactionAggregate switch + { + _ when transactionAggregate.TransactionType == TransactionType.Logon => false, + _ when transactionAggregate.IsAuthorised == false => false, + _ when transactionAggregate.IsCompleted == false => false, + _ when transactionAggregate.ContractId == Guid.Empty => false, + _ when transactionAggregate.TransactionAmount == null => false, + _ => true + }; + } +} \ No newline at end of file diff --git a/TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs b/TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs index 265d303..511a729 100644 --- a/TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs +++ b/TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs @@ -1,5 +1,4 @@ -using System.Security.Cryptography; -using Newtonsoft.Json; +using Newtonsoft.Json; using Shared.Exceptions; using Shared.General; using Shared.Results; @@ -92,7 +91,6 @@ public TransactionDomainService(Func aggregateService, public async Task> ProcessLogonTransaction(TransactionCommands.ProcessLogonTransactionCommand command, CancellationToken cancellationToken) { - try { Result transactionResult = await DomainServiceHelper.GetAggregateOrFailure(ct => this.AggregateService.GetLatest(command.TransactionId, ct), command.TransactionId, cancellationToken, false); if (transactionResult.IsFailed) @@ -102,7 +100,7 @@ public async Task> ProcessLogonTransacti TransactionType transactionType = TransactionType.Logon; // Generate a transaction reference - String transactionReference = this.GenerateTransactionReference(); + String transactionReference = TransactionHelpers.GenerateTransactionReference(); Result stateResult = transactionAggregate.StartTransaction(command.TransactionDateTime, command.TransactionNumber, transactionType, transactionReference, command.EstateId, command.MerchantId, command.DeviceIdentifier, null); // Logon transaction has no amount if (stateResult.IsFailed) @@ -116,7 +114,7 @@ public async Task> ProcessLogonTransacti } // Record the successful validation - stateResult = transactionAggregate.AuthoriseTransactionLocally(GenerateAuthCode(), ((Int32)validationResult.Data.ResponseCode).ToString().PadLeft(4, '0'), validationResult.Data.ResponseMessage); + stateResult = transactionAggregate.AuthoriseTransactionLocally(TransactionHelpers.GenerateAuthCode(), ((Int32)validationResult.Data.ResponseCode).ToString().PadLeft(4, '0'), validationResult.Data.ResponseMessage); if (stateResult.IsFailed) return ResultHelpers.CreateFailure(stateResult); } @@ -150,16 +148,7 @@ public async Task> ProcessLogonTransacti return Result.Failure(ex.GetExceptionMessages()); } } - - public static string GenerateAuthCode() - { - // 8 hex characters == 4 random bytes - byte[] bytes = RandomNumberGenerator.GetBytes(4); // .NET 6+; for older frameworks use RandomNumberGenerator.Create().GetBytes(bytes) - // Convert to uppercase hex string (0-9, A-F). Convert.ToHexString returns uppercase. - string hex = Convert.ToHexString(bytes); - return hex.Substring(0, 8); - } - + public async Task> ProcessReconciliationTransaction(TransactionCommands.ProcessReconciliationCommand command, CancellationToken cancellationToken) { try{ @@ -219,7 +208,6 @@ public async Task> ProcessSaleTransaction CancellationToken cancellationToken) { try { - Result transactionResult = await DomainServiceHelper.GetAggregateOrFailure(ct => this.AggregateService.GetLatest(command.TransactionId, ct), command.TransactionId, cancellationToken, false); if (transactionResult.IsFailed) return ResultHelpers.CreateFailure(transactionResult); @@ -230,7 +218,7 @@ public async Task> ProcessSaleTransaction TransactionSource transactionSourceValue = (TransactionSource)command.TransactionSource; // Generate a transaction reference - String transactionReference = this.GenerateTransactionReference(); + String transactionReference = TransactionHelpers.GenerateTransactionReference(); // Extract the transaction amount from the metadata Decimal? transactionAmount = command.AdditionalTransactionMetadata.ExtractFieldFromMetadata("Amount"); @@ -379,16 +367,7 @@ public async Task ResendTransactionReceipt(TransactionCommands.ResendTra } } - internal static Boolean RequireFeeCalculation(TransactionAggregate transactionAggregate) { - return transactionAggregate switch { - _ when transactionAggregate.TransactionType == TransactionType.Logon => false, - _ when transactionAggregate.IsAuthorised == false => false, - _ when transactionAggregate.IsCompleted == false => false, - _ when transactionAggregate.ContractId == Guid.Empty => false, - _ when transactionAggregate.TransactionAmount == null => false, - _ => true - }; - } + public async Task CalculateFeesForTransaction(TransactionCommands.CalculateFeesForTransactionCommand command, CancellationToken cancellationToken) { @@ -400,7 +379,7 @@ public async Task CalculateFeesForTransaction(TransactionCommands.Calcul TransactionAggregate transactionAggregate = transactionResult.Data; - if (RequireFeeCalculation(transactionAggregate) == false) + if (TransactionHelpers.RequireFeeCalculation(transactionAggregate) == false) return Result.Success(); Result> feesForCalculationResult = await this.GetTransactionFeesForCalculation(transactionAggregate, cancellationToken); @@ -429,7 +408,7 @@ public async Task CalculateFeesForTransaction(TransactionCommands.Calcul foreach (CalculatedFee calculatedFee in merchantFees) { // Determine when the fee should be applied - DateTime settlementDate = CalculateSettlementDate(merchantResult.Data.SettlementSchedule, command.CompletedDateTime); + DateTime settlementDate = TransactionHelpers.CalculateSettlementDate(merchantResult.Data.SettlementSchedule, command.CompletedDateTime); Result stateResult = transactionAggregate.AddFeePendingSettlement(calculatedFee, settlementDate); if (stateResult.IsFailed) @@ -541,20 +520,7 @@ public async Task ResendCustomerEmailReceipt(TransactionCommands.ResendC return await this.ResendEmailMessage(this.TokenResponse.AccessToken, transactionAggregate.ReceiptMessageId, command.EstateId, cancellationToken); } - - internal static DateTime CalculateSettlementDate(Models.Merchant.SettlementSchedule merchantSettlementSchedule, - DateTime completeDateTime) { - if (merchantSettlementSchedule == Models.Merchant.SettlementSchedule.Weekly) { - return completeDateTime.Date.AddDays(7).Date; - } - - if (merchantSettlementSchedule == Models.Merchant.SettlementSchedule.Monthly) { - return completeDateTime.Date.AddMonths(1).Date; - } - - return completeDateTime.Date; - } - + private async Task>> GetTransactionFeesForCalculation(TransactionAggregate transactionAggregate, CancellationToken cancellationToken) { // Get the fees to be calculated @@ -591,15 +557,7 @@ private async Task AddDeviceToMerchant(Guid merchantId, return await this.AggregateService.Save(merchantAggregate.Data, cancellationToken); } - [ExcludeFromCodeCoverage] - private String GenerateTransactionReference() { - Int64 i = 1; - foreach (Byte b in Guid.NewGuid().ToByteArray()) { - i *= (b + 1); - } - - return $"{i - DateTime.Now.Ticks:x}"; - } + private async Task> GetMerchant(Guid merchantId, CancellationToken cancellationToken) { @@ -630,7 +588,7 @@ private async Task> ProcessMessageWithOperator(Models.M try { Result saleResult = await operatorProxy.ProcessSaleMessage(transactionId, operatorId, merchant, transactionDateTime, transactionReference, additionalTransactionMetadata, cancellationToken); if (saleResult.IsFailed) { - return CreateFailedResult(new OperatorResponse { IsSuccessful = false, ResponseCode = "9999", ResponseMessage = saleResult.Message }); + return ResultHelpers.CreateFailedResult(new OperatorResponse { IsSuccessful = false, ResponseCode = "9999", ResponseMessage = saleResult.Message }); } return saleResult; @@ -638,13 +596,13 @@ private async Task> ProcessMessageWithOperator(Models.M catch (Exception e) { // Log out the error Logger.LogError(e); - return CreateFailedResult(new OperatorResponse { IsSuccessful = false, ResponseCode = "9999", ResponseMessage = e.GetCombinedExceptionMessages() }); + return ResultHelpers.CreateFailedResult(new OperatorResponse { IsSuccessful = false, ResponseCode = "9999", ResponseMessage = e.GetCombinedExceptionMessages() }); } } - internal static Result CreateFailedResult(T resultData) { - return new Result { IsSuccess = false, Data = resultData }; - } + //internal static Result CreateFailedResult(T resultData) { + // return new Result { IsSuccess = false, Data = resultData }; + //} [ExcludeFromCodeCoverage] private async Task SendEmailMessage(String accessToken, @@ -693,7 +651,6 @@ private async Task ResendEmailMessage(String accessToken, return Result.Success("Duplicate message send"); } - } private async Task>> GetTransactionFeesForProduct(Guid contractId, diff --git a/TransactionProcessor.IntegrationTests/Features/Contract.feature.cs b/TransactionProcessor.IntegrationTests/Features/Contract.feature.cs index 0275dd5..bf5f5a0 100644 --- a/TransactionProcessor.IntegrationTests/Features/Contract.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/Contract.feature.cs @@ -188,13 +188,13 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) table7.AddRow(new string[] { "Test Estate 1", "Test Operator 1", - "True", - "True"}); + "False", + "False"}); table7.AddRow(new string[] { "Test Estate 2", "Test Operator 1", - "True", - "True"}); + "False", + "False"}); #line 31 await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table7, "Given "); #line hidden diff --git a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs index 1bf3de9..ce6e736 100644 --- a/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/LogonTransaction.feature.cs @@ -184,8 +184,8 @@ await testRunner.GivenAsync("I have a token to access the estate management and table49.AddRow(new string[] { "Test Estate 1", "Test Operator 1", - "True", - "True"}); + "False", + "False"}); #line 28 await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table49, "Given "); #line hidden diff --git a/TransactionProcessor.IntegrationTests/Features/Merchant.feature.cs b/TransactionProcessor.IntegrationTests/Features/Merchant.feature.cs index 4c8fe6d..cdb5b3a 100644 --- a/TransactionProcessor.IntegrationTests/Features/Merchant.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/Merchant.feature.cs @@ -190,13 +190,13 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo) table70.AddRow(new string[] { "Test Estate 1", "Test Operator 1", - "True", - "True"}); + "False", + "False"}); table70.AddRow(new string[] { "Test Estate 2", "Test Operator 1", - "True", - "True"}); + "False", + "False"}); #line 33 await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table70, "Given "); #line hidden diff --git a/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs b/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs index 5e22de0..543b1cb 100644 --- a/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/ReconciliationFeature.feature.cs @@ -186,13 +186,13 @@ await testRunner.GivenAsync("I have a token to access the estate management and table120.AddRow(new string[] { "Test Estate 1", "Safaricom", - "True", - "True"}); + "False", + "False"}); table120.AddRow(new string[] { "Test Estate 2", "Safaricom", - "True", - "True"}); + "False", + "False"}); #line 29 await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table120, "Given "); #line hidden diff --git a/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs b/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs index 462558c..44e575a 100644 --- a/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/RedeemVoucher.feature.cs @@ -186,8 +186,8 @@ await testRunner.GivenAsync("I have a token to access the estate management and table136.AddRow(new string[] { "Test Estate 1", "Voucher", - "True", - "True"}); + "False", + "False"}); #line 30 await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table136, "Given "); #line hidden diff --git a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs index 974f51f..1c781c1 100644 --- a/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/SaleTransactionFeature.feature.cs @@ -241,23 +241,23 @@ await testRunner.GivenAsync("I have a token to access the estate management and table154.AddRow(new string[] { "Test Estate 1", "Safaricom", - "True", - "True"}); + "False", + "False"}); table154.AddRow(new string[] { "Test Estate 1", "Voucher", - "True", - "True"}); + "False", + "False"}); table154.AddRow(new string[] { "Test Estate 1", "PataPawa PostPay", - "True", - "True"}); + "False", + "False"}); table154.AddRow(new string[] { "Test Estate 1", "PataPawa PrePay", - "True", - "True"}); + "False", + "False"}); #line 46 await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table154, "Given "); #line hidden diff --git a/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs b/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs index 5b3bc8c..05d9a17 100644 --- a/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/Settlement.feature.cs @@ -194,13 +194,13 @@ await testRunner.GivenAsync("I have a token to access the estate management and table191.AddRow(new string[] { "Test Estate 1", "Safaricom", - "True", - "True"}); + "False", + "False"}); table191.AddRow(new string[] { "Test Estate 1", "Voucher", - "True", - "True"}); + "False", + "False"}); #line 30 await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table191, "Given "); #line hidden diff --git a/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature.cs b/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature.cs index d4c89e7..f7d94c1 100644 --- a/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature.cs +++ b/TransactionProcessor.IntegrationTests/Features/SettlementReporting.feature.cs @@ -186,13 +186,13 @@ await testRunner.GivenAsync("I have a token to access the estate management and table218.AddRow(new string[] { "Test Estate 1", "Safaricom", - "True", - "True"}); + "False", + "False"}); table218.AddRow(new string[] { "Test Estate 2", "Safaricom", - "True", - "True"}); + "False", + "False"}); #line 29 await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table218, "Given "); #line hidden From 2e82e55fe82b238537d896676ee793cc33705201 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Wed, 8 Oct 2025 18:11:36 +0100 Subject: [PATCH 3/3] oops --- .../Services/TransactionDomainService.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs b/TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs index 511a729..cc4d1b8 100644 --- a/TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs +++ b/TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs @@ -599,10 +599,6 @@ private async Task> ProcessMessageWithOperator(Models.M return ResultHelpers.CreateFailedResult(new OperatorResponse { IsSuccessful = false, ResponseCode = "9999", ResponseMessage = e.GetCombinedExceptionMessages() }); } } - - //internal static Result CreateFailedResult(T resultData) { - // return new Result { IsSuccess = false, Data = resultData }; - //} [ExcludeFromCodeCoverage] private async Task SendEmailMessage(String accessToken,