From 4dbc98b3b8fd22f101c9ee64fde9068325f331d7 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 24 Aug 2017 06:55:49 -0400 Subject: [PATCH] Bug 19173 - Make OPAC online payments pluggable While PayPal is fairly universal, there is a plethora of online payment system that are far more localized, servicing a single country ( e.g. Bug 18968 ) or even a single city! Instead of adding support for each and every one of these payment options directly into Koha, it makes more sense to add the ability to create online payment plugins. Test Plan: 1) Apply this patch 2) Download and install the Kitchen Sink plugin version 2.1.1 or later https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases 3) In the plugin options, enable the opac payments option 4) Create a patron with one or more fines 5) Log into the opac as that patron, note you now have the option to pay online via KitchenSink ImaginaryPay 6) Make an online payment 7) Note the payment was processed correctly Signed-off-by: Magnus Enger Awesome enhancement! I know we want to add at least one Norwegian payment service at some point. I followed the test plan and everything works as advertised. Turning off the "opac payments option" makes the option dissappear cleanly from the OPAC. I have *not* looked at the code or done any considerations about security. --- .../opac-tmpl/bootstrap/en/modules/opac-account.tt | 34 ++++++++------ opac/opac-account-pay-return.pl | 53 ++++++++++++++++++++++ opac/opac-account-pay.pl | 32 ++++++++++--- opac/opac-account.pl | 11 +++++ t/Koha/Plugin/Test.pm | 15 ++++++ t/db_dependent/Plugins.t | 5 +- 6 files changed, 128 insertions(+), 22 deletions(-) create mode 100755 opac/opac-account-pay-return.pl 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 9c5ffad..a868d0f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt @@ -1,7 +1,7 @@ [% USE Koha %] [% USE KohaDates %] [% USE Price %] -[% SET ENABLE_OPAC_PAYMENTS = Koha.Preference('EnablePayPalOpacPayments') %] +[% SET ENABLE_OPAC_PAYMENTS = Koha.Preference('EnablePayPalOpacPayments') || plugins %] [% SET DISPLAY_PAYMENT_BLOCK = 0 %] [% INCLUDE 'doc-head-open.inc' %] [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your fines and charges @@ -141,20 +141,24 @@