Esempio n. 1
0
 /**
  * Load recurring payment
  *
  * @return \Magento\RecurringPayment\Model\Payment
  * @throws Exception
  */
 protected function _getRecurringPayment()
 {
     $referenceId = $this->getRequestData('rp_invoice_id');
     $this->_recurringPayment = $this->_recurringPaymentFactory->create()->loadByInternalReferenceId($referenceId);
     if (!$this->_recurringPayment->getId()) {
         throw new Exception(sprintf('Wrong recurring payment INTERNAL_REFERENCE_ID: "%s".', $referenceId));
     }
     return $this->_recurringPayment;
 }
Esempio n. 2
0
 /**
  * Render self only if needed, also render info tabs group if needed
  *
  * @return string
  */
 protected function _toHtml()
 {
     if (!$this->_recurringPayment || $this->_shouldRenderInfo && !$this->_info) {
         return '';
     }
     if ($this->hasShouldPrepareInfoTabs()) {
         $layout = $this->getLayout();
         foreach ($this->getGroupChildNames('info_tabs') as $name) {
             $block = $layout->getBlock($name);
             if (!$block) {
                 continue;
             }
             $block->setViewUrl($this->getUrl("*/*/{$block->getViewAction()}", array('payment' => $this->_recurringPayment->getId())));
         }
     }
     return parent::_toHtml();
 }