/** * Retrieve payment method form html * * @param MethodInterface $method * @param LayoutInterface $layout * @return Form */ public function getMethodFormBlock(MethodInterface $method, LayoutInterface $layout) { $block = $layout->createBlock($method->getFormBlockType(), $method->getCode()); $block->setMethod($method); return $block; }
/** * Retrieve payment method form html * * @param \Magento\Payment\Model\MethodInterface $method * @return Form */ public function getMethodFormBlock(\Magento\Payment\Model\MethodInterface $method) { $block = false; $blockType = $method->getFormBlockType(); if ($this->_layout) { $block = $this->_layout->createBlock($blockType, $method->getCode()); $block->setMethod($method); } return $block; }