Skip to content

Commit c9c6685

Browse files
author
Oleh Posyniak
committed
MAGETWO-45200: Fix report
1 parent b3c3c7c commit c9c6685

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

app/code/Magento/Payment/Model/Method/Adapter.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Framework\Exception\LocalizedException;
1111
use Magento\Framework\Exception\NotFoundException;
1212
use Magento\Payment\Gateway\Command\CommandPoolInterface;
13+
use Magento\Payment\Gateway\Config\ValueHandlerPool;
1314
use Magento\Payment\Gateway\Config\ValueHandlerPoolInterface;
1415
use Magento\Payment\Gateway\Data\PaymentDataObjectFactory;
1516
use Magento\Payment\Gateway\Validator\ValidatorPoolInterface;
@@ -353,6 +354,22 @@ private function getConfiguredValue($field, $storeId = null)
353354
return $handler->handle($subject, $storeId ?: $this->getStore());
354355
}
355356

357+
/**
358+
* Return value without applying custom handlers
359+
*
360+
* @param string $field
361+
* @param null $storeId
362+
* @return mixed
363+
*/
364+
private function getDefaultConfiguredValue($field, $storeId = null) {
365+
$handler = $this->valueHandlerPool->get(ValueHandlerPool::DEFAULT_HANDLER);
366+
$subject = [
367+
'field' => $field
368+
];
369+
370+
return $handler->handle($subject, $storeId ?: $this->getStore());
371+
}
372+
356373
/**
357374
* {inheritdoc}
358375
*/
@@ -361,6 +378,18 @@ public function getConfigData($field, $storeId = null)
361378
return $this->getConfiguredValue($field, $storeId);
362379
}
363380

381+
/**
382+
* Retrieve default information from payment configuration
383+
*
384+
* @param string $field
385+
* @param int|string|null|\Magento\Store\Model\Store $storeId
386+
*
387+
* @return mixed
388+
*/
389+
public function getDefaultConfigData($field, $storeId = null) {
390+
return $this->getDefaultConfiguredValue($field, $storeId);
391+
}
392+
364393
/**
365394
* {inheritdoc}
366395
*/

0 commit comments

Comments
 (0)