<?php
namespace CgtgPayControllerPayment;
use MagentoFrameworkAppResponseInterface;
use MagentoSalesApiOrderRepositoryInterface;
use MagentoFrameworkAppCsrfAwareActionInterface;
class Make extends MagentoFrameworkAppActionAction
{
protected $_orderRepository;
public function __construct(
OrderRepositoryInterface $orderRepository,
MagentoFrameworkAppActionContext $context
){
$this->_orderRepository = $orderRepository;
parent::__construct($context);
}
/**
* @inheritDoc
*/
public function execute()
{
// TODO: Implement execute() method.
$order = $this->_orderRepository->get('1');
$order->addStatusHistoryComment('notify make11991 status make 49944: ');
$order->setState(MagentoSalesModelOrder::STATE_COMPLETE)
->setStatus(MagentoSalesModelOrder::STATE_COMPLETE);
$this->_orderRepository->save($order);
}
}
return Fatal error: Uncaught Exception: User Error: Some transactions have not been committed or rolled back in /Magento/Framework/DB/Adapter/Pdo/Mysql.php on line 4050
Can someone help me find the problem?
Thank you very much!