Bug 6273 - SIP2 Fee Paid and Fee Paid Response support
Summary: SIP2 Fee Paid and Fee Paid Response support
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Ian Walls
QA Contact: Marcel de Rooy
URL:
Whiteboard:
Keywords: rel_3_16_candidate
Depends on: 5605
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-27 22:26 UTC by Ian Walls
Modified: 2014-12-07 20:07 UTC (History)
9 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Medium patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
SIP2 Fee Paid Pay Type support (6.31 KB, patch)
2011-12-02 15:57 UTC, Ian Walls
Details | Diff | Splinter Review
Bug 6273: Add support for recording SIP2 Fee Paid Payment Type (6.47 KB, patch)
2012-08-09 08:30 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 6273: Add support for recording SIP2 Fee Paid Payment Type (6.56 KB, patch)
2013-11-08 16:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Rebased against master 2014-01-30 (5.71 KB, patch)
2014-01-30 14:32 UTC, Deichman Digital Development
Details | Diff | Splinter Review
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> (5.78 KB, patch)
2014-01-30 14:50 UTC, Deichman Digital Development
Details | Diff | Splinter Review
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> (6.53 KB, patch)
2014-01-31 12:20 UTC, Deichman Digital Development
Details | Diff | Splinter Review
Bug 6273 - SIP2 Fee Paid and Fee Paid Response support (6.55 KB, patch)
2014-02-10 09:04 UTC, Benjamin Rokseth
Details | Diff | Splinter Review
[passed-qa] Bug 6273 - SIP2 Fee Paid and Fee Paid Response support (6.62 KB, patch)
2014-03-19 17:43 UTC, Brendan Gallagher
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Walls 2011-04-27 22:26:26 UTC
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.
Comment 1 Ian Walls 2011-12-02 15:57:37 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2012-08-09 08:30:45 UTC Comment hidden (obsolete)
Comment 3 Chris Cormack 2012-08-09 08:31:22 UTC
I had to rebase and fix a conflict, not sure I got it right. So I would like someone else to sign off please.
Comment 4 Katrin Fischer 2012-12-06 14:11:20 UTC
Resetting version to master.
Comment 5 Galen Charlton 2013-05-31 03:39:11 UTC
The rebased patch no longer applies.
Comment 6 Kyle M Hall 2013-11-08 16:46:51 UTC Comment hidden (obsolete)
Comment 7 Deichman Digital Development 2014-01-30 14:32:48 UTC Comment hidden (obsolete)
Comment 8 Deichman Digital Development 2014-01-30 14:50:57 UTC Comment hidden (obsolete)
Comment 9 Benjamin Rokseth 2014-01-30 15:10:49 UTC
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
Comment 10 Chris Cormack 2014-01-30 18:25:18 UTC
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
Comment 11 Deichman Digital Development 2014-01-31 12:20:43 UTC Comment hidden (obsolete)
Comment 12 Marcel de Rooy 2014-02-07 16:20:50 UTC
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..
Comment 13 Benjamin Rokseth 2014-02-10 09:04:56 UTC Comment hidden (obsolete)
Comment 14 Marcel de Rooy 2014-02-10 09:12:58 UTC
(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.
Comment 15 paxed 2014-02-10 09:19:27 UTC
(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.
Comment 16 Katrin Fischer 2014-02-10 09:25:30 UTC
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.
Comment 17 paxed 2014-02-10 09:31:05 UTC
(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.
Comment 18 Katrin Fischer 2014-02-10 09:35:20 UTC
Ah, thx for clarifying.
Comment 19 Brendan Gallagher 2014-03-19 17:43:33 UTC
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>
Comment 20 Brendan Gallagher 2014-03-19 20:16:46 UTC
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.
Comment 21 Galen Charlton 2014-04-30 17:15:23 UTC
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!