/// <summary> /// Verify if the result of payment process was successful or not in any time. /// </summary> /// <param name="checkTransaction">To query data, necessitating the token, transaction client id and amount.</param> /// <returns>CheckTransactionResponseDto with contains result of the process and data of the payment</returns> public CheckTransactionResponseDto CheckStatusTransaction(CheckTransactionRequestDto checkTransaction) { _logger.Debug("Start CheckStatusTransaction"); var dateNow = DateTime.UtcNow; var message = string.Format("{0}{1}{2}{1}{3}{1}{4}{5}", _configuration.GetCheckTransactionFunction(), "\n", checkTransaction.Token, checkTransaction.TransactionId, checkTransaction.Currency, dateNow.ToString("r")); _logger.Debug(string.Format("Generate message for check notification transaction: {0}", message)); var authorization = _authorization.GetAuthorizationHeader(message); var response = _webExecute.Execute(_configuration.GetCheckTransactionUrl(), "GET", null, authorization, dateNow); _logger.Debug("End execute check transaction, now create CheckTransactionResponseDto"); var checkResponseDto = new CheckTransactionResponseDto(response); _logger.Info(string.Format("The result for check transaction with Token: {0} and TransactionId {1} is {2}", checkResponseDto.Token, checkResponseDto.TransactionId, checkResponseDto.IsTransactionSuccessful() ? "Successful" : "Unsuccessful")); _logger.Debug("End CheckStatusTransaction"); return checkResponseDto; }