Skip to content

Impossible to use paymentReturn and Callback handlers #30

@justvovus

Description

@justvovus
ERROR: "23000" (code N/A)
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4-order_id' for key 'iname'

This error appears during paymentReturn or Callback (depends what goes the second).
In my case Callback goes after paymentReturn and fails with such error.

Problem is that both handlers are writing to the session cells table (xlite_session_cells) a same order.
Here is log backtrace:

[26-May-2012 15:21:27] Error (code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4-order_id' for key 'iname'
Server API: cgi-fcgi;
Request method: POST;
URI: /store/callback/0/txn_id_name-s_txnId?xid=jwtPiWoMX8KVtySLwHtPWGMC5xArjYka;
Backtrace: 
#0 /var/www/LiteCommerceShop/litecommerce/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php(236): XLite\Core\Statement->execute()
#1 /var/www/LiteCommerceShop/litecommerce/lib/Doctrine/ORM/UnitOfWork.php(708): Doctrine\ORM\Persisters\BasicEntityPersister->executeInserts()
#2 /var/www/LiteCommerceShop/litecommerce/lib/Doctrine/ORM/UnitOfWork.php(287): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrine\ORM\Mapping\ClassMetadata))
#3 /var/www/LiteCommerceShop/litecommerce/lib/Doctrine/ORM/EntityManager.php(334): Doctrine\ORM\UnitOfWork->commit()
#4 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite/Model/Repo/ARepo.php(465): Doctrine\ORM\EntityManager->flush()
#5 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite/Model/Repo/ARepo.php(485): XLite\Model\Repo\ARepo->flushChanges()
#6 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite/Model/Repo/SessionCell.php(60): XLite\Model\Repo\ARepo->insert(Array)
#7 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite/Model/Session.php(237): XLite\Model\Repo\SessionCell->insertCell(4, 'order_id', 176)
#8 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite/Model/Session.php(165): XLite\Model\Session->setCellValue('order_id', 176)
#9 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite/Core/SessionAbstract.php(120): XLite\Model\Session->__set('order_id', 176)
#10 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite/Model/Cart.php(117): XLite\Core\SessionAbstract->__set('order_id', 176)
#11 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite/Controller/Customer/ACustomerAbstract.php(154): XLite\Model\Cart::getInstance()
#12 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite/Controller/Customer/ACustomerAbstract.php(199): XLite\Controller\Customer\ACustomerAbstract->getCart()
#13 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite/Controller/Customer/Callback.php(49): XLite\Controller\Customer\ACustomerAbstract->handleRequest()
#14 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite.php(309): XLite\Controller\Customer\Callback->handleRequest()
#15 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite.php(321): XLite->runController()
#16 [internal function]: XLite->getViewer()
#17 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite/Model/CachingFactory.php(64): call_user_func_array(Array, Array)
#18 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite/Core/CMSConnectorAbstract.php(197): XLite\Model\CachingFactory::getObjectFromCallback('XLite\Core\CMSC...', Object(XLite), 'getViewer')
#19 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite/Core/CMSConnectorAbstract.php(246): XLite\Core\CMSConnectorAbstract->getViewer()
#20 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite/Module/CDev/DrupalConnector/Drupal/Controller.php(290): XLite\Core\CMSConnectorAbstract->getWidget('\XLite\View\Loc...')
#21 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite/Module/CDev/DrupalConnector/Drupal/Controller.php(351): XLite\Module\CDev\DrupalConnector\Drupal\Controller->setBreadcrumbs()
#22 /var/www/LiteCommerceShop/litecommerce/var/run/classes/XLite/Module/CDev/DrupalConnector/Drupal/Controller.php(168): XLite\Module\CDev\DrupalConnector\Drupal\Controller->performCommonActions()
#23 /var/www/LiteCommerceShop/litecommerce/classes/XLite/Module/CDev/DrupalConnector/Drupal/Include/Callbacks.php(38): XLite\Module\CDev\DrupalConnector\Drupal\Controller->getContent()
#24 [internal function]: lcConnectorGetControllerContent('0', 'txn_id_name-s_t...')
#25 /var/www/LiteCommerceShop/includes/menu.inc(516): call_user_func_array('lcConnectorGetC...', Array)
#26 /var/www/LiteCommerceShop/index.php(21): menu_execute_active_handler()
#27 {main}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions