_paymentData = $paymentData; parent::__construct($context, $orderFactory, $checkoutSession, $hssHelper, $readFactory, $reader, $data); } /** * Set payment method code * * @return void */ protected function _construct() { parent::_construct(); $this->_paymentMethodCode = \Magento\Paypal\Model\Config::METHOD_PAYFLOWLINK; } /** * Get frame action URL * * @return string */ public function getFrameActionUrl() { return $this->getUrl('paypal/payflow/form', ['_secure' => true]); } /** * Get secure token * * @return string */ public function getSecureToken() { return $this->_getOrder()->getPayment()->getAdditionalInformation('secure_token'); } /** * Get secure token ID * * @return string */ public function getSecureTokenId() { return $this->_getOrder()->getPayment()->getAdditionalInformation('secure_token_id'); } /** * Get payflow transaction URL * * @return string */ public function getTransactionUrl() { $cgiUrl = 'cgi_url'; if ($this->isTestMode()) { $cgiUrl = 'cgi_url_test_mode'; } return $this->_paymentData->getMethodInstance($this->_paymentMethodCode)->getConfigData($cgiUrl); } /** * Check sandbox mode * * @return bool */ public function isTestMode() { $mode = $this->_paymentData->getMethodInstance($this->_paymentMethodCode)->getConfigData('sandbox_flag'); return (bool)$mode; } }