Esempio n. 1
0
        public override WalletTransferTransaction TransferTo(Decimal amount, AbstractWallet wallet)
        {
            var transaction = new WalletTransferTransaction(amount, this, wallet);

            transaction.Initiate();
            return(transaction);
        }
Esempio n. 2
0
 internal WithdrawalTransaction(Decimal amount, AbstractWallet sourceWallet)
     : base
     (
         amount,
         new ReduceBalanceCommand(sourceWallet, amount)
     )
 {
 }
Esempio n. 3
0
 public CommissionHoldTransaction(Decimal amount, AbstractWallet sourceWallet)
     : base
     (
         amount,
         new ReduceBalanceCommand(sourceWallet, amount)
     )
 {
 }
Esempio n. 4
0
        public PercentageAccrualDecorator(AbstractWallet wallet, IDateTimeProvider dateTimeProvider, Decimal annualPercentage) : base(wallet)
        {
            _dayPercentage = annualPercentage / 365 / 100;

            _dateTimeProvider = dateTimeProvider;
            _lastUpdateTime   = _dateTimeProvider.UtcNow;
            _accumulation     = 0;
        }
Esempio n. 5
0
 public IncreaseBalanceCommand(AbstractWallet wallet, Decimal amount)
     : base
     (
         () => wallet.IncreaseBalance(amount),
         () => wallet.ReduceBalance(amount)
     )
 {
 }
Esempio n. 6
0
 public PercentageAccrualTransaction(Decimal amount, AbstractWallet destinationWallet)
     : base
     (
         amount,
         new IncreaseBalanceCommand(destinationWallet, amount)
     )
 {
 }
Esempio n. 7
0
 internal DepositTransaction(Decimal amount, AbstractWallet destinationWallet)
     : base
     (
         amount,
         new IncreaseBalanceCommand(destinationWallet, amount)
     )
 {
 }
Esempio n. 8
0
        internal WalletTransferTransaction(Decimal amount, AbstractWallet sourceWallet, AbstractWallet destinationWallet)
            : base
            (
                amount,
                CommandChain
                .StartWith(new ReduceBalanceCommand(sourceWallet, amount))
                .Then(new IncreaseBalanceCommand(destinationWallet, amount))
            )

        {
        }
Esempio n. 9
0
 protected WalletDecorator(AbstractWallet wallet)
 {
     _wallet = wallet;
 }
Esempio n. 10
0
 public WalletBuilder SetStartBalance(Decimal startBalance)
 {
     _wallet = new Wallet(startBalance);
     return(this);
 }
Esempio n. 11
0
 public ZeroBalanceLimitProxy(AbstractWallet wallet) : base(wallet, 0)
 {
 }
Esempio n. 12
0
 public CommissionHoldDecorator(AbstractWallet wallet, Decimal commission) : base(wallet)
 {
     _commission = commission;
 }
Esempio n. 13
0
 public WalletBuilder SetWithdrawalAmountLimit(Decimal amountLimit)
 {
     _wallet = new WithdrawalAmountLimitProxy(_wallet, amountLimit);
     return(this);
 }
Esempio n. 14
0
 public override WalletTransferTransaction TransferTo(Decimal amount, AbstractWallet wallet)
 {
     UpdatePercentage();
     return(_wallet.TransferTo(amount, wallet));
 }
Esempio n. 15
0
 public WithdrawalAmountLimitProxy(AbstractWallet wallet, Decimal limit) : base(wallet, limit)
 {
 }
Esempio n. 16
0
 public WalletBuilder SetTransferAmountLimit(Decimal amountLimit)
 {
     _wallet = new TransferAmountLimitProxy(_wallet, amountLimit);
     return(this);
 }
Esempio n. 17
0
 public WalletBuilder SetZeroBalanceLimit()
 {
     _wallet = new ZeroBalanceLimitProxy(_wallet);
     return(this);
 }
Esempio n. 18
0
 protected WalletProxy(AbstractWallet wallet)
 {
     _wallet = wallet;
 }
Esempio n. 19
0
 public WalletBuilder SetTransferTimeBlock(TimeSpan blockTime)
 {
     _wallet = new TransferTimeBlockProxy(_wallet, _dateTimeProvider, blockTime);
     return(this);
 }
Esempio n. 20
0
 public WithdrawalTimeBlockProxy(AbstractWallet wallet, IDateTimeProvider dateTimeProvider, TimeSpan blockTime) : base(wallet, dateTimeProvider, blockTime)
 {
 }
Esempio n. 21
0
 protected TimeBlockProxy(AbstractWallet wallet, IDateTimeProvider dateTimeProvider, TimeSpan blockTime) : base(wallet)
 {
     _dateTimeProvider = dateTimeProvider;
     _blockTime        = blockTime;
     _creationTime     = _dateTimeProvider.UtcNow;
 }
Esempio n. 22
0
 public WalletBuilder SetCommissionHold(Decimal commissionAmount)
 {
     _wallet = new CommissionHoldDecorator(_wallet, commissionAmount);
     return(this);
 }
Esempio n. 23
0
 public WalletBuilder SetPercentageAccrual(Decimal annualPercentage)
 {
     _wallet = new PercentageAccrualDecorator(_wallet, _dateTimeProvider, annualPercentage);
     return(this);
 }
Esempio n. 24
0
 public WalletBuilder SetWithdrawalTimeBlock(TimeSpan blockTime)
 {
     _wallet = new WithdrawalTimeBlockProxy(_wallet, _dateTimeProvider, blockTime);
     return(this);
 }
Esempio n. 25
0
 public override WalletTransferTransaction TransferTo(Decimal amount, AbstractWallet wallet)
 {
     return(_wallet.TransferTo(amount, wallet));
 }
Esempio n. 26
0
 public override WalletTransferTransaction TransferTo(Decimal amount, AbstractWallet wallet)
 {
     CheckTimeBlock("Unable to transfer!");
     return(base.TransferTo(amount, wallet));
 }
Esempio n. 27
0
 public WalletBuilder(IDateTimeProvider dateTimeProvider)
 {
     _wallet           = new Wallet(0);
     _dateTimeProvider = dateTimeProvider;
 }
Esempio n. 28
0
 public WalletBuilder Refresh()
 {
     _wallet = new Wallet(0);
     return(this);
 }
Esempio n. 29
0
 public TransferTimeBlockProxy(AbstractWallet wallet, IDateTimeProvider dateTimeProvider, TimeSpan blockTime) : base(wallet, dateTimeProvider, blockTime)
 {
 }
Esempio n. 30
0
 protected AmountLimitProxy(AbstractWallet wallet, Decimal limit) : base(wallet)
 {
     _limit = limit;
 }