vippsas / vipps-recurring-woocommerce

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

Critical: Fatal error when using Vipps express and cancelling payment #93

Closed kimmenbert closed 4 months ago

kimmenbert commented 4 months ago

When using Vipps Express for singular (non subscription) purchase. Cancelling the payment in the Vipps pop up leads to an fatal error:

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

Cancelling in-app also generates this fatal error, however not visible front-end.

Why is Woo recurring even triggered at all in this case?

Marcuzz commented 4 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 :)

You are right about the fact that this should not happen.

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

#1 /xxxx/content/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: xxxxx, request: "GET /vipps-betaling/?ls=a5367a50ebfa16da57bc045ea93fd3d87f6a4503254d111a35f4c79a00a1337f&id=2557 HTTP/1.0", upstream: "fastcgi://unix:/run/php/php8.1-fpm.sock:", host: "xxxxx", referrer: "https://api.vipps.no/"
Marcuzz commented 4 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 😄