MultiSafepay / woocommerce

MultiSafepay WooCommerce plugin
https://docs.multisafepay.com/docs/woocommerce
10 stars 2 forks source link

PHP Fatal error: Uncaught Error: Call to a member function getId() on array in /wp-content/plugins/multisafepay/src/PaymentMethods/Base/BasePaymentMethod.php:393 #16

Closed stannvanheusden closed 2 years ago

stannvanheusden commented 2 years ago

Activating payment methods doesn't work in the WooCommerce plugin. I tested the two latest versions of the plugin. They both return the same error upon activating iDeal as a payment method.

AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to a member function getId() on array in /var/www/vhosts/******.com/preview.******.com/wp-content/plugins/multisafepay/src/PaymentMethods/Base/BasePaymentMethod.php:393\nStack trace:\n#0 /var/www/vhosts/******.com/preview.******.com/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-settings-api.php(147): MultiSafepay\\WooCommerce\\PaymentMethods\\Base\\BasePaymentMethod->validate_enabled_field()\n#1 /var/www/vhosts/******.com/preview.******.com/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-settings-api.php(212): WC_Settings_API->get_field_value()\n#2 /var/www/vhosts/******.com/preview.******.com/wp-includes/class-wp-hook.php(307): WC_Settings_API->process_admin_options()\n#3 /var/www/vhosts/******.com/preview.******.com/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()\n#4 /var/www/vhosts/*******...', referer: https://preview.******.com/wp-admin/admin.php?page=wc-settings&tab=checkout&section=multisafepay_ideal

danielcivit commented 2 years ago

Hello @stannvanheusden

Thanks for contact us.

While is true this error should be better handled and we have a backlog item created to work on that; this error is easy to solve.

The reason behind this is because the plugin has been misconfigured and the API Key has not been properly set in WooCommerce > WooCommerce Settings > Account Tab.

Please review our documentation for the steps required to configure the plugin once it has been installed.

https://docs.multisafepay.com/woo-commerce/#configuration

Please, could you check this and confirm this solve the problem.

Thanks.

stannvanheusden commented 2 years ago

Disabling the test API fixed the issue for me, since I used the live API key there. Thanks for the quick reply!