-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added plugin configuration, complete payment processing
- Loading branch information
Showing
8 changed files
with
609 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
[% INCLUDE 'doc-head-open.inc' %] | ||
<title>Koha: Platební brána GoPay: Konfigurace</title> | ||
[% INCLUDE 'doc-head-close.inc' %] | ||
<link href="[% PLUGIN_PATH %]/css/gopay.css" rel="stylesheet" type="text/css" /> | ||
<script type="text/javascript"> | ||
//<![CDATA[ | ||
|
||
$(document).ready(function() { | ||
$('[data-toggle="tooltip"]').tooltip(); | ||
|
||
$('#confirm-delete').on('show.bs.modal', function(e) { | ||
$(this).find('.btn-ok').attr('href', $(e.relatedTarget).data('href')); | ||
}); | ||
|
||
$(document).ready(function(){ | ||
var obj = $( "#borrowernumber" ).autocomplete({ | ||
source: "/cgi-bin/koha/circ/ysearch.pl", | ||
minLength: 3, | ||
select: function( event, ui ) { | ||
$( "#borrowernumber" ).val( ui.item.borrowernumber ); | ||
return false; | ||
} | ||
}).data( "ui-autocomplete" ); | ||
if( obj ) { | ||
obj._renderItem = function( ul, item ) { | ||
return $( "<li></li>" ) | ||
.data( "ui-autocomplete-item", item ) | ||
.append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.dateofbirth + " " + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" ) | ||
.appendTo( ul ); | ||
}; | ||
} | ||
}); | ||
|
||
}); | ||
//]]> | ||
</script> | ||
|
||
</head> | ||
<body> | ||
[% INCLUDE 'header.inc' %] | ||
<div id="breadcrumbs"> | ||
<a href="/cgi-bin/koha/mainpage.pl">Koha</a> › | ||
<a href="/cgi-bin/koha/tools/tools-home.pl">Nástroje</a> › | ||
<a href="/cgi-bin/koha/plugins/plugins-home.pl">Zásuvné moduly</a> › | ||
Konfigurace platební brány GoPay | ||
</div> | ||
|
||
<div id="doc3" class="rbit-plugin"> | ||
<div class="logo-links"> | ||
<a href="https://www.koha.cz" target="_blank"><img src="[% PLUGIN_PATH %]/koha_cz.png" /></a> | ||
<a href="https://www.koha-v-knihovne.cz" target="_blank"><img src="[% PLUGIN_PATH %]/logo.png" /></a> | ||
<a href="https://www.mkcr.cz" target="_blank"><img src="[% PLUGIN_PATH %]/logo_mkcr.png" /></a> | ||
</div> | ||
|
||
<h3>Platební brána GoPay: Konfigurace</h3> | ||
|
||
<!-- Notice our form here has no 'action', this is good, it means that our forms will always get passed back to 'plugins/run.pl'. --> | ||
<form method="post"> | ||
<!-- Always pass these two parameters so the plugin system knows what to execute! --> | ||
<input type="hidden" name="class" value="[% CLASS %]"/> | ||
<input type="hidden" name="method" value="[% METHOD %]"/> | ||
|
||
<fieldset class="rows"> | ||
<legend>Nastavení platební brány</legend> | ||
|
||
<ol> | ||
<li> | ||
<label class="form-field-label" for="gopay_server">Brána GoPay</label> | ||
<select name="gopay_server"> | ||
<option value="production"[% IF (gopay_server && gopay_server == 'production') %] selected[% END %]>Produkční</option> | ||
<option value="test"[% IF (!gopay_server || gopay_server != 'production') %] selected[% END %]>Testovací</option> | ||
</select> | ||
</li> | ||
|
||
<li> | ||
<label class="form-field-label" for="goid">GoID</label> | ||
<input type="text" name="goid" value="[% goid %]" /> | ||
</li> | ||
|
||
<li> | ||
<label class="form-field-label" for="clientid">Client ID</label> | ||
<input type="text" name="clientid" value="[% clientid %]" /> | ||
</li> | ||
|
||
<li> | ||
<label class="form-field-label" for="clientsecret">Client Secret</label> | ||
<input type="text" name="clientsecret" value="[% clientsecret %]" /> | ||
</li> | ||
</ol> | ||
</fieldset> | ||
|
||
<p> | ||
<input type="hidden" name="phase" value="save_gopay" /> | ||
<input type="submit" value="Uložit nastavení" /> | ||
</p> | ||
</form> | ||
|
||
<form method="post"> | ||
<!-- Always pass these two parameters so the plugin system knows what to execute! --> | ||
<input type="hidden" name="class" value="[% CLASS %]"/> | ||
<input type="hidden" name="method" value="[% METHOD %]"/> | ||
|
||
<fieldset class="rows"> | ||
<legend>Klientské přístupy k API Kohy</legend> | ||
<ol> | ||
<li> | ||
<label class="form-field-label" for="borrowernumber">Číslo čtenáře</label> | ||
<input type="text" name="borrowernumber" id="borrowernumber" value=""> | ||
<i class="fa fa-lg fa-question-circle" data-toggle="tooltip" title="V tomto poli funguje našeptávač, kterým lze snadno najít požadované číslo zadáním jména čtenáře."></i> | ||
</li> | ||
|
||
<li> | ||
<label class="form-field-label" for="secret">Přístupový klíč</label> | ||
<input type="text" name="secret" value="" id="secret" /> | ||
</li> | ||
|
||
<li> | ||
[% IF (api_clients) %] | ||
<table id="table_reports"> | ||
<thead> | ||
<tr> | ||
<th>Číslo čtenáře</th> | ||
<th>Jméno</th> | ||
<th>Uživatelské jméno</th> | ||
<th>Přístupový klíč</th> | ||
<th> </th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
[% FOREACH client IN api_clients %] | ||
<tr> | ||
<td>[% client.borrowernumber %]</td> | ||
<td>[% client.firstname %] [% client.surname %]</td> | ||
<td>[% client.userid %]</td> | ||
<td>[% client.secret %]</td> | ||
<td> | ||
<a class="btn btn-default btn-xs" role="button" data-toggle="modal" data-target="#confirm-delete" | ||
href="#" data-href="/cgi-bin/koha/plugins/run.pl?class=Koha::Plugin::Com::RBitTechnology::GoPay&method=configure&phase=delete&client_id=[% client.client_id %]"><i | ||
class="fa fa-trash"></i> Odstranit</a> | ||
</td> | ||
<tr> | ||
[% END %] | ||
</tbody> | ||
</table> | ||
[% ELSE %] | ||
<div class="dialog message"> | ||
<h4>Dosud neexistují přístupové účty</h4> | ||
<p>Pokud chcete umožnit online platby prostřednictvím API, vytvořte alespoň jeden účet.</p> | ||
</div> | ||
[% END %] | ||
</li> | ||
</ol> | ||
</fieldset> | ||
|
||
<p> | ||
<input type="hidden" name="phase" value="save_clients" /> | ||
<input type="submit" value="Vytvořit přístup k API" /> | ||
</p> | ||
</form> | ||
|
||
</div> | ||
|
||
<div class="modal fade" id="confirm-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title">Odstranění přístupového účtu</h5> | ||
</div> | ||
<div class="modal-body"> | ||
Odstraněním účtu znemožníte tomuto klientovi přístup k platebnímu rozhraní.<br>Opravdu si přejete účet smazat? | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-default" data-dismiss="modal">Ne</button> | ||
<a class="btn btn-danger btn-ok">Ano, smazat</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
[% INCLUDE 'intranet-bottom.inc' %] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.rbit-plugin .logo-links { margin-bottom: 2.5em; } | ||
.rbit-plugin .logo-links a img { border: 1px solid transparent; } | ||
.rbit-plugin .logo-links a:hover img { border: 1px solid #DEDEDE; } | ||
.rbit-plugin fieldset { margin-bottom: 1em; } | ||
.rbit-plugin fieldset.rows label, .rbit-plugin label { width: 10em; display: inline-block; text-align: right; margin-right: 1em; } | ||
.rbit-plugin span.appended-label { margin: 0 1em; } | ||
.rbit-plugin .form-field { margin: 5px 0; } | ||
.rbit-plugin .form-field > * { vertical-align: middle; } | ||
.rbit-plugin input.on-off { margin: 0 1em; } | ||
.rbit-plugin input[type="number"] { width: 5em; } | ||
.rbit-plugin .hint { font-style: italic; color: #555555; } | ||
.rbit-plugin label.radio-label { width: auto; padding-left: 0.5em; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[% USE Koha %] | ||
|
||
[% INCLUDE 'doc-head-open.inc' %] | ||
[% INCLUDE 'doc-head-close.inc' %] | ||
<script type="text/javascript"> | ||
//<![CDATA[ | ||
$(document).ready(function() { | ||
$('#gopay-errors').modal('show'); | ||
[% IF (return_url) %] | ||
$('#gopay-errors').on("hidden.bs.modal", function () { | ||
window.location = "[% return_url %]"; | ||
}); | ||
[% END %] | ||
}); | ||
//]]> | ||
</script> | ||
|
||
<body id="opac-account" class="scrollto"> | ||
|
||
<div class="main"> | ||
|
||
<div id="gopay-errors" class="modal" tabindex="-1" role="dialog"> | ||
<div class="modal-dialog" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title">[% IF (error) %]Chyba[% ELSE %]Zpráva[% END %]</h5> | ||
</div> | ||
<div class="modal-body"> | ||
[% IF (error) %] | ||
<p>Požadavek na online platbu byl odmítnut z důvodu jedné nebo více chyb:</p> | ||
<ul> | ||
[% FOREACH m IN report %]<li>[% m.message %]</li>[% END %] | ||
</ul> | ||
[% ELSE %] | ||
<p>[% report %]</p> | ||
[% END %] | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-primary" data-dismiss="modal">Zavřít</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> <!-- / .main --> | ||
|
||
[% INCLUDE 'intranet-bottom.inc' %] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.