gbv / paia

Specification of Patrons Account Information API (PAIA)
http://gbv.github.io/paia
15 stars 12 forks source link

Include expected fee before an action #31

Closed nichtich closed 8 years ago

nichtich commented 10 years ago

For renrew an additional document field "renewfee" could be added, but fees for renewals are rare. To find out the fee of a request, an additional method or parameter is required. The fee depends on patron, document, and time, so the fee cannot be provided via DAIA.

nichtich commented 9 years ago

Fees may also apply to requests or even cancel actions.

nichtich commented 9 years ago

We could return information about consequences of an action (request, renew, and cancel) to be confirmed with a repeatable field doc.confirm?:

The existence of a doc.confirm field should imply a doc.error.

To approve the action, the client must add a new request parameter confirm:

Current clients don't know about this parameter so they will just get an error (doc.error) for actions that require confirmation.

JonathanRowell commented 9 years ago

I would have thought that a message containing a "please confirm" note would produce a reply message which is either empty, meaning the resubmitted request would proceed without problems, or when not empty, a string to be displayed with the query "do you want to do it". The resubmitted request would not include the "please confirm" marker. This would then be compatible with existing clients (incidentally how many of them are there???) and flexible enough for all eventual possibilities.

nichtich commented 9 years ago

Still to be discussed. See https://github.com/gbv/paia/wiki/Confirmations for an alternative proposal with more flexibility.

JonathanRowell commented 9 years ago

Far too complicated. It seems like one has taken a leaf out of NCIP's book, but without the actual "scheme" construction. A proposal which leaves questions open is incomplete. And why are you trying to squeeze all error replies into an HTTP response code? A REST interface can use HTTP response codes because it contains no semantics. Here the semantics are very complex and the error returns must be explanatory, so HTTP response codes are inappropiate.

nichtich commented 9 years ago

Far too complicated. It seems like one has taken a leaf out of NCIP's book, but without the actual "scheme" construction. A proposal which leaves questions open is incomplete.

We have two requirements:

I strongly bet that soon there will be more requirements of confirmations, e.g.

Libraries can be very creative with loan conditions!

And why are you trying to squeeze all error replies into an HTTP response code? A REST interface can use HTTP response codes because it contains no semantics. Here the semantics are very complex and the error returns must be explanatory, so HTTP response codes are inappropiate.

ok, it was just an option question whether HTTP 402 Payment Required may be helpful. I have updated https://github.com/gbv/paia/wiki/Confirmations also including some comments of a colleague.

nichtich commented 8 years ago

This feature turned out to be more complex but it is truly optional, backwards-compatible and covers two required use cases (confirmation of fees and selection of pick-up locations).