Bug 23213: Enable minimum payment threshold check in OPAC
authorAgustin Moyano <agustinmoyano@theke.io>
Wed, 26 Jun 2019 05:02:39 +0000 (02:02 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 27 Sep 2019 13:08:18 +0000 (14:08 +0100)
commit1001eb3384e7cd9d784d3082d67d2711fd1c20a8
treed4196a7e555c36a93cdffc804533771f53f55a54
parente043ba36938e5025a2b39d6f7dc15101da9047d4
Bug 23213: Enable minimum payment threshold check in OPAC

This patch enables OPAC to check for the miminum payment threshold per payment method.

If the total amount to pay is less than the threshold, payment for that method is disabled.

To test:
1) apply dependencies
2) get 2 payment plugins, one with threshold as https://gitlab.com/thekesolutions/plugins/koha-plugin-pay-via-paypal/uploads/4c66444ff697586dff3d8759c1e5746c/koha-plugin-pay-via-paypal-v1.0.0.kpz and one without threshold as https://github.com/bywatersolutions/koha-plugin-pay-via-paygov/releases/download/v1.0.5/koha-plugin-pay-via-paygov-v1.0.5.kpz
3) install both plugins
4) Configure both plugins to work correctly (can be invented data.. we are not interested in the actual payment page, but to test if payment method is allowed)
5) In plugin with threshold, set minimum threshold to 10
6) Fetch any user, and create 2 manual invoices, both for the amount of 5
7) Enter OPAC as user, and go to "my fines" tab
CHECK => both plugins appear as payment method
8) Check the checkbox of one of the fines
SUCCESS => plugin with threshold is now disabled, and has a warning message that says "Minimum amount needed by this service is 10.00"
        => plugin without threshold is enabled
        => if plugin with threshold was selected, "Make payment" button is disabled until an enabled payment method is selected
9) Check the second checkbox
SUCCESS => both payment methods are now enabled
10) Sign off

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt