[19-Mar-2020 09:30:31 UTC] PHP Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Paypal\Model\Adminhtml\Express::isOrderAuthorizationAllowed() must be an instance of Magento\Sales\Model\Order\Payment, null given, called in /home/hofadmin/public_html/vendor/magento/module-paypal/Plugin/OrderCanInvoice.php on line 41 and defined in /home/hofadmin/public_html/vendor/magento/module-paypal/Model/Adminhtml/Express.php:169 Stack trace:

0 /home/hofadmin/public_html/vendor/magento/module-paypal/Plugin/OrderCanInvoice.php(41): Magento\Paypal\Model\Adminhtml\Express->isOrderAuthorizationAllowed(NULL)

1 /home/hofadmin/public_html/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Paypal\Plugin\OrderCanInvoice->afterCanInvoice(Object(Magento\Sales\Model\Order\Interceptor), false)

2 /home/hofadmin/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Sales\Model\Order\Interceptor->Magento\Framework\Interception{closure}()

3 /home/hofadmin/public_html/generated/code/Magento/Sales/Model/Order/Interceptor.php( in /home/hofadmin/public_html/vendor/magento/module-paypal/Model/Adminhtml/Express.php on line 169

  • Delete the generated folder and try again.
    – Bojjaiah
    Mar 19 '20 at 10:02
  • Thank For the reply, but some times its redirecting to the success page and sometimes it throwing the same error Mar 19 '20 at 10:03
  • hello, i have tried but still same error kindly help Mar 26 '20 at 6:20

Hope you are doing well Please check below link this might help you.The reason behind this issue is to call payment function on before checking invoice:

Error PayPal thrown

Hopet this helps.

  • I have GOne through this but don't know in which file i have to change and how, kindly do needful Mar 19 '20 at 10:07
  • You need to debug this while magento is creating order their you need to check.There must be some function where you are not providing appropriate data to a function. Mar 19 '20 at 10:11
  • Deleted Generated Dolder from root and run this Following commands, And which is successfully generated no bug found php -dmemory_limit=6G bin/magento setup:upgrade php -dmemory_limit=6G bin/magento setup:di:compile php -dmemory_limit=6G bin/magento setup:static-content:deploy -f php -dmemory_limit=6G bin/magento indexer:reindex Mar 19 '20 at 10:34
  • Kindly Help , i am Stuck, kindly share file path so i can edit this Mar 26 '20 at 6:31
  • @ShubhamKhandelwal Any help thanks magento.stackexchange.com/q/325882/57334
    – zus
    Nov 6 '20 at 6:03

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.