vippsas / vipps-recurring-woocommerce

Vipps Recurring payments for WooCommerce
GNU Affero General Public License v3.0
6 stars 4 forks source link

Fatal error when changing order status to "Failed" #94

Closed kimmenbert closed 5 months ago

kimmenbert commented 6 months ago

Tested on an order originally paid for with Vipps express (non subscription).

Changing order status to "Failed" produces fatal error:

PHP Fatal error:  Uncaught Error: Call to a member function get_meta() on null in /xxxx/plugins/vipps-recurring-payments-gateway-for-woocommerce/includes/wc-vipps-recurring-helper.php:188

Also seems to happen on other status changes. Randomly or maybe a pattern like Failed -> Canceled

Marcuzz commented 6 months ago

Hi,

Can you share more of the error stacktrace? I need to know where the original call comes from in order to find out what causes this issue :)

kimmenbert commented 6 months ago
FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to a member function get_meta() on null in /xxxx/plugins/vipps-recurring-payments-gateway-for-woocommerce/includes/wc-vipps-recurring-helper.php:188
Stack trace:
#0 /xxxx/plugins/vipps-recurring-payments-gateway-for-woocommerce/includes/wc-vipps-recurring-helper.php(231): WC_Vipps_Recurring_Helper::get_meta()

#1 /xxxx/plugins/vipps-recurring-payments-gateway-for-woocommerce/includes/wc-gateway-vipps-recurring.php(1964): WC_Vipps_Recurring_Helper::get_agreement_id_from_order()

#2 /xxxx/wp/wp-includes/class-wp-hook.php(326): WC_Gateway_Vipps_Recurring->maybe_cancel_due_charge()

#3 /xxxx/wp/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()

#4 /xxxx/wp/wp-includes/plugin.php(517): WP_Hook->do_actio" while reading response header from upstream, client: 165.22.29.218, server: xxxx, request: "POST /wp/wp-admin/admin.php?page=wc-orders&action=edit&id=2521 HTTP/1.0", upstream: "fastcgi://unix:/run/php/php8.1-fpm.sock:", host: "xxxx", referrer: "https://xxxx/wp/wp-admin/admin.php?page=wc-orders&action=edit&id=2521"
Marcuzz commented 5 months ago

This should be fixed in 869646b. You can download the update from GitHub. I will release the update on WordPress.org when we've dealt with the other issues as well 😄