Allow patrons to pay their fees cashlessly using cards in payment terminals.
Currently working on a solution for terminals Ingenico iCT220 provided by GPE (Global Payments Europe)
Created attachment 63499 [details] [review] Bug 17705: Database structure update This patch creates neccessary table and updates systempreferences. Test plan: 1) Apply the patch 2) Check the presence of pos_terminal_transactions table 3) Observe new systempreferences' values - PosTerminalIP - PosTerminalPort - PosTerminalCurrencyCode
Created attachment 63500 [details] [review] Bug 17705: Database schema objects updated Brings neccessary changes in the database schema. Test plan: 1) Apply the patch 2) Open Koha/Schema/Result 3) Observe new relation in Accountline.pm 4) Check presence of PosTerminalTransaction.pm
Created attachment 64526 [details] [review] Bug 17705: Database structure update This patch creates neccessary table and updates systempreferences. Test plan: For the test plan please see commits above.
Created attachment 64527 [details] [review] Bug 17705: Database schema objects updated Brings neccessary changes in the database schema. Test plan: 1) Apply the patch 2) Open Koha/Schema/Result 3) Observe new relation in Accountline.pm 4) Check presence of PosTerminalTransaction.pm
Created attachment 64528 [details] [review] Bug 17705: payments using payment terminal This patch expects already installed and configured payment terminal, e.g Ingenico, provided by GPE (Global Payments Europe). This piece of code already acquired an official certification in GPE Headquarter, Prague, Czech Republic. Bank accounts connected to banks KB or CSOB should work perfectly. Other banks will probably require additional certifications and changes in the code. Test plan 1) Appy this patch 2) Connect and/or start terminal device 3) Go to administration setting and look for "PosTerminal" items 4) Setup desired values (IP and port) 5) Make patron to pay a single fine (eg. lost book) 6) Tick the box "Pay by card" and confirm the payment 7) Popup window will raise displaying transaction status 8) Let the patron pay his amount using the terminal 9) When transaction finishes, close popup window 10) Optional: try to refund an amount by clicking "Refund to card" button within fines overview (members/boraccount.pl). Steps 7-9 will repeat accordingly.
Created attachment 64529 [details] [review] Bug 17705: Fixed forbidden patterns This patch only removes trailing space chars in Koha/PosTerminal/Message/Header.pm
Anybody in other country need to pay in Koha via credit card? Please review code, maybe together we'll make solution universal for other terminals and payment providers. Feedback welcome. Thanks to Radek for great work.
Created attachment 64613 [details] [review] Bug 17705: Fixed web installer problems This patch only fixes problems during web installation procedure Test plan: 1) Apply the patch 2) Go through all webinstaller's steps 3) No SQL errors should occur
Created attachment 76366 [details] [review] Bug 17705: Database structure update This patch creates neccessary table and updates systempreferences. Test plan: 1) Apply the patch 2) Check the presence of pos_terminal_transactions table 3) Observe new systempreferences' values - PosTerminalIP - PosTerminalPort - PosTerminalCurrencyCode
Created attachment 76367 [details] [review] Bug 17705: payments using payment terminal This patch expects already installed and configured payment terminal, e.g Ingenico, provided by GPE (Global Payments Europe). This piece of code already acquired an official certification in GPE Headquarter, Prague, Czech Republic. Bank accounts connected to banks KB or CSOB should work perfectly. Other banks will probably require additional certifications and changes in the code. Test plan 1) Appy this patch 2) Connect and/or start terminal device 3) Go to administration setting and look for "PosTerminal" items 4) Setup desired values (IP and port) 5) Make patron to pay a single fine (eg. lost book) 6) Tick the box "Pay by card" and confirm the payment 7) Popup window will raise displaying transaction status 8) Let the patron pay his amount using the terminal 9) When transaction finishes, close popup window 10) Optional: try to refund an amount by clicking "Refund to card" button within fines overview (members/boraccount.pl). Steps 7-9 will repeat accordingly.
Created attachment 76368 [details] [review] Bug 17705: Update Schema
Comment on attachment 76367 [details] [review] Bug 17705: payments using payment terminal Review of attachment 76367 [details] [review]: ----------------------------------------------------------------- Radek, I just rebased your patches and have some comments on this patch: ::: Koha/PosTerminal/Client.pm @@ +15,5 @@ > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with Koha; if not, see <http://www.gnu.org/licenses>. > + use Modern::Perl; @@ +19,5 @@ > + > +use IO::Socket::INET; > +use IO::Socket::Timeout; > +use Koha::PosTerminal::Message; > +use Errno qw(ETIMEDOUT EWOULDBLOCK); You are adding some new dependencies here, you should add them to C4/Installer/PerlDependecies.pm, are they all available also for Debian in needed versions? ::: Koha/PosTerminal/Message.pm @@ +17,5 @@ > +# You should have received a copy of the GNU General Public License > +# along with Koha; if not, see <http://www.gnu.org/licenses>. > + > +use strict; > +use warnings; use Modern::Perl; @@ +22,5 @@ > + > +use Digest::CRC; > +use Koha::PosTerminal::Message::Header; > +use Koha::PosTerminal::Message::Field; > +use Data::Dumper qw( Dumper ); Don't forget to remove debug printing; @@ +178,5 @@ > + else { > + $self->setValid(0); > + } > + } > +# print Dumper($self); Don't forget to remove debug printing; @@ +221,5 @@ > + my $msg = $self->getHeader()->dumpObject(); > + > + $msg .= "data:\n"; > +# print Dumper($self); > +#die(); Don't forget to remove debug printing; ::: Koha/PosTerminal/Message/Field.pm @@ +17,5 @@ > +# You should have received a copy of the GNU General Public License > +# along with Koha; if not, see <http://www.gnu.org/licenses>. > + > +use strict; > +use warnings; use Modern::Perl; ::: Koha/PosTerminal/Message/Header.pm @@ +17,5 @@ > +# You should have received a copy of the GNU General Public License > +# along with Koha; if not, see <http://www.gnu.org/licenses>. > + > +use strict; > +use warnings; use Modern::Perl; ::: koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ +75,5 @@ > [% IF ( account.payment ) %] > <a href="boraccount.pl?action=reverse&accountlines_id=[% account.accountlines_id %]&borrowernumber=[% account.borrowernumber %]" class="btn btn-default btn-xs"><i class="fa fa-undo"></i> Reverse</a> > <a href="boraccount.pl?action=void&accountlines_id=[% account.accountlines_id %]&borrowernumber=[% account.borrowernumber %]" class="btn btn-default btn-xs"><i class="fa fa-ban"></i> Void</a> > + [% IF (account.amountoutstanding+0 + account.amount+0 != 0 ) %] > + <a href="boraccount.pl?action=reverse&accountlines_id=[% account.accountlines_id %]&borrowernumber=[% account.borrowernumber %]" class="btn btn-default btn-xs" onclick="refundPayment(this.href, [% account.accountlines_id %], [% -1*account.amount %]);return false;"><i class="fa fa-undo"></i> Refund to card</a> Do not use onclick parameter ::: koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt @@ +46,4 @@ > [% END %] > > [% IF ( pay_individual ) %] > + <form name="payindivfine" id="payindivfine" method="post" onsubmit="return makePayment(this);" action="/cgi-bin/koha/members/paycollect.pl"> Do not use onsubmit parameter @@ +105,5 @@ > + <li> > + <label for="bycard">Pay by card: </label> > + <input type="checkbox" name="bycard" id="bycard" value="1"/> > + </li> > +[% END %] Consider using PAYMENT_TYPE authorised value ::: svc/pos_terminal @@ +160,5 @@ > + > + # send abort message > + my $abort = new Koha::PosTerminal::Message(Koha::PosTerminal::Message::DIR_SENT); > + my $hdrAbort = $abort->getHeader(); > +die(Dumper($transaction ? $transaction->getHeader() : "BUBU")); What does "BUBU" mean? :D
I wonder if this would be better achieved with a payment type plugin nowadays (like PayPal)