I have below code. I'm overriding Paypal Express 1 function.
magento\app\code\Custom\Module\Model\Api\Nvp.php
namespace Custom\Module\Model\Api;
class Nvp extends \Magento\Paypal\Model\Api\Nvp {
public function getPaymentAction() {
// Here need to show error message & redirect to checkout page
return $this->_getDataOrConfig('payment_action');
}
}
I have 2 issues. When i create constructor
it keeps giving error this object is missing & how to redirect from here?
Don't want to use direct objectManager in Method. Would like to above things
protected $_checkoutSession;
public function __construct(\Magento\Checkout\Model\Session $checkoutSession) {
$this->_checkoutSession = $checkoutSession;
}
By putting above code it gives below error
Incompatible argument type: Required type: \Magento\Customer\Helper\Address. Actual type: array;