Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #9292

Re: .paid field vs .payment field

From Victor Porton <porton@narod.ru>
Newsgroups comp.programming
Subject Re: .paid field vs .payment field
Date 2018-09-22 16:40 +0300
Organization Aioe.org NNTP Server
Message-ID <po5gok$1ksp$1@gioia.aioe.org> (permalink)
References <po0slo$eqg$1@gioia.aioe.org>

Show all headers | View raw


Victor Porton wrote:

> Let us narrow the task:
> 
> I am writing a class SimpleItem representing a non-recurrent (one-time)
> purchase. That is the payment is not recurring, it is normally paid at
> most once (however, such things as refunds may happen).
> 
> The class SimpleItem has field .payment which is an instance of
> SimplePayment, a class representing a result of user interaction which led
> to a payment.
> 
> Now, my question: Should I also have boolean field SimpleItem.paid? It
> seems that I can determine whether there was a payment by checking that
> .payment is non-NULL. So it seems that .paid field is not necessary. But
> maybe there are arguments for the contrary?
> 
> The API needs to be quality and usable.

Related question: Should .payment be reset to NULL on payment refund event?

(If no, then we need both .payment and .paid because in this case .paid 
should be reset to False but .payment not reset to NULL.)

-- 
Victor Porton - http://portonvictor.org

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

.paid field vs .payment field Victor Porton <porton@narod.ru> - 2018-09-20 22:33 +0300
  Re: .paid field vs .payment field Victor Porton <porton@narod.ru> - 2018-09-22 16:40 +0300
  Re: .paid field vs .payment field Julio Di Egidio <julio@diegidio.name> - 2018-09-22 07:11 -0700
    Re: .paid field vs .payment field Victor Porton <porton@narod.ru> - 2018-09-22 17:17 +0300
      Re: .paid field vs .payment field Julio Di Egidio <julio@diegidio.name> - 2018-09-25 01:21 -0700
        Re: .paid field vs .payment field Victor Porton <porton@narod.ru> - 2018-09-25 18:59 +0300
          Re: .paid field vs .payment field Julio Di Egidio <julio@diegidio.name> - 2018-09-25 09:43 -0700
  Re: .paid field vs .payment field Julio Di Egidio <julio@diegidio.name> - 2018-09-22 08:53 -0700

csiph-web