Instructions.php 975 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Payment\Block\Info;
  7. /**
  8. * Block for Bank Transfer payment generic info
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. class Instructions extends \Magento\Payment\Block\Info
  14. {
  15. /**
  16. * Instructions text
  17. *
  18. * @var string
  19. */
  20. protected $_instructions;
  21. /**
  22. * @var string
  23. */
  24. protected $_template = 'Magento_Payment::info/instructions.phtml';
  25. /**
  26. * Get instructions text from order payment
  27. * (or from config, if instructions are missed in payment)
  28. *
  29. * @return string
  30. */
  31. public function getInstructions()
  32. {
  33. if ($this->_instructions === null) {
  34. $this->_instructions = $this->getInfo()->getAdditionalInformation(
  35. 'instructions'
  36. ) ?: trim($this->getMethod()->getConfigData('instructions'));
  37. }
  38. return $this->_instructions;
  39. }
  40. }