AbstractInstruction.php 837 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\OfflinePayments\Block\Form;
  7. /**
  8. * Abstract class for Cash On Delivery and Bank Transfer payment method form
  9. */
  10. abstract class AbstractInstruction extends \Magento\Payment\Block\Form
  11. {
  12. /**
  13. * Instructions text
  14. *
  15. * @var string
  16. */
  17. protected $_instructions;
  18. /**
  19. * Get instructions text from config
  20. *
  21. * @return null|string
  22. */
  23. public function getInstructions()
  24. {
  25. if ($this->_instructions === null) {
  26. /** @var \Magento\Payment\Model\Method\AbstractMethod $method */
  27. $method = $this->getMethod();
  28. $this->_instructions = $method->getConfigData('instructions');
  29. }
  30. return $this->_instructions;
  31. }
  32. }