Пример #1
0
    internal void ProcessMonth(int year, int month)
    {
        var customer = repo.Customers.Single();

        if (NeedsBilling(customer, year, month))
        {
            bool charged = charger.ChargeCustomer(customer);
            customer.Subscription.RecordChargeResult(charged);
        }
    }
Пример #2
0
    public void ProcessMonth(int year, int month)
    {
        var customer = _repo.Customers.Single();

        if (NeedsBilling(year, month, customer))
        {
            bool charged = _charger.ChargeCustomer(customer);
            customer.Subscription.RecordChargedResult(charged);
        }
    }
        public void ProcessMonth(int year, int month)
        {
            var customer = _repo.Customers.Single();

            if (NeedsBilling(year, month, customer))
            {
                bool charged = _charger.ChargeCustomer(customer);

                if (!charged && ++customer.PaymentFailures >= MAX_FAILURES)
                {
                    customer.Subscribed = false;
                }
            }
        }