How can I post some additional parameters to the custom controller and update the order with order status?

With a custom payment module, the payment is processing on the checkout page with JS. I need to update the order status after place order.

Does anyone know how to do it? Thanks in advance.

1 Answer 1


Create etc/events.xml.

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="sales_order_place_after">
        <observer name="sales_order_place_after" instance="Vendor\Module\Observer\ChangeOrderStatus" />

Create Vendor/Module/Observer/ChangeOrderStatus.php.


namespace Vendor\Module\Observer;

use Magento\Framework\Event\Observer as EventObserver;
use Magento\Framework\Event\ObserverInterface;

class ChangeOrderStatus implements ObserverInterface
    public function execute(EventObserver $observer)
        $order = $observer->getEvent()->getOrder();

        return $this;

Clear cache: php bin/magento cache:clean. And then check it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.