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
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,8 @@ private async Task<TokenResponse> GetToken(CancellationToken cancellationToken)
CancellationToken cancellationToken)
{
EstateResponse estate = null;
MerchantResponse merchant = null;

// Validate the Estate Record is a valid estate
try
{
Expand All @@ -540,11 +542,11 @@ private async Task<TokenResponse> GetToken(CancellationToken cancellationToken)
}

// get the merchant record and validate the device
// TODO: Token
MerchantResponse merchant = await this.GetMerchant(estateId, merchantId, cancellationToken);

// TODO: Remove this once GetMerchant returns correct response when merchant not found
if (merchant.MerchantName == null)
try
{
merchant = await this.GetMerchant(estateId, merchantId, cancellationToken);
}
catch (Exception ex) when (ex.InnerException != null && ex.InnerException.GetType() == typeof(KeyNotFoundException))
{
throw new TransactionValidationException($"Merchant Id [{merchantId}] is not a valid merchant for estate [{estate.EstateName}]",
TransactionResponseCode.InvalidMerchantId);
Expand Down
3 changes: 2 additions & 1 deletion TransactionProcessor.IntegrationTests/Common/DockerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ public override async Task StartContainersForScenarioRun(String scenarioName)
(Setup.SqlServerContainerName,
"sa",
"thisisalongpassword123!"),
("serviceClient", "Secret1"));
("serviceClient", "Secret1"),
true);

IContainerService securityServiceContainer = DockerHelper.SetupSecurityServiceContainer(this.SecurityServiceContainerName,
this.Logger,
Expand Down