Agreement.php 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Paypal\Block\Payment\Info\Billing;
  7. /**
  8. * Billing Agreement info block
  9. */
  10. class Agreement extends \Magento\Payment\Block\Info
  11. {
  12. /**
  13. * Add reference id to payment method information
  14. *
  15. * @param \Magento\Framework\DataObject|array|null $transport
  16. * @return \Magento\Framework\DataObject
  17. */
  18. protected function _prepareSpecificInformation($transport = null)
  19. {
  20. if (null !== $this->_paymentSpecificInformation) {
  21. return $this->_paymentSpecificInformation;
  22. }
  23. $info = $this->getInfo();
  24. $referenceID = $info->getAdditionalInformation(
  25. \Magento\Paypal\Model\Payment\Method\Billing\AbstractAgreement::PAYMENT_INFO_REFERENCE_ID
  26. );
  27. $transport = new \Magento\Framework\DataObject([(string)__('Reference ID') => $referenceID]);
  28. $transport = parent::_prepareSpecificInformation($transport);
  29. return $transport;
  30. }
  31. }