Skip to content

Commit

Permalink
1.6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Nov 5, 2017
1 parent d0e79e4 commit d1adc73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage2pro/securepay"
,"version": "1.6.4"
,"version": "1.6.5"
,"description": "The «SecurePay» payment extension for Magento 2."
,"type": "magento2-module"
,"homepage": "https://mage2.pro/c/extensions/securepay"
Expand Down
21 changes: 7 additions & 14 deletions view/frontend/web/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,16 @@ return parent.extend({
* @returns {String}
*/
debugMessage: df.c(function() {
/** @type {String} */
var forceResult = this.config('forceResult');
/** @type {Boolean} */
var approved = -1 !== ['00', '08', '11', '16'].indexOf(this.amountLast2());
/** @type {Boolean} */
var approve = 'approve' === forceResult;
/** @type {Boolean} */
var needAdjust = ('no' !== forceResult) && (approve !== approved);
/** @type {String} */ var forceResult = this.config('forceResult');
/** @type {Boolean} */ var approved = -1 !== ['00', '08', '11', '16'].indexOf(this.amountLast2());
/** @type {Boolean} */ var approve = 'approve' === forceResult;
/** @type {Boolean} */ var needAdjust = ('no' !== forceResult) && (approve !== approved);
/**
* @param {Boolean} approved
* @returns {String}
*/
function label(approved) {return df.t(approved ? 'approved' : 'declined');}
/** @type {String} */
var result;
/** @type {String} */ var result;
if (!needAdjust) {
result = df.t(
'The transaction will be <b>{result}</b>, because the payment amount (<b>{amount}</b>) in the payment currency (<b>{currency}</b>) ends with «<b>{last2}</b>».'
Expand All @@ -43,10 +38,8 @@ return parent.extend({
);
}
else {
/** @type {Number} */
var currentA = this.amountP();
/** @type {Number} */
var newA = approve ? Math.round(currentA) : currentA + 0.01;
/** @type {Number} */ var currentA = this.amountP();
/** @type {Number} */ var newA = approve ? Math.round(currentA) : currentA + 0.01;
result = df.t(
'The payment amount in the payment currency (<b>{currency}</b>) will be adjusted from <b>{current}</b> to <b>{new}</b> for the transaction to be <b>{result}</b>.'
,{
Expand Down

0 comments on commit d1adc73

Please sign in to comment.