I need to enable the paypal express checkout on the backend.
I thought it would be easy, just overriding the module-paypal setting the variable canUseInternal to true, for be exact:
I override this file:
/vendor/magento/module-paypal/Model/Express.php
changing the line, setting to true:
protected $_canUseInternal = true;
Now at payment section it displays the PayPal Express Checkout to be elegible, but if I proceed to submit the order it shows that error:
PayPal gateway has rejected request. Invalid token (#10410: Invalid token).
I think it's trying to pay the order on Paypal, but of course there is nothing related of paypal neither credentials.
What can I do? I need to change some functionality, that if it's creating an order through admin, it only places the order, but no idea.