public void Save() { if (!string.IsNullOrEmpty(ValueTextBox.Text)) { UsersPaymentProcessorsAddress.TrySetAddress(UserId, ProcessorInfo, ValueTextBox.Text); } }
public override void DataBind() { base.DataBind(); int BannedDays = 0; if (Processor != null) //CustomProcessor { ImageURL = Processor.ImageURL; BannedDays = Processor.DaysToBlockWithdrawalsAfterAccounChange; var address = UsersPaymentProcessorsAddress.GetAddress(UserId, ProcessorInfo); if (address != null) { ValueTextBox.Text = address.PaymentAddress.ToString(); } } else //Basic Processor { User = Member.CurrentInCache; var ProcessorType = (PaymentProcessor)Enum.Parse(typeof(PaymentProcessor), BasicProcessor.AccountType); ImageURL = String.Format("Images/OneSite/TransferMoney/{0}.png", BasicProcessor.AccountType); BannedDays = BasicProcessor.DaysToBlockWithdrawalsAfterAccountChangename; ValueTextBox.Text = User.GetPaymentAddress(ProcessorType); } if (!String.IsNullOrEmpty(ValueTextBox.Text)) { Processor_Helper.InnerText = (BannedDays > 0) ? String.Format(U6000.WALLETCHANGEWARNING, BannedDays) : ""; } }
public string GetPaymentAddress(PaymentProcessor processor) { var result = UsersPaymentProcessorsAddress.GetAddress(this.Id, new PaymentProcessorInfo(processor)); if (result == null) { return(String.Empty); } return(result.PaymentAddress); }
public string GetPaymentAddress(int customPayoutProcessorId) { var result = UsersPaymentProcessorsAddress.GetAddress(this.Id, new PaymentProcessorInfo(customPayoutProcessorId)); if (result == null) { return(String.Empty); } return(result.PaymentAddress); }
private static UsersPaymentProcessorsAddress GetEmailAddress(int userId) { return(UsersPaymentProcessorsAddress.GetAddress(userId, new PaymentProcessorInfo(PaymentProcessor.Coinbase)));; }
public void SetPaymentAddress(int customPayoutProcessorId, string address) { UsersPaymentProcessorsAddress.TrySetAddress(this.Id, new PaymentProcessorInfo(customPayoutProcessorId), address); }
public void SetPaymentAddress(PaymentProcessor processor, string address) { UsersPaymentProcessorsAddress.TrySetAddress(this.Id, new PaymentProcessorInfo(processor), address); }
public string TryMakePayout() { Money withdrawalFee = Money.Zero; if (!IsCustomPayoutProcessor) { var processor = PaymentAccountDetails.GetFirstGateway(TargetPaymentProcessor); withdrawalFee = Money.MultiplyPercent(AmountToPayout, processor.WithdrawalFeePercent); var address = UsersPaymentProcessorsAddress.GetAddress(User.Id, new PaymentProcessorInfo((PaymentProcessor)Enum.Parse(typeof(PaymentProcessor), processor.AccountType))); if (address != null) { if (TargetAccount != address.PaymentAddress) { throw new MsgException("Don't try to use account ID which is different from your current one. To change account ID go to user settings panel."); } if (address.LastChanged.AddDays(processor.DaysToBlockWithdrawalsAfterAccountChangename) > AppSettings.ServerTime) { throw new MsgException(string.Format(U6007.CANTWITHDRAWDAYSLIMIT, (address.LastChanged.AddDays(processor.DaysToBlockWithdrawalsAfterAccountChangename).DayOfYear - AppSettings.ServerTime.DayOfYear))); } } else { User.SetPaymentAddress(processor.Id, TargetAccount); } } else { var blockingDays = new CustomPayoutProcessor(CustomPayoutProcessorId).DaysToBlockWithdrawalsAfterAccounChange; var address = UsersPaymentProcessorsAddress.GetAddress(User.Id, new PaymentProcessorInfo(CustomPayoutProcessorId)); if (address != null) { if (TargetAccount != address.PaymentAddress) { throw new MsgException("Don't try to use account ID which is different from your current one. To change account ID go to user settings panel."); } if (address.LastChanged.AddDays(blockingDays) > AppSettings.ServerTime) { throw new MsgException(string.Format(U6007.CANTWITHDRAWDAYSLIMIT, (address.LastChanged.AddDays(blockingDays).DayOfYear - AppSettings.ServerTime.DayOfYear))); } } else { User.SetPaymentAddress(CustomPayoutProcessorId, TargetAccount); } } ValidatePayout(User, AmountToPayout); //Check the gateway limit (global limit, pp custom limit) CheckBaseLimits(); //CLP ---> extension for private client CLP User = Titan.CLP.CLPManager.CheckCashoutBonus(User, AmountToPayout); if (IsManualPayout()) //Decide if we go with automatic or manual { return(TryMakeManualPayout(withdrawalFee)); } else { return(TryMakeInstantPayout(withdrawalFee)); } return(""); }