Skip to content

Commit 47b5427

Browse files
Merge pull request #80 from StuartFerguson/task/#76_validatebalanceonsales
Minor fix after estate management change
2 parents 42fb9b6 + a747c17 commit 47b5427

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,8 @@ private async Task<TokenResponse> GetToken(CancellationToken cancellationToken)
529529
CancellationToken cancellationToken)
530530
{
531531
EstateResponse estate = null;
532+
MerchantResponse merchant = null;
533+
532534
// Validate the Estate Record is a valid estate
533535
try
534536
{
@@ -540,11 +542,11 @@ private async Task<TokenResponse> GetToken(CancellationToken cancellationToken)
540542
}
541543

542544
// get the merchant record and validate the device
543-
// TODO: Token
544-
MerchantResponse merchant = await this.GetMerchant(estateId, merchantId, cancellationToken);
545-
546-
// TODO: Remove this once GetMerchant returns correct response when merchant not found
547-
if (merchant.MerchantName == null)
545+
try
546+
{
547+
merchant = await this.GetMerchant(estateId, merchantId, cancellationToken);
548+
}
549+
catch (Exception ex) when (ex.InnerException != null && ex.InnerException.GetType() == typeof(KeyNotFoundException))
548550
{
549551
throw new TransactionValidationException($"Merchant Id [{merchantId}] is not a valid merchant for estate [{estate.EstateName}]",
550552
TransactionResponseCode.InvalidMerchantId);

TransactionProcessor.IntegrationTests/Common/DockerHelper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ public override async Task StartContainersForScenarioRun(String scenarioName)
232232
(Setup.SqlServerContainerName,
233233
"sa",
234234
"thisisalongpassword123!"),
235-
("serviceClient", "Secret1"));
235+
("serviceClient", "Secret1"),
236+
true);
236237

237238
IContainerService securityServiceContainer = DockerHelper.SetupSecurityServiceContainer(this.SecurityServiceContainerName,
238239
this.Logger,

0 commit comments

Comments
 (0)