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 911f44b commit aad7129
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 23 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 3.2.4
* Prevent double click

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

/*
* ver. 3.2.3
* ver. 3.2.4
* PayU Payment Modules
*
* @copyright Copyright 2016 by PayU
Expand All @@ -13,7 +13,7 @@ class ControllerExtensionPaymentPayU extends Controller
{
const PAY_BUTTON = 'https://static.payu.com/pl/standard/partners/buttons/payu_account_button_01.png';

const VERSION = '3.2.3';
const VERSION = '3.2.4';

private $ocr = array();
private $totalWithoutDiscount = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,33 @@
</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>
});
}
});//--></script>

0 comments on commit aad7129

Please sign in to comment.