Riskified / magento2new

New Magento 2 code refactor branch
1 stars 11 forks source link

v1.12.17 cannot create refund #78

Open f123248 opened 11 months ago

f123248 commented 11 months ago

Hi, we found this error when we doing the refund in magento 2.4.5p4 The function is on null. image

After that, we was looking into the function at vendor/riskified/magento2new/Model/Observer/ProcessSuccessfulPost.php

Please check the code in 1.12.17 image

We made the modify as below code snippet. And then, it worked

    /**
     * ProcessSuccessfulPost constructor.
     * @param OrderLogger $logger
     * @param OrderApi $orderApi
     */
    public function __construct(
        OrderLogger $logger,
        OrderApi $orderApi,
        Registry $registry
    ) {
        $this->logger = $logger;
        $this->orderApi = $orderApi;
        $this->registry = $registry;
    }

The $this->registry should added after $this->orderApi = $orderApi;