Пример #1
0
        public Money GetMinimumWithdrawalAmount(Member user, WithdrawalSourceBalance withdrawalSource)
        {
            if (withdrawalSource == WithdrawalSourceBalance.MainBalance)
            {
                var withdrawLimitInMembership     = PayoutLimit.GetGlobalLimitValue(user);
                var minimumCryptocurrencyWithdraw = WithdrawalMinimum * GetValue();

                var list = new List <Money>
                {
                    minimumCryptocurrencyWithdraw,
                    withdrawLimitInMembership
                };

                return(list.Max());
            }
            else //Wallet
            {
                return(new CryptocurrencyMoney(Type, WithdrawalMinimum));
            }
        }
Пример #2
0
    protected void SetProcessorValues()
    {
        Account.Enabled             = true;
        ChangeAccountButton.Visible = false;
        AddNewAccount.Visible       = false;
        var   userAccountAddress = "";
        Money GlobalLimit        = PayoutLimit.GetGlobalLimitValue(User);
        var   errorNote          = "";

        try
        {
            //Custom Processor
            var CustomProcessor = new CustomPayoutProcessor(int.Parse(RadioFrom.SelectedValue));
            userAccountAddress = User.GetPaymentAddress(CustomProcessor.Id);
            Account.Text       = userAccountAddress;

            //Limits
            string limit     = (CustomProcessor.OverrideGlobalLimit ? CustomProcessor.CashoutLimit : GlobalLimit).ToShortString();
            Money  maxPayout = PayoutManager.GetMaxPossiblePayout(PaymentProcessor.CustomPayoutProcessor, User, out errorNote);

            if (maxPayout > User.MainBalance)
            {
                maxPayout = User.MainBalance;
            }

            MinLimitLabel.Text = limit;
            MaxLimitLabel.Text = maxPayout.ToShortString();
            InfoLabel.Text     = CustomProcessor.Description;
            FeesLabel.Text     = CustomProcessor.FeesToString();
        }
        catch (Exception)
        {
            //Automatic processor
            var selectedProcessor = RadioFrom.SelectedValue;

            if (!String.IsNullOrEmpty(selectedProcessor))
            {
                PaymentProcessor targetprocessor = PaymentAccountDetails.GetFromStringType(selectedProcessor);
                userAccountAddress = User.GetPaymentAddress(targetprocessor);
                var gateway = PaymentAccountDetails.GetFirstGateway(selectedProcessor);

                //Limits
                string limit     = (gateway.OverrideGlobalLimit ? gateway.CashoutLimit : GlobalLimit).ToShortString();
                Money  maxPayout = PayoutManager.GetMaxPossiblePayout(PaymentAccountDetails.GetFromStringType(gateway.AccountType), User, out errorNote);

                if (maxPayout > User.MainBalance)
                {
                    maxPayout = User.MainBalance;
                }

                MinLimitLabel.Text = limit;
                MaxLimitLabel.Text = maxPayout.ToShortString();
                FeesLabel.Text     = NumberUtils.FormatPercents(gateway.WithdrawalFeePercent.ToString());
            }
        }

        if (!string.IsNullOrWhiteSpace(userAccountAddress))
        {
            Account.Visible             = true;
            Account.Enabled             = false;
            Account.Text                = userAccountAddress;
            ChangeAccountButton.Text    = U6007.CHANGE;
            ChangeAccountButton.Visible = true;
        }
        else
        {
            Account.Visible       = false;
            AddNewAccount.Text    = L1.ADDNEW;
            AddNewAccount.Visible = true;
        }
    }