From 354fc37de6ffcc6c58339f5b30d9176b0f53323f Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Wed, 22 Apr 2020 17:02:11 +0100 Subject: [PATCH] Allow Mobile App to provide customer email address --- .../RequestHandlerTests.cs | 1 + .../RequestTests.cs | 4 +- ...ionProcessorACL.BusinessLogic.Tests.csproj | 4 +- ...tionProcessorACLApplicationServiceTests.cs | 2 + .../ProcessLogonTransactionRequestHandler.cs | 51 ---------------- .../ProcessSaleTransactionRequestHandler.cs | 61 +++++++++++++++++++ .../Requests/ProcessSaleTransactionRequest.cs | 20 +++++- ...ansactionProcessorACLApplicationService.cs | 2 + ...ansactionProcessorACLApplicationService.cs | 3 + ...ansactionProcessorACL.BusinessLogic.csproj | 2 +- .../Requests/SaleTransactionRequestMessage.cs | 8 +++ .../SaleTransaction/SalesTransaction.feature | 14 +++-- .../SalesTransaction.feature.cs | 48 +++++++++++---- .../Shared/SharedSteps.cs | 7 ++- ...actionProcessorACL.IntegrationTests.csproj | 16 ++--- TransactionProcessorACL.Testing/TestData.cs | 5 +- .../TransactionProcessorACL.Tests.csproj | 4 +- .../Controllers/TransactionController.cs | 3 +- .../TransactionProcessorACL.csproj | 16 ++--- 19 files changed, 173 insertions(+), 98 deletions(-) create mode 100644 TransactionProcessorACL.BusinessLogic/RequestHandlers/ProcessSaleTransactionRequestHandler.cs diff --git a/TransactionProcessorACL.BusinessLogic.Tests/RequestHandlerTests.cs b/TransactionProcessorACL.BusinessLogic.Tests/RequestHandlerTests.cs index 55eca23..f5acd8c 100644 --- a/TransactionProcessorACL.BusinessLogic.Tests/RequestHandlerTests.cs +++ b/TransactionProcessorACL.BusinessLogic.Tests/RequestHandlerTests.cs @@ -56,6 +56,7 @@ public async Task ProcessSaleTransactionRequestHandler_Handle_RequestIsHandled() It.IsAny(), It.IsAny(), It.IsAny(), + It.IsAny(), It.IsAny())).ReturnsAsync(TestData.ProcessSaleTransactionResponse); ProcessSaleTransactionRequestHandler requestHandler = new ProcessSaleTransactionRequestHandler(applicationService.Object); diff --git a/TransactionProcessorACL.BusinessLogic.Tests/RequestTests.cs b/TransactionProcessorACL.BusinessLogic.Tests/RequestTests.cs index 87b46dd..dcefcea 100644 --- a/TransactionProcessorACL.BusinessLogic.Tests/RequestTests.cs +++ b/TransactionProcessorACL.BusinessLogic.Tests/RequestTests.cs @@ -43,7 +43,8 @@ public void ProcessSaleTransactionRequest_CanBeCreated_IsCreated() TestData.DeviceIdentifier, TestData.OperatorIdentifier, TestData.SaleAmount, - TestData.CustomerAccountNumber); + TestData.CustomerAccountNumber, + TestData.CustomerEmailAddress); request.EstateId.ShouldBe(TestData.EstateId); request.MerchantId.ShouldBe(TestData.MerchantId); @@ -53,6 +54,7 @@ public void ProcessSaleTransactionRequest_CanBeCreated_IsCreated() request.OperatorIdentifier.ShouldBe(TestData.OperatorIdentifier); request.Amount.ShouldBe(TestData.SaleAmount); request.CustomerAccountNumber.ShouldBe(TestData.CustomerAccountNumber); + request.CustomerEmailAddress.ShouldBe(TestData.CustomerEmailAddress); } #endregion diff --git a/TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACL.BusinessLogic.Tests.csproj b/TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACL.BusinessLogic.Tests.csproj index 1e644d9..d7c48a5 100644 --- a/TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACL.BusinessLogic.Tests.csproj +++ b/TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACL.BusinessLogic.Tests.csproj @@ -7,7 +7,7 @@ - + @@ -15,7 +15,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACLApplicationServiceTests.cs b/TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACLApplicationServiceTests.cs index 27c4e8b..237fe54 100644 --- a/TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACLApplicationServiceTests.cs +++ b/TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACLApplicationServiceTests.cs @@ -113,6 +113,7 @@ public async Task TransactionProcessorACLApplicationService_ProcessSaleTransacti TestData.OperatorIdentifier, TestData.SaleAmount, TestData.CustomerAccountNumber, + TestData.CustomerEmailAddress, CancellationToken.None); saleResponse.ShouldNotBeNull(); @@ -143,6 +144,7 @@ public async Task TransactionProcessorACLApplicationService_ProcessSaleTransacti TestData.OperatorIdentifier, TestData.SaleAmount, TestData.CustomerAccountNumber, + TestData.CustomerEmailAddress, CancellationToken.None); saleResponse.ShouldNotBeNull(); diff --git a/TransactionProcessorACL.BusinessLogic/RequestHandlers/ProcessLogonTransactionRequestHandler.cs b/TransactionProcessorACL.BusinessLogic/RequestHandlers/ProcessLogonTransactionRequestHandler.cs index f1fb984..ea3b927 100644 --- a/TransactionProcessorACL.BusinessLogic/RequestHandlers/ProcessLogonTransactionRequestHandler.cs +++ b/TransactionProcessorACL.BusinessLogic/RequestHandlers/ProcessLogonTransactionRequestHandler.cs @@ -59,55 +59,4 @@ public async Task Handle(ProcessLogonTransactio #endregion } - - public class ProcessSaleTransactionRequestHandler : IRequestHandler - { - #region Fields - - /// - /// The application service - /// - private readonly ITransactionProcessorACLApplicationService ApplicationService; - - #endregion - - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - /// The application service. - public ProcessSaleTransactionRequestHandler(ITransactionProcessorACLApplicationService applicationService) - { - this.ApplicationService = applicationService; - } - - #endregion - - #region Methods - - /// - /// Handles the specified request. - /// - /// The request. - /// The cancellation token. - /// - /// Response from the request - /// - public async Task Handle(ProcessSaleTransactionRequest request, - CancellationToken cancellationToken) - { - return await this.ApplicationService.ProcessSaleTransaction(request.EstateId, - request.MerchantId, - request.TransactionDateTime, - request.TransactionNumber, - request.DeviceIdentifier, - request.OperatorIdentifier, - request.Amount, - request.CustomerAccountNumber, - cancellationToken); - } - - #endregion - } } \ No newline at end of file diff --git a/TransactionProcessorACL.BusinessLogic/RequestHandlers/ProcessSaleTransactionRequestHandler.cs b/TransactionProcessorACL.BusinessLogic/RequestHandlers/ProcessSaleTransactionRequestHandler.cs new file mode 100644 index 0000000..d9ea076 --- /dev/null +++ b/TransactionProcessorACL.BusinessLogic/RequestHandlers/ProcessSaleTransactionRequestHandler.cs @@ -0,0 +1,61 @@ +namespace TransactionProcessorACL.BusinessLogic.RequestHandlers +{ + using System.Threading; + using System.Threading.Tasks; + using MediatR; + using Models; + using Requests; + using Services; + + public class ProcessSaleTransactionRequestHandler : IRequestHandler + { + #region Fields + + /// + /// The application service + /// + private readonly ITransactionProcessorACLApplicationService ApplicationService; + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// The application service. + public ProcessSaleTransactionRequestHandler(ITransactionProcessorACLApplicationService applicationService) + { + this.ApplicationService = applicationService; + } + + #endregion + + #region Methods + + /// + /// Handles the specified request. + /// + /// The request. + /// The cancellation token. + /// + /// Response from the request + /// + public async Task Handle(ProcessSaleTransactionRequest request, + CancellationToken cancellationToken) + { + return await this.ApplicationService.ProcessSaleTransaction(request.EstateId, + request.MerchantId, + request.TransactionDateTime, + request.TransactionNumber, + request.DeviceIdentifier, + request.OperatorIdentifier, + request.Amount, + request.CustomerAccountNumber, + request.CustomerEmailAddress, + cancellationToken); + } + + #endregion + } +} \ No newline at end of file diff --git a/TransactionProcessorACL.BusinessLogic/Requests/ProcessSaleTransactionRequest.cs b/TransactionProcessorACL.BusinessLogic/Requests/ProcessSaleTransactionRequest.cs index 3792ca5..1924eb1 100644 --- a/TransactionProcessorACL.BusinessLogic/Requests/ProcessSaleTransactionRequest.cs +++ b/TransactionProcessorACL.BusinessLogic/Requests/ProcessSaleTransactionRequest.cs @@ -19,6 +19,7 @@ public class ProcessSaleTransactionRequest : IRequestThe operator identifier. /// The amount. /// The customer account number. + /// The customer email address. private ProcessSaleTransactionRequest(Guid estateId, Guid merchantId, DateTime transactionDateTime, @@ -26,7 +27,8 @@ private ProcessSaleTransactionRequest(Guid estateId, String deviceIdentifier, String operatorIdentifier, Decimal amount, - String customerAccountNumber) + String customerAccountNumber, + String customerEmailAddress) { this.EstateId = estateId; this.MerchantId = merchantId; @@ -34,6 +36,7 @@ private ProcessSaleTransactionRequest(Guid estateId, this.OperatorIdentifier = operatorIdentifier; this.Amount = amount; this.CustomerAccountNumber = customerAccountNumber; + this.CustomerEmailAddress = customerEmailAddress; this.TransactionDateTime = transactionDateTime; this.TransactionNumber = transactionNumber; } @@ -58,6 +61,14 @@ private ProcessSaleTransactionRequest(Guid estateId, /// public String CustomerAccountNumber { get; } + /// + /// Gets the customer email address. + /// + /// + /// The customer email address. + /// + public String CustomerEmailAddress { get; private set; } + /// /// Gets the device identifier. /// @@ -121,6 +132,7 @@ private ProcessSaleTransactionRequest(Guid estateId, /// The operator identifier. /// The amount. /// The customer account number. + /// The customer email address. /// public static ProcessSaleTransactionRequest Create(Guid estateId, Guid merchantId, @@ -129,7 +141,8 @@ public static ProcessSaleTransactionRequest Create(Guid estateId, String deviceIdentifier, String operatorIdentifier, Decimal amount, - String customerAccountNumber) + String customerAccountNumber, + String customerEmailAddress) { return new ProcessSaleTransactionRequest(estateId, merchantId, @@ -138,7 +151,8 @@ public static ProcessSaleTransactionRequest Create(Guid estateId, deviceIdentifier, operatorIdentifier, amount, - customerAccountNumber); + customerAccountNumber, + customerEmailAddress); } #endregion diff --git a/TransactionProcessorACL.BusinessLogic/Services/ITransactionProcessorACLApplicationService.cs b/TransactionProcessorACL.BusinessLogic/Services/ITransactionProcessorACLApplicationService.cs index ba56336..49eb33e 100644 --- a/TransactionProcessorACL.BusinessLogic/Services/ITransactionProcessorACLApplicationService.cs +++ b/TransactionProcessorACL.BusinessLogic/Services/ITransactionProcessorACLApplicationService.cs @@ -39,6 +39,7 @@ Task ProcessLogonTransaction(Guid estateId, /// The operator identifier. /// The amount. /// The customer account number. + /// The customer email address. /// The cancellation token. /// Task ProcessSaleTransaction(Guid estateId, @@ -49,6 +50,7 @@ Task ProcessSaleTransaction(Guid estateId, String operatorIdentifier, Decimal amount, String customerAccountNumber, + String customerEmailAddress, CancellationToken cancellationToken); } } diff --git a/TransactionProcessorACL.BusinessLogic/Services/TransactionProcessorACLApplicationService.cs b/TransactionProcessorACL.BusinessLogic/Services/TransactionProcessorACLApplicationService.cs index 5650715..6376179 100644 --- a/TransactionProcessorACL.BusinessLogic/Services/TransactionProcessorACLApplicationService.cs +++ b/TransactionProcessorACL.BusinessLogic/Services/TransactionProcessorACLApplicationService.cs @@ -130,6 +130,7 @@ public async Task ProcessLogonTransaction(Guid /// The operator identifier. /// The amount. /// The customer account number. + /// The customer email address. /// The cancellation token. /// public async Task ProcessSaleTransaction(Guid estateId, @@ -140,6 +141,7 @@ public async Task ProcessSaleTransaction(Guid es String operatorIdentifier, Decimal amount, String customerAccountNumber, + String customerEmailAddress, CancellationToken cancellationToken) { // Get a client token to call the Transaction Processor @@ -154,6 +156,7 @@ public async Task ProcessSaleTransaction(Guid es saleTransactionRequest.TransactionDateTime = transactionDateTime; saleTransactionRequest.TransactionType = "SALE"; saleTransactionRequest.OperatorIdentifier = operatorIdentifier; + saleTransactionRequest.CustomerEmailAddress = customerEmailAddress; // Build up the metadata saleTransactionRequest.AdditionalTransactionMetadata = new Dictionary(); diff --git a/TransactionProcessorACL.BusinessLogic/TransactionProcessorACL.BusinessLogic.csproj b/TransactionProcessorACL.BusinessLogic/TransactionProcessorACL.BusinessLogic.csproj index f166f1a..956dbd3 100644 --- a/TransactionProcessorACL.BusinessLogic/TransactionProcessorACL.BusinessLogic.csproj +++ b/TransactionProcessorACL.BusinessLogic/TransactionProcessorACL.BusinessLogic.csproj @@ -8,7 +8,7 @@ - + diff --git a/TransactionProcessorACL.DataTransferObjects/Requests/SaleTransactionRequestMessage.cs b/TransactionProcessorACL.DataTransferObjects/Requests/SaleTransactionRequestMessage.cs index 4c1351b..1981d2e 100644 --- a/TransactionProcessorACL.DataTransferObjects/Requests/SaleTransactionRequestMessage.cs +++ b/TransactionProcessorACL.DataTransferObjects/Requests/SaleTransactionRequestMessage.cs @@ -36,6 +36,14 @@ public class SaleTransactionRequestMessage : TransactionRequestMessage /// public String OperatorIdentifier { get; set; } + /// + /// Gets or sets the customer email address. + /// + /// + /// The customer email address. + /// + public String CustomerEmailAddress { get; set; } + #endregion } } \ No newline at end of file diff --git a/TransactionProcessorACL.IntegrationTests/SaleTransaction/SalesTransaction.feature b/TransactionProcessorACL.IntegrationTests/SaleTransaction/SalesTransaction.feature index ee793bf..22fd875 100644 --- a/TransactionProcessorACL.IntegrationTests/SaleTransaction/SalesTransaction.feature +++ b/TransactionProcessorACL.IntegrationTests/SaleTransaction/SalesTransaction.feature @@ -60,21 +60,23 @@ Background: Scenario: Sale Transaction Given I am logged in as "merchantuser@testmerchant1.co.uk" with password "123456" for Merchant "Test Merchant 1" for Estate "Test Estate 1" with client "merchantClient" When I perform the following transactions - | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | - | Today | 1 | Sale | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 1000.00 | 123456789 | + | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | + | Today | 1 | Sale | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 1000.00 | 123456789 | | + | Today | 4 | Sale | Test Merchant 1 | 123456780 | Test Estate 1 | Safaricom | 1000.00 | 123456789 | testcustomer@customer.co.uk | Given I am logged in as "merchantuser@testmerchant2.co.uk" with password "123456" for Merchant "Test Merchant 2" for Estate "Test Estate 1" with client "merchantClient" When I perform the following transactions - | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | - | Today | 2 | Sale | Test Merchant 2 | 123456781 | Test Estate 1 | Safaricom | 1000.00 | 123456789 | + | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | + | Today | 2 | Sale | Test Merchant 2 | 123456781 | Test Estate 1 | Safaricom | 1000.00 | 123456789 | | Given I am logged in as "merchantuser@testmerchant3.co.uk" with password "123456" for Merchant "Test Merchant 3" for Estate "Test Estate 2" with client "merchantClient" When I perform the following transactions - | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | - | Today | 3 | Sale | Test Merchant 3 | 123456782 | Test Estate 2 | Safaricom | 1000.00 | 123456789 | + | DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | + | Today | 3 | Sale | Test Merchant 3 | 123456782 | Test Estate 2 | Safaricom | 1000.00 | 123456789 | | Then transaction response should contain the following information | EstateName | MerchantName | TransactionNumber | TransactionType | ResponseCode | ResponseMessage | | Test Estate 1 | Test Merchant 1 | 1 | Sale | 0000 | SUCCESS | | Test Estate 1 | Test Merchant 2 | 2 | Sale | 0000 | SUCCESS | | Test Estate 2 | Test Merchant 3 | 3 | Sale | 0000 | SUCCESS | + | Test Estate 1 | Test Merchant 1 | 4 | Sale | 0000 | SUCCESS | diff --git a/TransactionProcessorACL.IntegrationTests/SaleTransaction/SalesTransaction.feature.cs b/TransactionProcessorACL.IntegrationTests/SaleTransaction/SalesTransaction.feature.cs index d1c7e43..1562959 100644 --- a/TransactionProcessorACL.IntegrationTests/SaleTransaction/SalesTransaction.feature.cs +++ b/TransactionProcessorACL.IntegrationTests/SaleTransaction/SalesTransaction.feature.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (http://www.specflow.org/). // SpecFlow Version:3.1.0.0 @@ -345,7 +345,8 @@ public virtual void SaleTransaction() "EstateName", "OperatorName", "TransactionAmount", - "CustomerAccountNumber"}); + "CustomerAccountNumber", + "CustomerEmailAddress"}); table24.AddRow(new string[] { "Today", "1", @@ -355,11 +356,23 @@ public virtual void SaleTransaction() "Test Estate 1", "Safaricom", "1000.00", - "123456789"}); + "123456789", + ""}); + table24.AddRow(new string[] { + "Today", + "4", + "Sale", + "Test Merchant 1", + "123456780", + "Test Estate 1", + "Safaricom", + "1000.00", + "123456789", + "testcustomer@customer.co.uk"}); #line 62 testRunner.When("I perform the following transactions", ((string)(null)), table24, "When "); #line hidden -#line 66 +#line 67 testRunner.Given("I am logged in as \"merchantuser@testmerchant2.co.uk\" with password \"123456\" for M" + "erchant \"Test Merchant 2\" for Estate \"Test Estate 1\" with client \"merchantClient" + "\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); @@ -373,7 +386,8 @@ public virtual void SaleTransaction() "EstateName", "OperatorName", "TransactionAmount", - "CustomerAccountNumber"}); + "CustomerAccountNumber", + "CustomerEmailAddress"}); table25.AddRow(new string[] { "Today", "2", @@ -383,11 +397,12 @@ public virtual void SaleTransaction() "Test Estate 1", "Safaricom", "1000.00", - "123456789"}); -#line 67 + "123456789", + ""}); +#line 68 testRunner.When("I perform the following transactions", ((string)(null)), table25, "When "); #line hidden -#line 71 +#line 72 testRunner.Given("I am logged in as \"merchantuser@testmerchant3.co.uk\" with password \"123456\" for M" + "erchant \"Test Merchant 3\" for Estate \"Test Estate 2\" with client \"merchantClient" + "\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); @@ -401,7 +416,8 @@ public virtual void SaleTransaction() "EstateName", "OperatorName", "TransactionAmount", - "CustomerAccountNumber"}); + "CustomerAccountNumber", + "CustomerEmailAddress"}); table26.AddRow(new string[] { "Today", "3", @@ -411,8 +427,9 @@ public virtual void SaleTransaction() "Test Estate 2", "Safaricom", "1000.00", - "123456789"}); -#line 72 + "123456789", + ""}); +#line 73 testRunner.When("I perform the following transactions", ((string)(null)), table26, "When "); #line hidden TechTalk.SpecFlow.Table table27 = new TechTalk.SpecFlow.Table(new string[] { @@ -443,7 +460,14 @@ public virtual void SaleTransaction() "Sale", "0000", "SUCCESS"}); -#line 76 + table27.AddRow(new string[] { + "Test Estate 1", + "Test Merchant 1", + "4", + "Sale", + "0000", + "SUCCESS"}); +#line 77 testRunner.Then("transaction response should contain the following information", ((string)(null)), table27, "Then "); #line hidden } diff --git a/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs b/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs index 0ab2742..0de6329 100644 --- a/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs +++ b/TransactionProcessorACL.IntegrationTests/Shared/SharedSteps.cs @@ -328,6 +328,7 @@ public async Task WhenIPerformTheFollowingTransactions(Table table) String operatorIdentifier = SpecflowTableHelper.GetStringRowValue(tableRow, "OperatorName"); Decimal transactionAmount = SpecflowTableHelper.GetDecimalValue(tableRow, "TransactionAmount"); String customerAccountNumber = SpecflowTableHelper.GetStringRowValue(tableRow, "CustomerAccountNumber"); + String customerEmailAddress = SpecflowTableHelper.GetStringRowValue(tableRow, "CustomerEmailAddress"); responseMessage = await this.PerformSaleTransaction(merchantToken, transactionDateTime, @@ -337,6 +338,7 @@ public async Task WhenIPerformTheFollowingTransactions(Table table) operatorIdentifier, transactionAmount, customerAccountNumber, + customerEmailAddress, CancellationToken.None); break; @@ -480,7 +482,7 @@ private async Task PerformLogonTransaction(String merchantToken, DateTim return responseContent; } - private async Task PerformSaleTransaction(String merchantToken, DateTime transactionDateTime, String transactionType, String transactionNumber, String deviceIdentifier, String operatorIdentifier, Decimal transactionAmount, String customerAccountNumber, CancellationToken cancellationToken) + private async Task PerformSaleTransaction(String merchantToken, DateTime transactionDateTime, String transactionType, String transactionNumber, String deviceIdentifier, String operatorIdentifier, Decimal transactionAmount, String customerAccountNumber, String customerEmailAddress, CancellationToken cancellationToken) { SaleTransactionRequestMessage saleTransactionRequestMessage = new SaleTransactionRequestMessage { @@ -489,7 +491,8 @@ private async Task PerformSaleTransaction(String merchantToken, DateTime TransactionNumber = transactionNumber, OperatorIdentifier = operatorIdentifier, Amount = transactionAmount, - CustomerAccountNumber = customerAccountNumber + CustomerAccountNumber = customerAccountNumber, + CustomerEmailAddress = customerEmailAddress }; String uri = "api/transactions"; diff --git a/TransactionProcessorACL.IntegrationTests/TransactionProcessorACL.IntegrationTests.csproj b/TransactionProcessorACL.IntegrationTests/TransactionProcessorACL.IntegrationTests.csproj index d71be2f..9b00991 100644 --- a/TransactionProcessorACL.IntegrationTests/TransactionProcessorACL.IntegrationTests.csproj +++ b/TransactionProcessorACL.IntegrationTests/TransactionProcessorACL.IntegrationTests.csproj @@ -9,23 +9,23 @@ - - + + - + - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TransactionProcessorACL.Testing/TestData.cs b/TransactionProcessorACL.Testing/TestData.cs index a1edc0d..a955ef9 100644 --- a/TransactionProcessorACL.Testing/TestData.cs +++ b/TransactionProcessorACL.Testing/TestData.cs @@ -111,6 +111,8 @@ public class TestData public static String CustomerAccountNumber = "123456789"; + public static String CustomerEmailAddress = "testcustomer@customer.co.uk"; + public static ProcessSaleTransactionRequest ProcessSaleTransactionRequest = ProcessSaleTransactionRequest.Create(TestData.EstateId, TestData.MerchantId, TestData.TransactionDateTime, @@ -118,6 +120,7 @@ public class TestData TestData.DeviceIdentifier, TestData.OperatorIdentifier, TestData.SaleAmount, - TestData.CustomerAccountNumber); + TestData.CustomerAccountNumber, + TestData.CustomerEmailAddress); } } \ No newline at end of file diff --git a/TransactionProcessorACL.Tests/TransactionProcessorACL.Tests.csproj b/TransactionProcessorACL.Tests/TransactionProcessorACL.Tests.csproj index 1b4e7c1..92a226b 100644 --- a/TransactionProcessorACL.Tests/TransactionProcessorACL.Tests.csproj +++ b/TransactionProcessorACL.Tests/TransactionProcessorACL.Tests.csproj @@ -8,7 +8,7 @@ - + @@ -16,7 +16,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TransactionProcessorACL/Controllers/TransactionController.cs b/TransactionProcessorACL/Controllers/TransactionController.cs index 500ed85..885a82c 100644 --- a/TransactionProcessorACL/Controllers/TransactionController.cs +++ b/TransactionProcessorACL/Controllers/TransactionController.cs @@ -116,7 +116,8 @@ private ProcessSaleTransactionRequest CreateCommandFromRequest(SaleTransactionRe saleTransactionRequestMessage.DeviceIdentifier, saleTransactionRequestMessage.OperatorIdentifier, saleTransactionRequestMessage.Amount, - saleTransactionRequestMessage.CustomerAccountNumber); + saleTransactionRequestMessage.CustomerAccountNumber, + saleTransactionRequestMessage.CustomerEmailAddress); return request; } diff --git a/TransactionProcessorACL/TransactionProcessorACL.csproj b/TransactionProcessorACL/TransactionProcessorACL.csproj index 3f0df4d..ed81e09 100644 --- a/TransactionProcessorACL/TransactionProcessorACL.csproj +++ b/TransactionProcessorACL/TransactionProcessorACL.csproj @@ -12,16 +12,16 @@ - - + + - - - - - - + + + + + +