From 1001eb3384e7cd9d784d3082d67d2711fd1c20a8 Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Wed, 26 Jun 2019 02:02:39 -0300 Subject: [PATCH] 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 Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize --- .../bootstrap/en/includes/account-table.inc | 60 ++++++++++--------- .../bootstrap/en/modules/opac-account.tt | 29 ++++++++- 2 files changed, 58 insertions(+), 31 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc index cf25163aa2..cdc23e46da 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc @@ -132,38 +132,40 @@ - [% IF ENABLE_OPAC_PAYMENTS && DISPLAY_PAYMENT_BLOCK %] - [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt index 70da8a22fe..baeced48c6 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt @@ -81,6 +81,8 @@ -- 2.39.5