File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
TransactionProcessor.BusinessLogic/Services
TransactionProcessor.IntegrationTests/Common Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments