Skip to content

Commit c8b5248

Browse files
author
Pavlo Cherniavskyi
committed
MAGETWO-31559: [TD] Removing NominalItems usage
-- unit tests (open access to method authorize)
1 parent ae0e6b7 commit c8b5248

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

app/code/Magento/Sales/Model/Order/Payment.php

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ protected function processAction($action, \Magento\Sales\Model\Order $order)
377377
$this->_order($baseTotalDue);
378378
break;
379379
case \Magento\Payment\Model\Method\AbstractMethod::ACTION_AUTHORIZE:
380-
$this->_authorize(true, $baseTotalDue);
380+
$this->authorize(true, $baseTotalDue);
381381
// base amount will be set inside
382382
$this->setAmountAuthorized($totalDue);
383383
break;
@@ -571,7 +571,7 @@ public function registerCaptureNotification($amount, $skipFraudDetection = false
571571
*/
572572
public function registerAuthorizationNotification($amount)
573573
{
574-
return $this->_isTransactionExists() ? $this : $this->_authorize(false, $amount);
574+
return $this->_isTransactionExists() ? $this : $this->authorize(false, $amount);
575575
}
576576

577577
/**
@@ -1125,9 +1125,10 @@ protected function _order($amount)
11251125
*
11261126
* @param bool $isOnline
11271127
* @param float $amount
1128+
*
11281129
* @return $this
11291130
*/
1130-
protected function _authorize($isOnline, $amount)
1131+
public function authorize($isOnline, $amount)
11311132
{
11321133
// check for authorization amount to be equal to grand total
11331134
$this->setShouldCloseParentTransaction(false);
@@ -1181,18 +1182,6 @@ protected function _authorize($isOnline, $amount)
11811182
return $this;
11821183
}
11831184

1184-
/**
1185-
* Public access to _authorize method
1186-
*
1187-
* @param bool $isOnline
1188-
* @param float $amount
1189-
* @return $this
1190-
*/
1191-
public function authorize($isOnline, $amount)
1192-
{
1193-
return $this->_authorize($isOnline, $amount);
1194-
}
1195-
11961185
/**
11971186
* Void payment either online or offline (process void notification)
11981187
* NOTE: that in some cases authorization can be voided after a capture. In such case it makes sense to use

dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,6 +1652,7 @@
16521652
['_isDataChanged', 'Magento\Catalog\Model\Product'],
16531653
['getVisibleOnFrontStates', 'Magento\Sales\Model\Order\Config', 'getVisibleOnFrontStatuses'],
16541654
['getInvisibleOnFrontStates', 'Magento\Sales\Model\Order\Config', 'getInvisibleOnFrontStatuses'],
1655+
['_authorize', 'Magento\Sales\Model\Order\Payment'],
16551656
['_shouldBeConverted', 'Magento\Sales\Model\Resource\AbstractResource'],
16561657
['_beforeSave', 'Magento\Sales\Model\Resource\AbstractResource'],
16571658
['_afterSave', 'Magento\Sales\Model\Resource\AbstractResource'],

0 commit comments

Comments
 (0)