private PaymentSettings GetPaymentSetting(ValidateOnlineDepositAmountRequest request)
        {
            var defaultVipLevel = _playerQueries.GetDefaultVipLevel(request.BrandId);
            //TODO: we should take the currency into account
            var paymentSettings = _paymentQueries.GetPaymentSettings().ToList();
            var paymentSetting  = paymentSettings
                                  .FirstOrDefault(x => x.VipLevel == defaultVipLevel.Id.ToString() && x.Enabled == Status.Active);

            return(paymentSetting);
        }
Esempio n. 2
0
        public PaymentSettingsResponse OnlineDepositPaymentSettings([FromUri] DefaultPaymentSettingsRequest request)
        {
            var defaultVipLevel = _playerQueries.GetDefaultVipLevel(request.BrandId);

            if (defaultVipLevel == null)
            {
                throw new RegoValidationException(ErrorMessagesEnum.ThereIsNoDefaultVipLevelForRequestedBrand.ToString());
            }

            var paymentGetewaySettings = _paymentGatewaySettingsQueries.GetOnePaymentGatewaySettingsByPlayerId(PlayerId);

            if (paymentGetewaySettings == null)
            {
                throw new RegoException("PaymentGatewaySettings not found");
            }

            var method = paymentGetewaySettings.OnlinePaymentMethodName;

            var paymentSetting = _paymentQueries.GetOnlinePaymentSettings(request.BrandId, PaymentType.Deposit,
                                                                          defaultVipLevel.Id.ToString(), method, request.CurrencyCode);

            return(new PaymentSettingsResponse(paymentSetting));
        }