示例#1
0
        public FileTree()
        {
            root = null;
            rootPath = string.Empty;

            errorHandler = null;
            reportHandler = null;
            errorHandlerOn = false;
            reportHandlerOn = false;
        }
        private RandomAgeGenerator()
        {
            source = null;
            interpolator = null;

            errorHandler = null;
            reportHandler = null;
            errorHandlerOn = false;
            reportHandlerOn = false;
        }
示例#3
0
        public TestSuite()
        {
            name = string.Empty;
            description = string.Empty;
            batteries = new Dictionary<int, TestBattery>();

            errorHandler = null;
            reportHandler = null;
            errorHandlerOn = false;
            reportHandlerOn = false;
        }
示例#4
0
        private FileNode()
        {
            parent = null;
            name = string.Empty;
            extension = string.Empty;

            errorHandler = null;
            reportHandler = null;
            errorHandlerOn = false;
            reportHandlerOn = false;
        }
        public Interpolator()
        {
            xValues = null;
            yValues = null;
            slopes = new List<double>();
            intercepts = new List<double>();

            errorHandler = null;
            reportHandler = null;
            errorHandlerOn = false;
            reportHandlerOn = false;
        }
示例#6
0
        protected FolderNode()
        {
            parent = null;
            name = string.Empty;
            folders = new List<FolderNode>();
            files = new List<FileNode>();

            errorHandler = null;
            reportHandler = null;
            errorHandlerOn = false;
            reportHandlerOn = false;
        }
示例#7
0
        private MenuList()
        {
            tabWidth = 5;
            tabChar = ' ';
            minSelectorWidth = 2;
            selectorPadCharacter = ' ';

            menuIndex = 0;
            menuName = string.Empty;
            menuItems = new List<MenuItem>();

            keepLooping = false;

            errorHandler = null;
            reportHandler = null;
            errorHandlerOn = false;
            reportHandlerOn = false;
        }
        public TestSuiteData()
        {
            process = false;

            suiteName = string.Empty;
            suiteDescription = string.Empty;

            batteryID = -1;
            batteryName = string.Empty;
            batteryDescription = string.Empty;

            testCaseID = -1;
            testCaseName = string.Empty;
            testCaseDescription = string.Empty;

            testStepID = -1;
            testStepDescription = string.Empty;

            errorHandler = null;
            errorHandlerOn = false;
        }
        public async Task <Payment> Process(Payment payment)
        {
            var dbPayment = await _paymentRepository.GetByIdempotencyId(payment.IdempotencyId);

            if (dbPayment != null)
            {
                _logger.LogWarning($"IDEMPOTENT :: An identical request was already made for this Payment (Id - {dbPayment.Id}");
                return(dbPayment);
            }

            var dbMerchant = await _merchantRepository.Get(payment.MerchantId);

            if (dbMerchant == null)
            {
                throw new BusinessException(
                          BusinessExceptionCodes.MerchantHasNoContract,
                          "This Merchant has no contract with us, therefore we cannot accept payment requests.");
            }

            var paymentValidator = new PaymentValidator();
            var validationResult = paymentValidator.Validate(payment);

            HandleErrors.HandleValidatorResult(validationResult);

            var transactionResults = await _bankApiClient.PostTransaction(payment);

            payment.Id                = Guid.NewGuid();
            payment.Status            = transactionResults.Status;
            payment.BankTransactionId = transactionResults.BankTransactionId;
            payment.HasError          = payment.Status != PaymentStatus.Approved;
            payment.ErrorCode         = transactionResults.ErrorCode;
            payment.ErrorMessage      = transactionResults.Message;
            payment.CreatedOn         = DateTime.UtcNow;
            payment.UpdatedOn         = DateTime.UtcNow;

            return(await _paymentRepository.Add(payment));
        }