示例#1
0
        public Money GetMaximumWithdrawalAmount(Member user, WithdrawalSourceBalance withdrawalSource, out string errorMessage)
        {
            errorMessage = U6012.PAYOUTREQUESTTOOHIGH;

            if (withdrawalSource == WithdrawalSourceBalance.MainBalance)
            {
                return(PayoutManager.GetMaxPossiblePayout(CryptocurrencyTypeHelper.ConvertToPaymentProcessor(this.CryptocurrencyType), user, out errorMessage));
            }
            else //Wallet
            {
                return(user.GetCryptocurrencyBalance(this.Type)); //No limit
            }
        }
示例#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;
        }
    }