示例#1
0
        private async Task <CreateDeposit> CreateDepositFromForeignCurrency(CreateDepositRequest request, CancellationToken token)
        {
            Rate rate = await _ratesService.GetExchangeRate(Currency.FromInput(request.Currency),
                                                            Currency.FromInput(_options.BaseCurrency),
                                                            token);

            decimal convertedAmount = request.Amount * rate.ConversionValue;

            CreateDeposit deposit = new CreateDeposit(request.AccountId, Amount.FromInput(convertedAmount),
                                                      Currency.FromInput(request.Currency));

            return(deposit);
        }