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.

1 Answer 1


The "provision" solution I made, is creating a new paymethod that only works as an internalMethod and naming it "paypal Express Checkout"

Following this example: https://github.com/magento/magento2-samples/tree/master/sample-module-payment-gateway

The problem is can't have both the same internal code, but for now I can move on with that.

  • Hi, what do you mean "can't have both the same internal code"?
    – fudu
    Aug 23, 2019 at 8:49
  • So long ago... but I think I meant that doing this solution you'll have 2 different paymethods "Paypal" and "Paypal internal" with different IDs... The proper way would be using the same paymethod "paypal"
    – Marc Pont
    Aug 23, 2019 at 9:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.