Skip to content

Commit 86d8110

Browse files
author
dyushkin
committed
MAGETWO-36877: Bank Transfer payment instructions is not displayed
1 parent dacb4a4 commit 86d8110

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

app/code/Magento/OfflinePayments/Block/Form/AbstractInstruction.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ abstract class AbstractInstruction extends \Magento\Payment\Block\Form
2020
/**
2121
* Get instructions text from config
2222
*
23-
* @return string
23+
* @return mixed|string
2424
*/
2525
public function getInstructions()
2626
{
2727
if ($this->_instructions === null) {
28-
$this->_instructions = $this->getMethod()->getInstructions();
28+
/** @var \Magento\Payment\Model\Method\AbstractMethod $method */
29+
$method = $this->getMethod();
30+
$this->_instructions = $method->getConfigData('instructions');
2931
}
3032
return $this->_instructions;
3133
}

app/code/Magento/OfflinePayments/Model/Banktransfer.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,4 @@ class Banktransfer extends \Magento\Payment\Model\Method\AbstractMethod
4141
* @var bool
4242
*/
4343
protected $_isOffline = true;
44-
45-
/**
46-
* Get instructions text from config
47-
*
48-
* @return string
49-
*/
50-
public function getInstructions()
51-
{
52-
return trim($this->getConfigData('instructions'));
53-
}
5444
}

app/code/Magento/OfflinePayments/Test/Unit/Block/Form/AbstractInstructionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ public function testGetInstructions()
2525
{
2626
$method = $this->getMock(
2727
'Magento\Payment\Model\MethodInterface',
28-
['getInstructions', 'getCode', 'getFormBlockType', 'getTitle'],
28+
['getConfigData', 'getCode', 'getFormBlockType', 'getTitle'],
2929
[],
3030
'',
3131
false
3232
);
3333
$method->expects($this->once())
34-
->method('getInstructions')
34+
->method('getConfigData')
3535
->willReturn('instructions');
3636
$this->_model->setData('method', $method);
3737

0 commit comments

Comments
 (0)