Description
Error when logged user does a second checkout paying again with paypal
Preconditions
- Magento 2.1.7
Steps to reproduce
- Register a customer user and login
- Buy something paying with paypal express checkout
- Come back to the site and put in cart something else, in checkout select again Paypal as payment method
- Complete checkout and wait while redirected to Paypal
Expected result
- The transaction goes well and summary order page appears with green advice
Actual result
- Paypal popup close itself and the user is brought back to the cart
system.log
[2017-07-05 12:57:56] main.CRITICAL: PayPal NVP gateway errors: Payment has already been made for this InvoiceID (#10412: Duplicate invoice). Correlation ID: f8e0c3f2eefc. Version: 72.0. [] []
[2017-07-05 12:57:56] main.CRITICAL: Exception message: Il gateway di PayPal ha rifiutato la richiesta. Payment has already been made for this InvoiceID (#10412: Duplicate invoice).
Trace: #0 /var/www/httpdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(89): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\Framewo...', Array)
#1 /var/www/httpdocs/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...', Array)
#2 /var/www/httpdocs/var/generation/Magento/Framework/Exception/LocalizedExceptionFactory.php(43): Magento\Framework\ObjectManager\ObjectManager->create('\Magento\Framew...', Array)
#3 /var/www/httpdocs/vendor/magento/module-paypal/Model/Api/Nvp.php(1298): Magento\Framework\Exception\LocalizedExceptionFactory->create(Array)
#4 /var/www/httpdocs/vendor/magento/module-paypal/Model/Api/Nvp.php(1242): Magento\Paypal\Model\Api\Nvp->_handleCallErrors(Array)
#5 /var/www/httpdocs/vendor/magento/module-paypal/Model/Api/Nvp.php(833): Magento\Paypal\Model\Api\Nvp->call('SetExpressCheck...', Array)
#6 /var/www/httpdocs/vendor/magento/module-paypal/Model/Express/Checkout.php(567): Magento\Paypal\Model\Api\Nvp->callSetExpressCheckout()
#7 /var/www/httpdocs/vendor/magento/module-paypal/Controller/Express/GetToken.php(141): Magento\Paypal\Model\Express\Checkout->start('https://www.s...', 'https://www.s...', true)
#8 /var/www/httpdocs/vendor/magento/module-paypal/Controller/Express/GetToken.php(52): Magento\Paypal\Controller\Express\GetToken->getToken()
#9 /var/www/httpdocs/var/generation/Magento/Paypal/Controller/Express/GetToken/Interceptor.php(24): Magento\Paypal\Controller\Express\GetToken->execute()
#10 /var/www/httpdocs/vendor/magento/framework/App/Action/Action.php(102): Magento\Paypal\Controller\Express\GetToken\Interceptor->execute()
#11 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#12 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Paypal\Controller\Express\GetToken\Interceptor->___callParent('dispatch', Array)
#13 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Paypal\...', 'dispatch', Object(Magento\Paypal\Controller\Express\GetToken\Interceptor), Array, 'contextPlugin')
#14 /var/www/httpdocs/vendor/magento/module-store/App/Action/Plugin/Context.php(106): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain{closure}(Object(Magento\Framework\App\Request\Http))
#15 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Store\App\Action\Plugin\Context->aroundDispatch(Object(Magento\Paypal\Controller\Express\GetToken\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#16 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Paypal\...', 'dispatch', Object(Magento\Paypal\Controller\Express\GetToken\Interceptor), Array, 'storeCheck')
#17 /var/www/httpdocs/vendor/magento/module-store/App/Action/Plugin/StoreCheck.php(44): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain{closure}(Object(Magento\Framework\App\Request\Http))
#18 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Store\App\Action\Plugin\StoreCheck->aroundDispatch(Object(Magento\Paypal\Controller\Express\GetToken\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#19 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Paypal\...', 'dispatch', Object(Magento\Paypal\Controller\Express\GetToken\Interceptor), Array, 'customer-app-ac...')
#20 /var/www/httpdocs/vendor/magento/module-customer/Model/App/Action/ContextPlugin.php(61): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain{closure}(Object(Magento\Framework\App\Request\Http))
#21 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Customer\Model\App\Action\ContextPlugin->aroundDispatch(Object(Magento\Paypal\Controller\Express\GetToken\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#22 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Paypal\...', 'dispatch', Object(Magento\Paypal\Controller\Express\GetToken\Interceptor), Array, 'tax-app-action-...')
#23 /var/www/httpdocs/vendor/magento/module-tax/Model/App/Action/ContextPlugin.php(91): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain{closure}(Object(Magento\Framework\App\Request\Http))
#24 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Tax\Model\App\Action\ContextPlugin->aroundDispatch(Object(Magento\Paypal\Controller\Express\GetToken\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#25 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Paypal\...', 'dispatch', Object(Magento\Paypal\Controller\Express\GetToken\Interceptor), Array, 'weee-app-action...')
#26 /var/www/httpdocs/vendor/magento/module-weee/Model/App/Action/ContextPlugin.php(112): Magento\Paypal\Controller\Express\GetToken\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#27 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Weee\Model\App\Action\ContextPlugin->aroundDispatch(Object(Magento\Paypal\Controller\Express\GetToken\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#28 /var/www/httpdocs/var/generation/Magento/Paypal/Controller/Express/GetToken/Interceptor.php(104): Magento\Paypal\Controller\Express\GetToken\Interceptor->___callPlugins('dispatch', Array, Array)
#29 /var/www/httpdocs/vendor/magento/framework/App/FrontController.php(55): Magento\Paypal\Controller\Express\GetToken\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#30 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#31 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#32 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'requestPreproce...')
#33 /var/www/httpdocs/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain{closure}(Object(Magento\Framework\App\Request\Http))
#34 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#35 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#36 /var/www/httpdocs/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain{closure}(Object(Magento\Framework\App\Request\Http))
#37 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#38 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
#39 /var/www/httpdocs/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(68): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain{closure}(Object(Magento\Framework\App\Request\Http))
#40 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#41 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
#42 /var/www/httpdocs/vendor/magento/module-page-cache/Model/App/FrontController/VarnishPlugin.php(55): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#43 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(142): Magento\PageCache\Model\App\FrontController\VarnishPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#44 /var/www/httpdocs/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#45 /var/www/httpdocs/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#46 /var/www/httpdocs/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#47 /var/www/httpdocs/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#48 {main} [] []
Activity