Magento2: PayPal NVP gateway errors: Payment has already been made for this InvoiceID (#10412: Duplicate invoice)

Created on 5 Jul 2017  路  12Comments  路  Source: magento/magento2

Error when logged user does a second checkout paying again with paypal

Preconditions

  1. Magento 2.1.7

Steps to reproduce

  1. Register a customer user and login
  2. Buy something paying with paypal express checkout
  3. Come back to the site and put in cart something else, in checkout select again Paypal as payment method
  4. Complete checkout and wait while redirected to Paypal

Expected result

  1. The transaction goes well and summary order page appears with green advice

Actual result

  1. 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\FrameworkObjectManager\Factory\AbstractFactory->createObject('Magento\Framewo...', Array)

1 /var/www/httpdocs/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\FrameworkObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...', Array)

2 /var/www/httpdocs/var/generation/Magento/Framework/Exception/LocalizedExceptionFactory.php(43): Magento\FrameworkObjectManagerObjectManager->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): MagentoTax\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} [] []

Payment Clear Description Format is valid Ready for Work

All 12 comments

This might be the same bug as in #4580.
As far as I can tell, the fix didn't ever reach 2.1.x branch, here it is: fe97d9e

@joni-jones , @okorshenko, could you guys please consider fast-tracking a backport of MAGETWO-54412 into 2.1.8?

This is a rather painful issue to be dealing with :(

Hi @korostii we have a backport ticket for this MAGETWO-57616. But I can't predict in which release it will be included. 2.1.8 already is on testing and stabilization stage.

Hi @okorshenko,

Glad to know that it's not completely forgotten.
Thanks a lot for your timely response!

Hi, @angelo983, if you are using sandbox PayPal account - it's expected behavior. By default, PayPal doesn't allow to process invoices with the same ID and if you are using the same PayPal account for different Magento installations (or even reinstall Magento few times) the invoice ID will duplicate.

To avoid this situation you need to login into PayPal sandbox account and update Block accidental payments configuration:
paypal

UPD: mentioned above issues do not relate to PayPal NVP gateway errors: Payment has already been made for this InvoiceID (#10412: Duplicate invoice) error.

Hello joni-jones, nor of the two scenarios for me; I see that carts are not emptied after buying the first order successfully.
I also already unlocked the Block accidental payments, otherwise I wouldn't sold anymore to my registered customer, but I noticed something strange in sales_quote table and in log:

[2017-07-15 15:04:22] main.CRITICAL: PayPal NVP gateway errors: A successful transaction has already been completed for this token (#10415: Transaction refused because of an invalid argument. See additional error messages for details). Correlation ID: 3398652ec4b89. Version: 72.0. [] []
[2017-07-15 15:04:22] main.CRITICAL: Exception message: Il gateway di PayPal ha rifiutato la richiesta. A successful transaction has already been completed for this token (#10415: Transaction refused because of an invalid argument. See additional error messages for details).
Trace: #0 /var/www/httpdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(89): Magento\FrameworkObjectManager\Factory\AbstractFactory->createObject('Magento\Framewo...', Array)

1 /var/www/httpdocs/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\FrameworkObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...', Array)

2 /var/www/httpdocs/var/generation/Magento/Framework/Exception/LocalizedExceptionFactory.php(43): Magento\FrameworkObjectManagerObjectManager->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(869): Magento\Paypal\Model\Api\Nvp->call('DoExpressChecko...', Array)

6 /var/www/httpdocs/vendor/magento/module-paypal/Model/Express.php(734): Magento\Paypal\Model\Api\Nvp->callDoExpressCheckoutPayment()

7 /var/www/httpdocs/vendor/magento/module-paypal/Model/Express.php(447): Magento\Paypal\Model\Express->_placeOrder(Object(Magento\Sales\Model\Order\Payment\Interceptor), 89.5)

8 /var/www/httpdocs/vendor/magento/module-sales/Model/Order/Payment/Operations/AuthorizeOperation.php(45): Magento\Paypal\Model\Express->authorize(Object(Magento\Sales\Model\Order\Payment\Interceptor), 89.5)

9 /var/www/httpdocs/vendor/magento/module-sales/Model/Order/Payment/Processor.php(72): Magento\Sales\Model\Order\Payment\Operations\AuthorizeOperation->authorize(Object(Magento\Sales\Model\Order\Payment\Interceptor), true, 89.5)

10 /var/www/httpdocs/vendor/magento/module-sales/Model/Order/Payment.php(1054): Magento\Sales\Model\Order\Payment\Processor->authorize(Object(Magento\Sales\Model\Order\Payment\Interceptor), true, 89.5)

11 /var/www/httpdocs/var/generation/Magento/Sales/Model/Order/Payment/Interceptor.php(427): Magento\Sales\Model\Order\Payment->authorize(true, 89.5)

12 /var/www/httpdocs/vendor/magento/module-sales/Model/Order/Payment.php(421): Magento\Sales\Model\Order\Payment\Interceptor->authorize(true, 89.5)

13 /var/www/httpdocs/vendor/magento/module-sales/Model/Order/Payment.php(348): Magento\Sales\Model\Order\Payment->processAction('authorize', Object(Magento\Sales\Model\Order))

14 /var/www/httpdocs/var/generation/Magento/Sales/Model/Order/Payment/Interceptor.php(167): Magento\Sales\Model\Order\Payment->place()

15 /var/www/httpdocs/vendor/magento/module-sales/Model/Order.php(871): Magento\Sales\Model\Order\Payment\Interceptor->place()

16 /var/www/httpdocs/vendor/magento/module-sales/Model/Order.php(1060): Magento\Sales\Model\Order->_placePayment()

17 /var/www/httpdocs/vendor/magento/module-sales/Model/Service/OrderService.php(190): Magento\Sales\Model\Order->place()

18 /var/www/httpdocs/vendor/magento/module-quote/Model/QuoteManagement.php(488): Magento\Sales\Model\Service\OrderService->place(Object(Magento\Sales\Model\Order))

19 /var/www/httpdocs/vendor/magento/module-quote/Model/QuoteManagement.php(391): Magento\Quote\Model\QuoteManagement->submitQuote(Object(Magento\Quote\Model\Quote), Array)

20 /var/www/httpdocs/vendor/magento/module-paypal/Model/Express/Checkout.php(792): Magento\Quote\Model\QuoteManagement->submit(Object(Magento\Quote\Model\Quote))

21 /var/www/httpdocs/vendor/magento/module-paypal/Controller/Express/AbstractExpress/PlaceOrder.php(81): Magento\Paypal\Model\Express\Checkout->place('EC-2JG78503WF46...')

22 /var/www/httpdocs/var/generation/Magento/Paypal/Controller/Express/PlaceOrder/Interceptor.php(24): Magento\Paypal\Controller\Express\AbstractExpress\PlaceOrder->execute()

23 /var/www/httpdocs/vendor/magento/framework/App/Action/Action.php(102): Magento\Paypal\Controller\Express\PlaceOrder\Interceptor->execute()

24 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))

25 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Paypal\Controller\Express\PlaceOrder\Interceptor->___callParent('dispatch', Array)

26 /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\PlaceOrder\Interceptor), Array, 'storeCheck')

27 /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))

28 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Store\App\Action\Plugin\StoreCheck->aroundDispatch(Object(Magento\Paypal\Controller\Express\PlaceOrder\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

29 /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\PlaceOrder\Interceptor), Array, 'customer-app-ac...')

30 /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))

31 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Customer\Model\App\Action\ContextPlugin->aroundDispatch(Object(Magento\Paypal\Controller\Express\PlaceOrder\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

32 /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\PlaceOrder\Interceptor), Array, 'contextPlugin')

33 /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))

34 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Store\App\Action\Plugin\Context->aroundDispatch(Object(Magento\Paypal\Controller\Express\PlaceOrder\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\Paypal\...', 'dispatch', Object(Magento\Paypal\Controller\Express\PlaceOrder\Interceptor), Array, 'tax-app-action-...')

36 /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))

37 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoTax\Model\App\Action\ContextPlugin->aroundDispatch(Object(Magento\Paypal\Controller\Express\PlaceOrder\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

38 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Paypal\...', 'dispatch', Object(Magento\Paypal\Controller\Express\PlaceOrder\Interceptor), Array, 'weee-app-action...')

39 /var/www/httpdocs/vendor/magento/module-weee/Model/App/Action/ContextPlugin.php(112): Magento\Paypal\Controller\Express\PlaceOrder\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))

40 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Weee\Model\App\Action\ContextPlugin->aroundDispatch(Object(Magento\Paypal\Controller\Express\PlaceOrder\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

41 /var/www/httpdocs/var/generation/Magento/Paypal/Controller/Express/PlaceOrder/Interceptor.php(104): Magento\Paypal\Controller\Express\PlaceOrder\Interceptor->___callPlugins('dispatch', Array, Array)

42 /var/www/httpdocs/vendor/magento/framework/App/FrontController.php(55): Magento\Paypal\Controller\Express\PlaceOrder\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))

43 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))

44 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)

45 /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...')

46 /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))

47 /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))

48 /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')

49 /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))

50 /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))

51 /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...')

52 /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))

53 /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))

54 /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...')

55 /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))

56 /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))

57 /var/www/httpdocs/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)

58 /var/www/httpdocs/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))

59 /var/www/httpdocs/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()

60 /var/www/httpdocs/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))

61 {main} [] []

Trace: #0 /var/www/httpdocs/vendor/magento/framework/DB/Statement/Pdo/Mysql.php(95): Zend_Db_Statement_Pdo->_execute(Array)

1 /var/www/httpdocs/vendor/magento/zendframework1/library/Zend/Db/Statement.php(303): Magento\Framework\DB\Statement\Pdo\Mysql->_execute(Array)

2 /var/www/httpdocs/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)

3 /var/www/httpdocs/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `sa...', Array)

4 /var/www/httpdocs/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(465): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `sa...', Array)

5 /var/www/httpdocs/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(520): Magento\Framework\DB\Adapter\Pdo\Mysql->_query('INSERT INTO `sa...', Array)

6 /var/www/httpdocs/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(576): Magento\Framework\DB\Adapter\Pdo\Mysql->query('INSERT INTO `sa...', Array)

7 /var/www/httpdocs/vendor/magento/module-sales/Model/ResourceModel/EntityAbstract.php(180): Zend_Db_Adapter_Abstract->insert('sales_order', Array)

8 /var/www/httpdocs/vendor/magento/framework/Model/ResourceModel/Db/AbstractDb.php(405): Magento\Sales\Model\ResourceModel\EntityAbstract->saveNewObject(Object(Magento\Sales\Model\Order))

9 /var/www/httpdocs/vendor/magento/module-sales/Model/ResourceModel/Order.php(174): Magento\Framework\Model\ResourceModel\Db\AbstractDb->save(Object(Magento\Sales\Model\Order))

10 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Sales\Model\ResourceModel\Order->save(Object(Magento\Sales\Model\Order))

11 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Sales\Model\ResourceModel\Order\Interceptor->___callParent('save', Array)

12 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Sales\M...', 'save', Object(Magento\Sales\Model\ResourceModel\Order\Interceptor), Array, 'clean_cache')

13 /var/www/httpdocs/vendor/magento/framework/App/Cache/FlushCacheByTags.php(71): Magento\Sales\Model\ResourceModel\Order\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Sales\Model\Order))

14 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Framework\App\Cache\FlushCacheByTags->aroundSave(Object(Magento\Sales\Model\ResourceModel\Order\Interceptor), Object(Closure), Object(Magento\Sales\Model\Order))

15 /var/www/httpdocs/var/generation/Magento/Sales/Model/ResourceModel/Order/Interceptor.php(39): Magento\Sales\Model\ResourceModel\Order\Interceptor->___callPlugins('save', Array, Array)

16 /var/www/httpdocs/vendor/magento/module-sales/Model/OrderRepository.php(161): Magento\Sales\Model\ResourceModel\Order\Interceptor->save(Object(Magento\Sales\Model\Order))

17 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Sales\Model\OrderRepository->save(Object(Magento\Sales\Model\Order))

18 /var/www/httpdocs/var/generation/Magento/Sales/Model/OrderRepository/Interceptor.php(78): Magento\Sales\Model\OrderRepository\Interceptor->___callPlugins('save', Array, Array)

19 /var/www/httpdocs/vendor/magento/module-sales/Model/Service/OrderService.php(191): Magento\Sales\Model\OrderRepository\Interceptor->save(Object(Magento\Sales\Model\Order))

20 /var/www/httpdocs/vendor/magento/module-quote/Model/QuoteManagement.php(488): Magento\Sales\Model\Service\OrderService->place(Object(Magento\Sales\Model\Order))

21 /var/www/httpdocs/vendor/magento/module-quote/Model/QuoteManagement.php(391): Magento\Quote\Model\QuoteManagement->submitQuote(Object(Magento\Quote\Model\Quote), Array)

22 /var/www/httpdocs/vendor/magento/module-paypal/Model/Express/Checkout.php(792): Magento\Quote\Model\QuoteManagement->submit(Object(Magento\Quote\Model\Quote))

23 /var/www/httpdocs/vendor/magento/module-paypal/Controller/Express/AbstractExpress/PlaceOrder.php(81): Magento\Paypal\Model\Express\Checkout->place('EC-6AN329892253...')

24 /var/www/httpdocs/var/generation/Magento/Paypal/Controller/Express/PlaceOrder/Interceptor.php(24): Magento\Paypal\Controller\Express\AbstractExpress\PlaceOrder->execute()

25 /var/www/httpdocs/vendor/magento/framework/App/Action/Action.php(102): Magento\Paypal\Controller\Express\PlaceOrder\Interceptor->execute()

26 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))

27 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Paypal\Controller\Express\PlaceOrder\Interceptor->___callParent('dispatch', Array)

28 /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\PlaceOrder\Interceptor), Array, 'storeCheck')

29 /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))

30 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Store\App\Action\Plugin\StoreCheck->aroundDispatch(Object(Magento\Paypal\Controller\Express\PlaceOrder\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

31 /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\PlaceOrder\Interceptor), Array, 'customer-app-ac...')

32 /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))

33 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Customer\Model\App\Action\ContextPlugin->aroundDispatch(Object(Magento\Paypal\Controller\Express\PlaceOrder\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

34 /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\PlaceOrder\Interceptor), Array, 'contextPlugin')

35 /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))

36 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Store\App\Action\Plugin\Context->aroundDispatch(Object(Magento\Paypal\Controller\Express\PlaceOrder\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

37 /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\PlaceOrder\Interceptor), Array, 'tax-app-action-...')

38 /var/www/httpdocs/vendor/magento/module-tax/Model/App/Action/ContextPlugin.php(110): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain{closure}(Object(Magento\Framework\App\Request\Http))

39 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoTax\Model\App\Action\ContextPlugin->aroundDispatch(Object(Magento\Paypal\Controller\Express\PlaceOrder\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

40 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Paypal\...', 'dispatch', Object(Magento\Paypal\Controller\Express\PlaceOrder\Interceptor), Array, 'weee-app-action...')

41 /var/www/httpdocs/vendor/magento/module-weee/Model/App/Action/ContextPlugin.php(112): Magento\Paypal\Controller\Express\PlaceOrder\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))

42 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Weee\Model\App\Action\ContextPlugin->aroundDispatch(Object(Magento\Paypal\Controller\Express\PlaceOrder\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

43 /var/www/httpdocs/var/generation/Magento/Paypal/Controller/Express/PlaceOrder/Interceptor.php(104): Magento\Paypal\Controller\Express\PlaceOrder\Interceptor->___callPlugins('dispatch', Array, Array)

44 /var/www/httpdocs/vendor/magento/framework/App/FrontController.php(55): Magento\Paypal\Controller\Express\PlaceOrder\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))

45 /var/www/httpdocs/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))

46 /var/www/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)

47 /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...')

48 /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))

49 /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))

50 /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')

51 /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))

52 /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))

53 /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...')

54 /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))

55 /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))

56 /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...')

57 /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))

58 /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))

59 /var/www/httpdocs/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)

60 /var/www/httpdocs/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))

61 /var/www/httpdocs/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()

62 /var/www/httpdocs/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))

63 {main} [] []

The Exception message: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '000000107-1' for key 'SALES_ORDER_INCREMENT_ID_STORE_ID' error relates to issue mentioned by @okorshenko.

hi there,
same issue for us when upgrading from 2.1.8 to 2.1.9
no sandbox account, we're in production.
thanks @korostii , #4580 delivered a workaround for us (editing paypal settings).

thanks,
romeo

@angelo983, thank you for your report.
The issue is already fixed in develop branch, 2.2.0

Hi @magento-engcom-team,

Any news regarding a backport to 2.1 branch?

The issue is marked as Done in project branch [2.1-develop] but that seems to be a mistake since the commit I referenced above ( fe97d9e ) is still only present on 2.2+ branches.
Could you please clarify?

Still facing the same issue on 2.1.11,

Any updated to backport compatibility to 2.1 @magento-admin @magento-team ?

We managed to apply a fix on Magento 2.1 and fix below issue.
"A successful transaction has already been completed for this token."

https://support.weltpixel.com/hc/en-us/articles/360000608754-How-to-fix-PayPal-Magento-2-checkout-issues-transaction-refused-invalid-argument-token-error

Hope this helps.

https://www.rakeshjesadiya.com/error-10412-paypal-duplicate-invoice-php/
Resolve the error by following step by step instructions given in the link.

Was this page helpful?
0 / 5 - 0 ratings