mollie / WooCommerce

Official Mollie extension for WooCommerce
https://wordpress.org/plugins/mollie-payments-for-woocommerce/
Other
131 stars 53 forks source link

CRITICAL Uncaught Error: Call to undefined method Mollie #862

Closed Martje65 closed 11 months ago

Martje65 commented 11 months ago

Since V 7.4.1 we got the next errors in our log, white V 7.4.0 there are no problems

2023-11-17T06:58:45+00:00 CRITICAL Uncaught Error: Call to undefined method Mollie\Api\Resources\Payment::isCompleted() in /public_html/wp-content/plugins/mollie-payments-for-woocommerce/src/Payment/MollieOrderService.php:153 Stack trace:

0 /public_html/wp-includes/class-wp-hook.php(324): Mollie\WooCommerce\Payment\MollieOrderService->onWebhookAction('')

1 /public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)

2 /public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)

3 /public_html/wp-content/plugins/woocommerce/includes/class-wc-api.php(161): do_action('woocommerce_api...')

4 /public_html/wp-includes/class-wp-hook.php(324): WC_API->handle_api_requests(Object(WP))

5 /public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)

6 /public_html/wp-content/plugins/mollie-payments-for-woocommerce/src/Payment/MollieOrderService.php op de lijn 153

The problem is in \mollie-payments-for-woocommerce\src\Payment\MollieOrderService.php

        //if the order gets updated to completed at mollie, we need to update the order status
        if ($order->get_status() === 'processing' && $payment->isCompleted() && method_exists($payment_object, 'onWebhookCompleted')) {
            $payment_object->onWebhookCompleted($order, $payment, $payment_method_title);
        }

Every time we update a order to afgerond we have this error.

asotela3911 commented 11 months ago

Hi, Please find attached a package containing a fix for the error. Alternatively, downgrading to version 7.4.0 should also be a safe workaround for this error, as the code that triggers it was introduced in version 7.4.1. mollie-payments-for-woocommerce.zip