public static (Amount paid, Money remaining) Pay(this Money money, Amount expense)
        {
            switch (money)
            {
            case CashProxy proxy:
                (Amount partPaid, Money partRemaining) =
                    proxy.Implementation.Pay(expense.Scale(1 + proxy.PercentageFee));
                return(partPaid.Scale(1 - proxy.PercentageFee), partRemaining);

            default:
                return(Finance.MoneyPaymentExtensions.Pay(money, expense));
            }
        }
Beispiel #2
0
 public Amount ApplyTo(Amount price) =>
 price.Scale(1 + this.Relative);