Bug 33216: Catch and handle RegisterRequired exceptions for SIP fee paid messages
authorKyle Hall <kyle@bywatersolutions.com>
Tue, 14 Mar 2023 11:06:21 +0000 (07:06 -0400)
committerLucas Gass <lucas@bywatersolutions.com>
Mon, 15 May 2023 14:39:12 +0000 (14:39 +0000)
commit175dd2871c2ac00997cad13e0dba215688e85baa
tree07a97df66ecaaae6816de05ee39a32831299810f
parentd3bdb9c2878240094c79233d50e056a5e6c14a92
Bug 33216: Catch and handle RegisterRequired exceptions for SIP fee paid messages

If registers are being used in Koha, they are required. If a SIP account has no register and a fee paid message is sent, the SIP server crashes and the client never gets a response. It would be much better if Koha would response with 38 response where "payment accepted" is N, and an AF field stating that the SIP account needs to be associated with a register.

Test Plan:
1) Enable UseCashRegisters, set RequireCashRegister to "always require a
   cash register". Do *not* set a cash register for the SIP account you
   will be testing with.
2) Using the SIP cli tester, send a fee paid message for a patron owing
   fees.
3) Note the lack of a SIP response
4) Apply this patch
5) Restart the SIP server
6) Repeat step 2, you should now get a SIP response with the error
   message in it!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0411bf0573708327a9c0271f4d01c2996641bb3f)
Signed-off-by: Jacob O'Mara <jacobomara901@gmail.com>
(cherry picked from commit c6610d5ed97c03a090039606aecfe7f5d6917876)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/SIP/ILS.pm
C4/SIP/ILS/Transaction/FeePayment.pm
C4/SIP/Sip/MsgType.pm