Enable Koha to accept, process and respond to SIP2 'Fee Paid' messages, as per the SIP2 protocol specification defined by 3M. See osdir.com/ml/attachments/pdfLa2ukLu5d7.pdf for full details. Processing 'Fee Paid' messages Koha shall parse the 'Fee Paid' message to extract the following mandatory information: • Transaction date • Fee type • Payment type • Currency • Amount • Institution ID • Patron identifier (barcode) Koha shall also be able to parse the following optional information: • terminal password • patron password • fee identifier (the ID of the fine to which the payment is applied) • Transaction ID (as assigned by the SIP client) Once the message is parsed, a payment line shall be added to Koha's accountlines table. This line shall include the borrowernumber, amount (as a negative), the transaction date, the payment type, and the account against which the payment is made. A note shall also be made to indicate that the payment was made from SIP client, rather than through the Koha staff client. Payments shall be accepted if the borrowernumber and account against which the payment is made are both valid. Otherwise, the payment shall not be accepted, and return an error message (see next section). Responding to 'Fee Paid' messages The Screen Message attribute of the 'Fee Paid Response' Message shall be used to display the details of any error that prevented the payment from being accepted. If the payment is accepted, this attribute shall contain a friendly “thank you for your payment” message.
Created attachment 6539 [details] [review] SIP2 Fee Paid Pay Type support Adds support for recording in Koha accountlines a different accounttype depending on how the fee was paid at the SIP2 station (cash, credit, etc) Adds a new param to recordpayment(), $sip_paytype, which is appended to the 'Pay' type if present. The payment descriptin is also appended with " (via SIP2)" if this is present. In order for other scripts to keep working as expected, "eq 'Pay'" needed to be replaced with a regex comparison "=~ /^Pay/", so that 'Pay' and 'Pay-##' would continue to group together. To test: 1. Make a payment over a SIP2 connection 2. Check the patron record in the staff client; you should see the modified description 3. Attempt to print a invoice or a reciept for the borrower; the payment should show up
Created attachment 11476 [details] [review] Bug 6273: Add support for recording SIP2 Fee Paid Payment Type Adds support for recording in Koha accountlines a different accounttype depending on how the fee was paid at the SIP2 station (cash, credit, etc) Adds a new param to recordpayment(), $sip_paytype, which is appended to the 'Pay' type if present. The payment descriptin is also appended with " (via SIP2)" if this is present. In order for other scripts to keep working as expected, "eq 'Pay'" needed to be replaced with a regex comparison "=~ /^Pay/", so that 'Pay' and 'Pay-##' would continue to group together. To test: 1. Make a payment over a SIP2 connection 2. Check the patron record in the staff client; you should see the modified description 3. Attempt to print a invoice or a reciept for the borrower; the payment should show up where expected
I had to rebase and fix a conflict, not sure I got it right. So I would like someone else to sign off please.
Resetting version to master.
The rebased patch no longer applies.
Created attachment 22834 [details] [review] Bug 6273: Add support for recording SIP2 Fee Paid Payment Type Adds support for recording in Koha accountlines a different accounttype depending on how the fee was paid at the SIP2 station (cash, credit, etc) Adds a new param to recordpayment(), $sip_paytype, which is appended to the 'Pay' type if present. The payment descriptin is also appended with " (via SIP2)" if this is present. In order for other scripts to keep working as expected, "eq 'Pay'" needed to be replaced with a regex comparison "=~ /^Pay/", so that 'Pay' and 'Pay-##' would continue to group together. To test: 1. Make a payment over a SIP2 connection 2. Check the patron record in the staff client; you should see the modified description 3. Attempt to print a invoice or a reciept for the borrower; the payment should show up where expected
Created attachment 24889 [details] [review] Rebased against master 2014-01-30
Created attachment 24890 [details] [review] Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> Rebased against master 2014-01-30
FYI, this was tested using SIP2 through telnet. 1. sent SIP2 Fee paid command after successful login: >> 3720140130 0900010401NOKBV333.33|AOFilleinstitusjon|AA1003|BKbbs001| got successful SIP2 response: << 38Y20140130 154751AOFilleinstitusjon|AA1003|BKbbs001| 2. checked patron info in koha admin. Payment was added, with Payment, thanks msg. 3. Printed slip, where payment showed ok. Benjamin Rokseth (In reply to Deichman Digital Development from comment #8) > Created attachment 24890 [details] [review] [review] > Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> > > Rebased against master 2014-01-30
Thanks for signing off Benjamin A few things though Please mark the bug signed off when you are done Please obsolete the old patches and In the rebase the original commit message has been killed, can we get that back? So amend the signed off patch, add back the original commit message, attach it, and obsolete all the others. And finally switch to signed off. Thanks
Created attachment 24935 [details] [review] Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> Adds support for recording in Koha accountlines a different accounttype depending on how the fee was paid at the SIP2 station (cash, credit, etc) Adds a new param to recordpayment(), $sip_paytype, which is appended to the 'Pay' type if present. The payment descriptin is also appended with " (via SIP2)" if this is present. In order for other scripts to keep working as expected, "eq 'Pay'" needed to be replaced with a regex comparison "=~ /^Pay/", so that 'Pay' and 'Pay-##' would continue to group together. To test: 1. Make a payment over a SIP2 connection 2. Check the patron record in the staff client; you should see the modified description 3. Attempt to print a invoice or a reciept for the borrower; the payment should show up where expected
Benjamin: Please adjust subject line and add your signoff at the end of the commit message. Examples enough on another report :) You are almost there. Hang on..
Created attachment 25167 [details] [review] Bug 6273 - SIP2 Fee Paid and Fee Paid Response support Adds support for recording in Koha accountlines a different accounttype depending on how the fee was paid at the SIP2 station (cash, credit, etc) Adds a new param to recordpayment(), $sip_paytype, which is appended to the 'Pay' type if present. The payment descriptin is also appended with " (via SIP2)" if this is present. In order for other scripts to keep working as expected, "eq 'Pay'" needed to be replaced with a regex comparison "=~ /^Pay/", so that 'Pay' and 'Pay-##' would continue to group together. To test: 1. Make a payment over a SIP2 connection 2. Check the patron record in the staff client; you should see the modified description 3. Attempt to print a invoice or a reciept for the borrower; the payment should show up where expected http://bugs.koha-community.org/show_bug.cgi?id=6273 Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
(In reply to Benjamin Rokseth from comment #13) > Created attachment 25167 [details] [review] [review] > Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> Thanks, Benjamin. Please update the status to Signed off again.
(In reply to Benjamin Rokseth from comment #13) > > The payment descriptin is also appended with " (via SIP2)" if this is present. > That should be made translatable.
All the SIP messages are currently in English and untranslatable. I think this is something for a more general bug and should not be a blocker here.
(In reply to Katrin Fischer from comment #16) > All the SIP messages are currently in English and untranslatable. I think > this is something for a more general bug and should not be a blocker here. Except this is added to the payment description, it's not a SIP message.
Ah, thx for clarifying.
Created attachment 26463 [details] [review] [passed-qa] Bug 6273 - SIP2 Fee Paid and Fee Paid Response support Adds support for recording in Koha accountlines a different accounttype depending on how the fee was paid at the SIP2 station (cash, credit, etc) Adds a new param to recordpayment(), $sip_paytype, which is appended to the 'Pay' type if present. The payment descriptin is also appended with " (via SIP2)" if this is present. In order for other scripts to keep working as expected, "eq 'Pay'" needed to be replaced with a regex comparison "=~ /^Pay/", so that 'Pay' and 'Pay-##' would continue to group together. To test: 1. Make a payment over a SIP2 connection 2. Check the patron record in the staff client; you should see the modified description 3. Attempt to print a invoice or a reciept for the borrower; the payment should show up where expected http://bugs.koha-community.org/show_bug.cgi?id=6273 Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Two notes 1) The string that is present in this patch has been addressed with bug 2546 - So I leave it up to the RM to decided about removing the 2 lines that have "Payment, Thanks" + "(via SIP)"... 2) I would like to see some message that does include a (via SIP) in a translatable string and perhaps we can create that as a another bug once this has been pushed. Otherwise this works.
Pushed to master, along with a follow-up that fixes various issues preventing the payment type from being recording correctly and avoiding a regression on bug 2546. Thanks, Ian!