public async Task <bool> ProcessNotificationAcknowledgement(Acknowledgement ack, Guid ApiCallGuid, bool isAmendment) { try { var cts = new CancellationTokenSource(); bool success = false; string notes = null; if (ack.NotificationType == ContractNotificationType.RequestClosed) { success = ack.Status == ContractStatus.SUCCESS; string name = isAmendment ? "amendment" : "search"; if (success) { notes = $"{ack.ProviderProfile?.Name} received {name} response successfully."; } else { notes = $"{ack.ProviderProfile?.Name} did not receive {name} response successfully."; } return(await _searchRequestService.UpdateApiCall(ApiCallGuid, success, notes, cts.Token)); } return(false); } catch (Exception e) { _logger.LogInformation($"set apiCall {ApiCallGuid} failed" + e.Message); return(false); } }