Summary: | Allow writeoffs via SIP2 | ||
---|---|---|---|
Product: | Koha | Reporter: | Kyle M Hall (khall) <kyle> |
Component: | SIP2 | Assignee: | Kyle M Hall (khall) <kyle> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | andreas.hedstrom.mace, colin.campbell, m.de.rooy |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 16757 | ||
Bug Blocks: | 16899 | ||
Attachments: |
Bug 16895 - Allow writeoffs via SIP2
[SIGNED-OFF] Bug 16895 - Allow writeoffs via SIP2 Bug 16895 - Allow writeoffs via SIP2 Bug 16895 [QA Followup] - Don't require fee payment to be exact full payment Bug 16895 - Allow writeoffs via SIP2 Bug 16895 [QA Followup] - Don't require fee payment to be exact full payment Bug 16895: [QA Follow-up] Resolve warning on $payment_type_writeoff |
Description
Kyle M Hall (khall)
2016-07-11 13:55:34 UTC
Created attachment 53268 [details] [review] Bug 16895 - Allow writeoffs via SIP2 Many SIP2 services such as those by Comprise Technologies are able to or require that an ILS be able to accept writeoffs via SIP2. The SIP2 protocol specifies that payment type be a two digit number, but does not specify a code for writeoffs. To this end we should allow the write-off code to be specified in the SIP2 config on a per-account basis so that if different vendors use different fixed codes for write-offs we can handle that gracefully. Test Plan: 1) Apply this patch 2) Modify your SIP2 config to include payment_type_writeoff="06" in the login portion of the account you will be using for the test. 3) Restart your SIP2 server 4) Create a fee for a patron 5) Send a SIP2 fee paid message specifying the payment type code we defined earlier, with a payment amount that is *not* equal to the amount outstanding for the fee. 6) Note the fee paid response indicates the payment failed 7) Repeat step 5, but this time send the amount outstanding as the payment amount 8) Note that the fee paid response indicates a successful payment 9) Note in Koha that the fee has been written off! Created attachment 55614 [details] [review] [SIGNED-OFF] Bug 16895 - Allow writeoffs via SIP2 Many SIP2 services such as those by Comprise Technologies are able to or require that an ILS be able to accept writeoffs via SIP2. The SIP2 protocol specifies that payment type be a two digit number, but does not specify a code for writeoffs. To this end we should allow the write-off code to be specified in the SIP2 config on a per-account basis so that if different vendors use different fixed codes for write-offs we can handle that gracefully. Test Plan: 1) Apply this patch 2) Modify your SIP2 config to include payment_type_writeoff="06" in the login portion of the account you will be using for the test. 3) Restart your SIP2 server 4) Create a fee for a patron 5) Send a SIP2 fee paid message specifying the payment type code we defined earlier, with a payment amount that is *not* equal to the amount outstanding for the fee. 6) Note the fee paid response indicates the payment failed 7) Repeat step 5, but this time send the amount outstanding as the payment amount 8) Note that the fee paid response indicates a successful payment 9) Note in Koha that the fee has been written off! Signed-off-by: Rhonda Kuiper <kuiper@roundrocktexas.gov> Any chance to include some kind of unit testing? We have some tests for MsgType.. Can you further explain the use of the pay_type? If I follow the chain, it gets written to the accounts table with a sip prefix? But is that the only thing it does, or do I overlook any specific behavior for sip payment type? Please clarify. (In reply to Marcel de Rooy from comment #3) > Any chance to include some kind of unit testing? We have some tests for > MsgType.. > Can you further explain the use of the pay_type? Yes, it is a legacy parameter that simply declares this payment was made via SIP. > If I follow the chain, it > gets written to the accounts table with a sip prefix? But is that the only > thing it does, or do I overlook any specific behavior for sip payment type? Nope, that is literally all it does, it is existing behavior that we are continuing to use. Yes pay type is just recorded. We are finding it useful though in reconciling when cashing up units that handle rental fees. Hopefully this will be included in a future submission Depends on a PNA Created attachment 61377 [details] [review] Bug 16895 - Allow writeoffs via SIP2 Many SIP2 services such as those by Comprise Technologies are able to or require that an ILS be able to accept writeoffs via SIP2. The SIP2 protocol specifies that payment type be a two digit number, but does not specify a code for writeoffs. To this end we should allow the write-off code to be specified in the SIP2 config on a per-account basis so that if different vendors use different fixed codes for write-offs we can handle that gracefully. Test Plan: 1) Apply this patch 2) Modify your SIP2 config to include payment_type_writeoff="06" in the login portion of the account you will be using for the test. 3) Restart your SIP2 server 4) Create a fee for a patron 5) Send a SIP2 fee paid message specifying the payment type code we defined earlier, with a payment amount that is *not* equal to the amount outstanding for the fee. 6) Note the fee paid response indicates the payment failed 7) Repeat step 5, but this time send the amount outstanding as the payment amount 8) Note that the fee paid response indicates a successful payment 9) Note in Koha that the fee has been written off! Signed-off-by: Rhonda Kuiper <kuiper@roundrocktexas.gov> Question raised while testing: Why does sub pay in C4/SIP/ILS/Transaction/FeePayment.pm contain this check: if ( $fee && $fee->amountoutstanding == $amt ) { If I am paying a partial amount in the interface, this is allowed too. But note that it is not possible to writeoff a partial amount in the interface. I tried a partial writeoff in testing this patch and I wondered why I got a N in the response. But the cause is this test. I think we should print a message why we refused the payment. While I understand that you refuse it for a writeoff, I do not understand it for another payment type. And thats where I can tie it to this report: Should this check be applied only to the writeoffs ? In summary I propose two changes: [1] Send a message why you refuse a partial payment for writeoffs. [2] Accept a partial payment for other types. Changing status Created attachment 62364 [details] [review] Bug 16895 [QA Followup] - Don't require fee payment to be exact full payment In retrospect that kind of artificial limit seems silly for an API. There is absolutely no reason to require even a writeoff to be the same amount just because the interface requires it ( for the time being ). It makes more sense for the client to make those decisions. Limit removed! (In reply to Marcel de Rooy from comment #8) > Question raised while testing: > > Why does sub pay in C4/SIP/ILS/Transaction/FeePayment.pm contain this check: > if ( $fee && $fee->amountoutstanding == $amt ) { > > If I am paying a partial amount in the interface, this is allowed too. But > note that it is not possible to writeoff a partial amount in the interface. > I tried a partial writeoff in testing this patch and I wondered why I got a > N in the response. But the cause is this test. I think we should print a > message why we refused the payment. > > While I understand that you refuse it for a writeoff, I do not understand it > for another payment type. And thats where I can tie it to this report: > Should this check be applied only to the writeoffs ? > > In summary I propose two changes: > [1] Send a message why you refuse a partial payment for writeoffs. > [2] Accept a partial payment for other types. > > Changing status Created attachment 62377 [details] [review] Bug 16895 - Allow writeoffs via SIP2 Many SIP2 services such as those by Comprise Technologies are able to or require that an ILS be able to accept writeoffs via SIP2. The SIP2 protocol specifies that payment type be a two digit number, but does not specify a code for writeoffs. To this end we should allow the write-off code to be specified in the SIP2 config on a per-account basis so that if different vendors use different fixed codes for write-offs we can handle that gracefully. Test Plan: 1) Apply this patch 2) Modify your SIP2 config to include payment_type_writeoff="06" in the login portion of the account you will be using for the test. 3) Restart your SIP2 server 4) Create a fee for a patron 5) Send a SIP2 fee paid message specifying the payment type code we defined earlier, with a payment amount that is *not* equal to the amount outstanding for the fee. 6) Note the fee paid response indicates the payment failed 7) Repeat step 5, but this time send the amount outstanding as the payment amount 8) Note that the fee paid response indicates a successful payment 9) Note in Koha that the fee has been written off! Signed-off-by: Rhonda Kuiper <kuiper@roundrocktexas.gov> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 62378 [details] [review] Bug 16895 [QA Followup] - Don't require fee payment to be exact full payment Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 62379 [details] [review] Bug 16895: [QA Follow-up] Resolve warning on $payment_type_writeoff Resolves: Use of uninitialized value $payment_type_writeoff in string eq at C4/SIP/Sip/MsgType.pm line 1072, <STDIN> line 2. Would be raised if this parameter is not found in SIPconfig.xml. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Pushed to master for 17.05! This won't get ported back to 16.11.x as it is an enhancement. |