From bc7da30e7e72304e3dc425411cba08fe84fde496 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Mon, 27 May 2024 09:34:13 +0100 Subject: [PATCH] fix issue on the parked messages by getting a token when required --- .../EventHandling/TransactionDomainEventHandler.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TransactionProcessor.BusinessLogic/EventHandling/TransactionDomainEventHandler.cs b/TransactionProcessor.BusinessLogic/EventHandling/TransactionDomainEventHandler.cs index be1a4fe4..fca3a8ee 100644 --- a/TransactionProcessor.BusinessLogic/EventHandling/TransactionDomainEventHandler.cs +++ b/TransactionProcessor.BusinessLogic/EventHandling/TransactionDomainEventHandler.cs @@ -242,6 +242,8 @@ private async Task HandleSpecificDomainEvent(MerchantFeePendingSettlementAddedTo private async Task HandleSpecificDomainEvent(SettledMerchantFeeAddedToTransactionEvent domainEvent, CancellationToken cancellationToken){ + this.TokenResponse = await Helpers.GetToken(this.TokenResponse, this.SecurityServiceClient, cancellationToken); + Guid aggregateId = Helpers.CalculateSettlementAggregateId(domainEvent.SettledDateTime.Date, domainEvent.MerchantId, domainEvent.EstateId); EstateManagement.DataTransferObjects.Responses.Merchant.MerchantResponse merchant = await this.EstateClient.GetMerchant(this.TokenResponse.AccessToken, domainEvent.EstateId, domainEvent.MerchantId, cancellationToken);