[Bug 33176] New: paycollect.pl should have a check for payment type if RequirePaymentType
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Bug ID: 33176 Summary: paycollect.pl should have a check for payment type if RequirePaymentType Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com We have notices, with RequirePaymentType on, that sometimes payments still go through without a payment type. RequirePaymentType adds the required attribute to the template but this can be circumnavigated by using your browser's dev tools. We should add a check in the script to make sure there is a payment type and if not, prevent the payment. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Maybe also in the module? Thinking of the API. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 --- Comment #2 from Lucas Gass <lucas@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #1)
Maybe also in the module? Thinking of the API.
Yes, good point. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|paycollect.pl should have a |Improve enforcing of |check for payment type if |RequirePaymentType |RequirePaymentType | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 --- Comment #3 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 149617 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149617&action=edit Bug 33176: Handle RequirePaymentType Test plan: 1. Turn on RequirePaymentType 2. Create a manual invocie on a patron account 3. Go to pay it, 'Payment type:' is marked as required. 4. In the inscept the select input ( #payment_type ) with your browser's dev tools. Removed the required attribute. 5. You are able to make the payment without a payment type. 6. Apply patch and restart_all 7. Try 4-5 again. This time you should get a 500 error and the payment should not go through. 8. Turn RequirePaymentType off. Try a payment with a payment type, you shoud be successful. 9. Make sure tests will pass: prove -v t/db_dependent/Koha/Account.t -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 --- Comment #4 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 149619 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149619&action=edit Bug 33176: Enforce RequirePaymentType with API -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|minor |normal Assignee|koha-bugs@lists.koha-commun |lucas@bywatersolutions.com |ity.org | Patch complexity|--- |Small patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |david@davidnind.com --- Comment #5 from David Nind <david@davidnind.com> --- Hi Lucas. I get an error trace after applying the patch and repeating the steps. The payment is recorded. The start of the error trace: Exception 'Koha::Exceptions::Account::PaymentTypeRequired' thrown 'Account transaction requires a payment type' at /usr/share/perl5/Exception/Class/Base.pm line 88 in Exception::Class::Base::throw at /usr/share/perl5/Exception/Class/Base.pm line 88 85: 86: $proto->rethrow if ref $proto; 87: 88: die $proto->new(@_); 89: } 90: 91: sub rethrow { Show function arguments in Koha::Account::pay at /kohadevbox/koha/Koha/Account.pm line 105 .... David Testing notes (using KTD): 1. Editing the page HTML using Firefox: - Right click on the payment type label - Select 'Inspect' - In the web development tools window that opens, select <select name="payment_type" id="payment_type" class="required" required="required">, right click, and then select 'Edit HTML' - Remove: class="required" required="required" - Click on the Submit button in the page -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 --- Comment #6 from Lucas Gass <lucas@bywatersolutions.com> --- (In reply to David Nind from comment #5)
Hi Lucas.
I get an error trace after applying the patch and repeating the steps. The payment is recorded. The start of the error trace:
Exception 'Koha::Exceptions::Account::PaymentTypeRequired' thrown 'Account transaction requires a payment type' at /usr/share/perl5/Exception/Class/Base.pm line 88
in Exception::Class::Base::throw at /usr/share/perl5/Exception/Class/Base.pm line 88
85: 86: $proto->rethrow if ref $proto; 87: 88: die $proto->new(@_); 89: } 90: 91: sub rethrow {
Show function arguments in Koha::Account::pay at /kohadevbox/koha/Koha/Account.pm line 105 ....
David
Testing notes (using KTD):
1. Editing the page HTML using Firefox: - Right click on the payment type label - Select 'Inspect' - In the web development tools window that opens, select <select name="payment_type" id="payment_type" class="required" required="required">, right click, and then select 'Edit HTML' - Remove: class="required" required="required" - Click on the Submit button in the page
David, if this is happening after you remove class="required" required="required" it is the desired behavior. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149617|0 |1 is obsolete| | --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 150254 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=150254&action=edit Bug 33176: Handle RequirePaymentType Test plan: 1. Turn on RequirePaymentType 2. Create a manual invocie on a patron account 3. Go to pay it, 'Payment type:' is marked as required. 4. In the inscept the select input ( #payment_type ) with your browser's dev tools. Removed the required attribute. 5. You are able to make the payment without a payment type. 6. Apply patch and restart_all 7. Try 4-5 again. This time you should get a 500 error and the payment should not go through. 8. Turn RequirePaymentType off. Try a payment with a payment type, you shoud be successful. 9. Make sure tests will pass: prove -v t/db_dependent/Koha/Account.t Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149619|0 |1 is obsolete| | --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 150255 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=150255&action=edit Bug 33176: Enforce RequirePaymentType with API Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 --- Comment #9 from David Nind <david@davidnind.com> --- Updated testing notes (using KTD): 1. For step 4, editing the page HTML using Firefox: - Right click on the payment type label - Select 'Inspect' - In the web development tools window that opens, select <select name="payment_type" id="payment_type" class="required" required="required">, right click, and then select 'Edit HTML' - Remove: class="required" required="required" - Click on the Submit button in the page - Note: If you just remove 'required="required"', a standard form error message is displayed saying this is required 2. For step 7, when editing the HTML just remove: required="required" - If you remove 'class="required" required="required"', you will get an error trace and the payment will be recorded (as expected - see comment #6) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- If you want to prevent manual edition of the DOM to get empty value, then you should also prevent bad value. It's possible to get payment_type=FOO. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 --- Comment #11 from Lucas Gass <lucas@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #10)
If you want to prevent manual edition of the DOM to get empty value, then you should also prevent bad value. It's possible to get payment_type=FOO.
Good point. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 --- Comment #12 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 152131 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152131&action=edit Bug 33176: Enforce bad values 1. Turn on RequirePaymentType 2. Create a manual invocie on a patron account 3. Go to pay it, 'Payment type:' is marked as required. 4. In the inscept the select input ( #payment_type ) with your browser's dev tools. Removed the required attribute. 5. You are able to make the payment without a payment type. 6. Apply patch and restart_all 7. Try 4-5 again. This time you should get a 500 error and the payment should not go through. 8. Try a paymnet again this time manipulate the DOM and change the value of 'CASH' to something else like 'SOMETHINGELSE'. 9. Try to submit the payment and again you will get a 500 error. The payment should not go through. 10. Turn RequirePaymentType off. Try a payment with a payment type, you shoud be successful. 11. Make sure tests will pass -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Sam Lau <samalau@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Sam Lau <samalau@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #150254|0 |1 is obsolete| | --- Comment #13 from Sam Lau <samalau@gmail.com> --- Created attachment 152203 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152203&action=edit Bug 33176: Handle RequirePaymentType Test plan: 1. Turn on RequirePaymentType 2. Create a manual invocie on a patron account 3. Go to pay it, 'Payment type:' is marked as required. 4. In the inscept the select input ( #payment_type ) with your browser's dev tools. Removed the required attribute. 5. You are able to make the payment without a payment type. 6. Apply patch and restart_all 7. Try 4-5 again. This time you should get a 500 error and the payment should not go through. 8. Turn RequirePaymentType off. Try a payment with a payment type, you shoud be successful. 9. Make sure tests will pass: prove -v t/db_dependent/Koha/Account.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Sam Lau <samalau@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Sam Lau <samalau@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #150255|0 |1 is obsolete| | --- Comment #14 from Sam Lau <samalau@gmail.com> --- Created attachment 152204 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152204&action=edit Bug 33176: Enforce RequirePaymentType with API Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Sam Lau <samalau@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Sam Lau <samalau@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152131|0 |1 is obsolete| | --- Comment #15 from Sam Lau <samalau@gmail.com> --- Created attachment 152205 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152205&action=edit Bug 33176: Enforce bad values 1. Turn on RequirePaymentType 2. Create a manual invocie on a patron account 3. Go to pay it, 'Payment type:' is marked as required. 4. In the inscept the select input ( #payment_type ) with your browser's dev tools. Removed the required attribute. 5. You are able to make the payment without a payment type. 6. Apply patch and restart_all 7. Try 4-5 again. This time you should get a 500 error and the payment should not go through. 8. Try a paymnet again this time manipulate the DOM and change the value of 'CASH' to something else like 'SOMETHINGELSE'. 9. Try to submit the payment and again you will get a 500 error. The payment should not go through. 10. Turn RequirePaymentType off. Try a payment with a payment type, you shoud be successful. 11. Make sure tests will pass Signed-off-by: Sam Lau <samalau@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152203|0 |1 is obsolete| | --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 152271 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152271&action=edit Bug 33176: Handle RequirePaymentType Test plan: 1. Turn on RequirePaymentType 2. Create a manual invocie on a patron account 3. Go to pay it, 'Payment type:' is marked as required. 4. In the inscept the select input ( #payment_type ) with your browser's dev tools. Removed the required attribute. 5. You are able to make the payment without a payment type. 6. Apply patch and restart_all 7. Try 4-5 again. This time you should get a 500 error and the payment should not go through. 8. Turn RequirePaymentType off. Try a payment with a payment type, you shoud be successful. 9. Make sure tests will pass: prove -v t/db_dependent/Koha/Account.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152204|0 |1 is obsolete| | --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 152272 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152272&action=edit Bug 33176: Enforce RequirePaymentType with API Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152205|0 |1 is obsolete| | --- Comment #18 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 152273 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152273&action=edit Bug 33176: Enforce bad values 1. Turn on RequirePaymentType 2. Create a manual invocie on a patron account 3. Go to pay it, 'Payment type:' is marked as required. 4. In the inscept the select input ( #payment_type ) with your browser's dev tools. Removed the required attribute. 5. You are able to make the payment without a payment type. 6. Apply patch and restart_all 7. Try 4-5 again. This time you should get a 500 error and the payment should not go through. 8. Try a paymnet again this time manipulate the DOM and change the value of 'CASH' to something else like 'SOMETHINGELSE'. 9. Try to submit the payment and again you will get a 500 error. The payment should not go through. 10. Turn RequirePaymentType off. Try a payment with a payment type, you shoud be successful. 11. Make sure tests will pass Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 --- Comment #19 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|23.11.00 |23.11.00,23.05.02 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 --- Comment #20 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks for all the hard work! Pushed to 23.05.x for the next release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|23.11.00,23.05.02 |23.11.00,23.05.02,22.11.08 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 --- Comment #21 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Nice work everyone! Pushed to 22.11.x for next release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33176 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34620 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34620 [Bug 34620] Writeoff causes 500 error if RequirePaymentType is on. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org