public override WalletTransferTransaction TransferTo(Decimal amount, AbstractWallet wallet) { var transaction = new WalletTransferTransaction(amount, this, wallet); transaction.Initiate(); return(transaction); }
internal WithdrawalTransaction(Decimal amount, AbstractWallet sourceWallet) : base ( amount, new ReduceBalanceCommand(sourceWallet, amount) ) { }
public CommissionHoldTransaction(Decimal amount, AbstractWallet sourceWallet) : base ( amount, new ReduceBalanceCommand(sourceWallet, amount) ) { }
public PercentageAccrualDecorator(AbstractWallet wallet, IDateTimeProvider dateTimeProvider, Decimal annualPercentage) : base(wallet) { _dayPercentage = annualPercentage / 365 / 100; _dateTimeProvider = dateTimeProvider; _lastUpdateTime = _dateTimeProvider.UtcNow; _accumulation = 0; }
public IncreaseBalanceCommand(AbstractWallet wallet, Decimal amount) : base ( () => wallet.IncreaseBalance(amount), () => wallet.ReduceBalance(amount) ) { }
public PercentageAccrualTransaction(Decimal amount, AbstractWallet destinationWallet) : base ( amount, new IncreaseBalanceCommand(destinationWallet, amount) ) { }
internal DepositTransaction(Decimal amount, AbstractWallet destinationWallet) : base ( amount, new IncreaseBalanceCommand(destinationWallet, amount) ) { }
internal WalletTransferTransaction(Decimal amount, AbstractWallet sourceWallet, AbstractWallet destinationWallet) : base ( amount, CommandChain .StartWith(new ReduceBalanceCommand(sourceWallet, amount)) .Then(new IncreaseBalanceCommand(destinationWallet, amount)) ) { }
protected WalletDecorator(AbstractWallet wallet) { _wallet = wallet; }
public WalletBuilder SetStartBalance(Decimal startBalance) { _wallet = new Wallet(startBalance); return(this); }
public ZeroBalanceLimitProxy(AbstractWallet wallet) : base(wallet, 0) { }
public CommissionHoldDecorator(AbstractWallet wallet, Decimal commission) : base(wallet) { _commission = commission; }
public WalletBuilder SetWithdrawalAmountLimit(Decimal amountLimit) { _wallet = new WithdrawalAmountLimitProxy(_wallet, amountLimit); return(this); }
public override WalletTransferTransaction TransferTo(Decimal amount, AbstractWallet wallet) { UpdatePercentage(); return(_wallet.TransferTo(amount, wallet)); }
public WithdrawalAmountLimitProxy(AbstractWallet wallet, Decimal limit) : base(wallet, limit) { }
public WalletBuilder SetTransferAmountLimit(Decimal amountLimit) { _wallet = new TransferAmountLimitProxy(_wallet, amountLimit); return(this); }
public WalletBuilder SetZeroBalanceLimit() { _wallet = new ZeroBalanceLimitProxy(_wallet); return(this); }
protected WalletProxy(AbstractWallet wallet) { _wallet = wallet; }
public WalletBuilder SetTransferTimeBlock(TimeSpan blockTime) { _wallet = new TransferTimeBlockProxy(_wallet, _dateTimeProvider, blockTime); return(this); }
public WithdrawalTimeBlockProxy(AbstractWallet wallet, IDateTimeProvider dateTimeProvider, TimeSpan blockTime) : base(wallet, dateTimeProvider, blockTime) { }
protected TimeBlockProxy(AbstractWallet wallet, IDateTimeProvider dateTimeProvider, TimeSpan blockTime) : base(wallet) { _dateTimeProvider = dateTimeProvider; _blockTime = blockTime; _creationTime = _dateTimeProvider.UtcNow; }
public WalletBuilder SetCommissionHold(Decimal commissionAmount) { _wallet = new CommissionHoldDecorator(_wallet, commissionAmount); return(this); }
public WalletBuilder SetPercentageAccrual(Decimal annualPercentage) { _wallet = new PercentageAccrualDecorator(_wallet, _dateTimeProvider, annualPercentage); return(this); }
public WalletBuilder SetWithdrawalTimeBlock(TimeSpan blockTime) { _wallet = new WithdrawalTimeBlockProxy(_wallet, _dateTimeProvider, blockTime); return(this); }
public override WalletTransferTransaction TransferTo(Decimal amount, AbstractWallet wallet) { return(_wallet.TransferTo(amount, wallet)); }
public override WalletTransferTransaction TransferTo(Decimal amount, AbstractWallet wallet) { CheckTimeBlock("Unable to transfer!"); return(base.TransferTo(amount, wallet)); }
public WalletBuilder(IDateTimeProvider dateTimeProvider) { _wallet = new Wallet(0); _dateTimeProvider = dateTimeProvider; }
public WalletBuilder Refresh() { _wallet = new Wallet(0); return(this); }
public TransferTimeBlockProxy(AbstractWallet wallet, IDateTimeProvider dateTimeProvider, TimeSpan blockTime) : base(wallet, dateTimeProvider, blockTime) { }
protected AmountLimitProxy(AbstractWallet wallet, Decimal limit) : base(wallet) { _limit = limit; }