Skip to content

Commit 34f54f7

Browse files
Merge pull request #84 from TransactionProcessing/task/#81_swaggerreview
Swagger review
2 parents 0a01fa9 + 4d3496d commit 34f54f7

29 files changed

+977
-227
lines changed

TransactionProcessorACL.BusinessLogic.Tests/RequestTests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@ public void ProcessLogonTransactionRequest_CanBeCreated_IsCreated()
2222
TestData.MerchantId,
2323
TestData.TransactionDateTime,
2424
TestData.TransactionNumber,
25-
TestData.DeviceIdentifier,
26-
TestData.RequireConfigurationInResponseTrue);
25+
TestData.DeviceIdentifier);
2726

2827
request.EstateId.ShouldBe(TestData.EstateId);
2928
request.MerchantId.ShouldBe(TestData.MerchantId);
3029
request.TransactionDateTime.ShouldBe(TestData.TransactionDateTime);
3130
request.TransactionNumber.ShouldBe(TestData.TransactionNumber);
3231
request.DeviceIdentifier.ShouldBe(TestData.DeviceIdentifier);
33-
request.RequireConfigurationInResponse.ShouldBe(TestData.RequireConfigurationInResponseTrue);
3432
}
3533

3634
[Fact]

TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACL.BusinessLogic.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net5.0</TargetFramework>
5-
<DebugType>None</DebugType>
5+
<DebugType>Full</DebugType>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

TransactionProcessorACL.BusinessLogic.Tests/TransactionProcessorACLApplicationServiceTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public async Task TransactionProcessorACLApplicationService_ProcessLogonTransact
4040
{
4141
Mock<ITransactionProcessorClient> transactionProcessorClient = new Mock<ITransactionProcessorClient>();
4242
transactionProcessorClient.Setup(t => t.PerformTransaction(It.IsAny<String>(), It.IsAny<SerialisedMessage>(), It.IsAny<CancellationToken>()))
43-
.ReturnsAsync(TestData.SerialisedMessageResponse);
43+
.ReturnsAsync(TestData.SerialisedMessageResponseLogon);
4444
Mock<ISecurityServiceClient> securityServiceClient = new Mock<ISecurityServiceClient>();
4545
securityServiceClient.Setup(s => s.GetToken(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<CancellationToken>())).ReturnsAsync(TestData.TokenResponse);
4646

@@ -136,7 +136,7 @@ public async Task TransactionProcessorACLApplicationService_ProcessSaleTransacti
136136
{
137137
Mock<ITransactionProcessorClient> transactionProcessorClient = new Mock<ITransactionProcessorClient>();
138138
transactionProcessorClient.Setup(t => t.PerformTransaction(It.IsAny<String>(), It.IsAny<SerialisedMessage>(), It.IsAny<CancellationToken>()))
139-
.ReturnsAsync(TestData.SerialisedMessageResponse);
139+
.ReturnsAsync(TestData.SerialisedMessageResponseSale);
140140
Mock<ISecurityServiceClient> securityServiceClient = new Mock<ISecurityServiceClient>();
141141
securityServiceClient.Setup(s => s.GetToken(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<CancellationToken>())).ReturnsAsync(TestData.TokenResponse);
142142

@@ -252,7 +252,7 @@ public async Task TransactionProcessorACLApplicationService_ProcessReconciliatio
252252
{
253253
Mock<ITransactionProcessorClient> transactionProcessorClient = new Mock<ITransactionProcessorClient>();
254254
transactionProcessorClient.Setup(t => t.PerformTransaction(It.IsAny<String>(), It.IsAny<SerialisedMessage>(), It.IsAny<CancellationToken>()))
255-
.ReturnsAsync(TestData.SerialisedMessageResponse);
255+
.ReturnsAsync(TestData.SerialisedMessageResponseReconciliation);
256256
Mock<ISecurityServiceClient> securityServiceClient = new Mock<ISecurityServiceClient>();
257257
securityServiceClient.Setup(s => s.GetToken(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<CancellationToken>())).ReturnsAsync(TestData.TokenResponse);
258258

TransactionProcessorACL.BusinessLogic/Requests/ProcessLogonTransactionRequest.cs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@ private ProcessLogonTransactionRequest(Guid estateId,
3232
Guid merchantId,
3333
DateTime transactionDateTime,
3434
String transactionNumber,
35-
String deviceIdentifier,
36-
Boolean requireConfigurationInResponse)
35+
String deviceIdentifier)
3736
{
3837
this.EstateId = estateId;
3938
this.MerchantId = merchantId;
4039
this.DeviceIdentifier = deviceIdentifier;
41-
this.RequireConfigurationInResponse = requireConfigurationInResponse;
4240
this.TransactionDateTime = transactionDateTime;
4341
this.TransactionNumber = transactionNumber;
4442
}
@@ -71,14 +69,6 @@ private ProcessLogonTransactionRequest(Guid estateId,
7169
/// </value>
7270
public Guid MerchantId { get; }
7371

74-
/// <summary>
75-
/// Gets a value indicating whether [require configuration in response].
76-
/// </summary>
77-
/// <value>
78-
/// <c>true</c> if [require configuration in response]; otherwise, <c>false</c>.
79-
/// </value>
80-
public Boolean RequireConfigurationInResponse { get; }
81-
8272
/// <summary>
8373
/// Gets the transaction date time.
8474
/// </summary>
@@ -107,16 +97,14 @@ private ProcessLogonTransactionRequest(Guid estateId,
10797
/// <param name="transactionDateTime">The transaction date time.</param>
10898
/// <param name="transactionNumber">The transaction number.</param>
10999
/// <param name="deviceIdentifier">The device identifier.</param>
110-
/// <param name="requireConfigurationInResponse">if set to <c>true</c> [require configuration in response].</param>
111100
/// <returns></returns>
112101
public static ProcessLogonTransactionRequest Create(Guid estateId,
113102
Guid merchantId,
114103
DateTime transactionDateTime,
115104
String transactionNumber,
116-
String deviceIdentifier,
117-
Boolean requireConfigurationInResponse)
105+
String deviceIdentifier)
118106
{
119-
return new ProcessLogonTransactionRequest(estateId, merchantId, transactionDateTime, transactionNumber, deviceIdentifier, requireConfigurationInResponse);
107+
return new ProcessLogonTransactionRequest(estateId, merchantId, transactionDateTime, transactionNumber, deviceIdentifier);
120108
}
121109

122110
#endregion

TransactionProcessorACL.BusinessLogic/TransactionProcessorACL.BusinessLogic.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<PackageReference Include="MediatR" Version="9.0.0" />
99
<PackageReference Include="SecurityService.Client" Version="1.0.5" />
1010
<PackageReference Include="Shared" Version="1.0.5" />
11-
<PackageReference Include="TransactionProcessor.Client" Version="1.0.11" />
11+
<PackageReference Include="TransactionProcessor.Client" Version="1.0.11.1" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

TransactionProcessorACL.DataTransferObjects/Requests/LogonTransactionRequestMessage.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{
33
using System;
44
using System.Diagnostics.CodeAnalysis;
5+
using Newtonsoft.Json;
56

67
/// <summary>
78
///
@@ -10,16 +11,6 @@
1011
[ExcludeFromCodeCoverage]
1112
public class LogonTransactionRequestMessage : TransactionRequestMessage
1213
{
13-
#region Properties
1414

15-
/// <summary>
16-
/// Gets or sets a value indicating whether [require configuration in response].
17-
/// </summary>
18-
/// <value>
19-
/// <c>true</c> if [require configuration in response]; otherwise, <c>false</c>.
20-
/// </value>
21-
public Boolean RequireConfigurationInResponse { get; set; }
22-
23-
#endregion
2415
}
2516
}

TransactionProcessorACL.DataTransferObjects/Requests/OperatorTotalRequest.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{
33
using System;
44
using System.Diagnostics.CodeAnalysis;
5+
using Newtonsoft.Json;
56

67
[ExcludeFromCodeCoverage]
78
public class OperatorTotalRequest
@@ -14,6 +15,7 @@ public class OperatorTotalRequest
1415
/// <value>
1516
/// The contract identifier.
1617
/// </value>
18+
[JsonProperty("contract_id")]
1719
public Guid ContractId { get; set; }
1820

1921
/// <summary>
@@ -22,6 +24,7 @@ public class OperatorTotalRequest
2224
/// <value>
2325
/// The operator identifier.
2426
/// </value>
27+
[JsonProperty("operator_identifier")]
2528
public String OperatorIdentifier { get; set; }
2629

2730
/// <summary>
@@ -30,6 +33,7 @@ public class OperatorTotalRequest
3033
/// <value>
3134
/// The transaction count.
3235
/// </value>
36+
[JsonProperty("transaction_count")]
3337
public Int32 TransactionCount { get; set; }
3438

3539
/// <summary>
@@ -38,6 +42,7 @@ public class OperatorTotalRequest
3842
/// <value>
3943
/// The transaction value.
4044
/// </value>
45+
[JsonProperty("transaction_value")]
4146
public Decimal TransactionValue { get; set; }
4247

4348
#endregion

TransactionProcessorACL.DataTransferObjects/Requests/ReconciliationRequestMessage.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System;
44
using System.Collections.Generic;
55
using System.Diagnostics.CodeAnalysis;
6+
using Newtonsoft.Json;
67

78
[ExcludeFromCodeCoverage]
89
public class ReconciliationRequestMessage : TransactionRequestMessage
@@ -13,6 +14,7 @@ public class ReconciliationRequestMessage : TransactionRequestMessage
1314
/// <value>
1415
/// The operator totals.
1516
/// </value>
17+
[JsonProperty("operator_totals")]
1618
public List<OperatorTotalRequest> OperatorTotals { get; set; }
1719

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

2629
/// <summary>
@@ -29,6 +32,7 @@ public class ReconciliationRequestMessage : TransactionRequestMessage
2932
/// <value>
3033
/// The transaction value.
3134
/// </value>
35+
[JsonProperty("transaction_value")]
3236
public Decimal TransactionValue { get; set; }
3337
}
3438
}

TransactionProcessorACL.DataTransferObjects/Requests/SaleTransactionRequestMessage.cs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{
33
using System;
44
using System.Diagnostics.CodeAnalysis;
5+
using Newtonsoft.Json;
56

67
/// <summary>
78
///
@@ -11,37 +12,41 @@
1112
public class SaleTransactionRequestMessage : TransactionRequestMessage
1213
{
1314
#region Properties
14-
15+
1516
/// <summary>
1617
/// Gets or sets the contract identifier.
1718
/// </summary>
1819
/// <value>
1920
/// The contract identifier.
2021
/// </value>
22+
[JsonProperty("contract_id")]
2123
public Guid ContractId { get; set; }
22-
24+
2325
/// <summary>
24-
/// Gets or sets the customer email address.
26+
/// Gets or sets the operator identifier.
2527
/// </summary>
2628
/// <value>
27-
/// The customer email address.
29+
/// The operator identifier.
2830
/// </value>
29-
public String CustomerEmailAddress { get; set; }
31+
[JsonProperty("operator_identifier")]
32+
public String OperatorIdentifier { get; set; }
3033

3134
/// <summary>
32-
/// Gets or sets the operator identifier.
35+
/// Gets or sets the customer email address.
3336
/// </summary>
3437
/// <value>
35-
/// The operator identifier.
38+
/// The customer email address.
3639
/// </value>
37-
public String OperatorIdentifier { get; set; }
40+
[JsonProperty("customer_email_address")]
41+
public String CustomerEmailAddress { get; set; }
3842

3943
/// <summary>
4044
/// Gets or sets the product identifier.
4145
/// </summary>
4246
/// <value>
4347
/// The product identifier.
4448
/// </value>
49+
[JsonProperty("product_id")]
4550
public Guid ProductId { get; set; }
4651

4752
#endregion

TransactionProcessorACL.DataTransferObjects/Requests/TransactionRequestMessage.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System;
44
using System.Collections.Generic;
55
using System.Diagnostics.CodeAnalysis;
6+
using Newtonsoft.Json;
67

78
/// <summary>
89
///
@@ -18,6 +19,7 @@ public class TransactionRequestMessage
1819
/// <value>
1920
/// The application version.
2021
/// </value>
22+
[JsonProperty("application_version")]
2123
public String ApplicationVersion { get; set; }
2224

2325
/// <summary>
@@ -26,6 +28,7 @@ public class TransactionRequestMessage
2628
/// <value>
2729
/// The device identifier.
2830
/// </value>
31+
[JsonProperty("device_identifier")]
2932
public String DeviceIdentifier { get; set; }
3033

3134
/// <summary>
@@ -34,6 +37,7 @@ public class TransactionRequestMessage
3437
/// <value>
3538
/// The transaction date time.
3639
/// </value>
40+
[JsonProperty("transaction_date_time")]
3741
public DateTime TransactionDateTime { get; set; }
3842

3943
/// <summary>
@@ -42,6 +46,7 @@ public class TransactionRequestMessage
4246
/// <value>
4347
/// The transaction number.
4448
/// </value>
49+
[JsonProperty("transaction_number")]
4550
public String TransactionNumber { get; set; }
4651

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

5561
#endregion

0 commit comments

Comments
 (0)