Example #1
0
        public Task AddOperationAttemptAsync(
            string clientId,
            string assetId,
            double amount,
            int ttlInMinutes,
            CurrencyOperationType currencyOperationType)
        {
            if (string.IsNullOrWhiteSpace(clientId))
            {
                throw new ArgumentException(nameof(clientId));
            }

            if (string.IsNullOrWhiteSpace(assetId))
            {
                throw new ArgumentException(nameof(assetId));
            }

            if (amount < 0)
            {
                throw new ArgumentException(nameof(amount));
            }

            if (ttlInMinutes < 0)
            {
                throw new ArgumentException(nameof(ttlInMinutes));
            }

            return(_antiFraudCollector.AddDataAsync(
                       clientId,
                       assetId,
                       amount,
                       ttlInMinutes,
                       currencyOperationType));
        }
Example #2
0
        public Task CacheClientDataAsync(string clientId, CurrencyOperationType operationType)
        {
            if (string.IsNullOrWhiteSpace(clientId))
            {
                throw new ArgumentException(nameof(clientId));
            }

            Task.Run(() => _cashOperationsCollector.CacheClientDataAsync(clientId, operationType));
            Task.Run(() => _cashTransfersCollector.CacheClientDataAsync(clientId, operationType));

            return(Task.CompletedTask);
        }