Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Commit

Permalink
Prevent double click
Browse files Browse the repository at this point in the history
  • Loading branch information
regdos committed Aug 16, 2017
1 parent f18c8ef commit 5234704
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 21 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 3.1.5
* Prevent double click

## 3.1.4
* Ignore all notification after COMPLETED
* Cut too long product name
Expand Down
4 changes: 2 additions & 2 deletions upload/catalog/controller/payment/payu.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* ver. 3.1.4
* ver. 3.1.5
* PayU Payment Modules
*
* @copyright Copyright 2016 by PayU
Expand All @@ -19,7 +19,7 @@ class ControllerPaymentPayU extends Controller

const PAY_BUTTON = 'https://static.payu.com/pl/standard/partners/buttons/payu_account_button_01.png';

const VERSION = '3.1.4';
const VERSION = '3.1.5';

private $ocr = array();
private $totalWithoutDiscount = 0;
Expand Down
43 changes: 24 additions & 19 deletions upload/catalog/view/theme/default/template/payment/payu.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,31 @@
</div>
<div id="payu-error"></div>
<script type="text/javascript"><!--
var isClicked = false;
$('#payu-pay').on('click', function() {
$.ajax({
type: 'get',
url: '<?php echo $action; ?>',
cache: false,
dataType: 'json',
beforeSend: function () {
$('#payu-error').empty();
$('#payu-pay').css('cursor', 'wait');
},
complete: function () {
$('#payu-pay').css('cursor', 'pointer');
},
success: function (ret) {
if (ret.status == 'SUCCESS') {
location = ret.redirectUri
} else {
$('#payu-error').empty().append(ret.message);
if (isClicked === false) {
isClicked = true;
$.ajax({
type: 'get',
url: '<?php echo $action; ?>',
cache: false,
dataType: 'json',
beforeSend: function () {
$('#payu-error').empty();
$('#payu-pay').css('cursor', 'wait');
},
complete: function () {
$('#payu-pay').css('cursor', 'pointer');
},
success: function (ret) {
if (ret.status === 'SUCCESS') {
location = ret.redirectUri
} else {
$('#payu-error').empty().append(ret.message);
isClicked = false;
}
}
}
});
});
}
});
//--></script>

0 comments on commit 5234704

Please sign in to comment.