30 lines
1.0 KiB
Twig
30 lines
1.0 KiB
Twig
<div class="d-inline-block pt-2 pd-2 w-100 text-end">
|
|
<button type="button" id="button-confirm" class="btn btn-primary">{{ button_confirm }}</button>
|
|
</div>
|
|
<script type="text/javascript"><!--
|
|
$('#button-confirm').on('click', function() {
|
|
var element = this;
|
|
$.ajax({
|
|
url: 'index.php?route=extension/hutko/payment/hutko.confirm&language={{ language }}',
|
|
type: 'get',
|
|
dataType: 'json',
|
|
beforeSend: function() {
|
|
$(element).prop('disabled', true).addClass('loading');
|
|
},
|
|
complete: function() {
|
|
$(element).prop('disabled', false).removeClass('loading');
|
|
},
|
|
success: function(json) {
|
|
if (json['error']) {
|
|
alert(json['error']);
|
|
}
|
|
if (json['redirect']) {
|
|
location = json['redirect'];
|
|
}
|
|
},
|
|
error: function(xhr, ajaxOptions, thrownError) {
|
|
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
|
}
|
|
});
|
|
});
|
|
//--></script> |