woocommerce / woocommerce-paypal-payments

https://wordpress.org/plugins/woocommerce-paypal-payments/
GNU General Public License v2.0
61 stars 47 forks source link

Uncaught Error: Cannot use object of type WooCommerce\PayPalCommerce\WcGateway\Settings\Settings as array in woocommerce/src/Blocks/Payments/Integrations/AbstractPaymentMethodType.php:34 (3253) #2334

Open dennisnissle opened 4 weeks ago

dennisnissle commented 4 weeks ago

Describe the Bug

Seems like you are overriding the default settings attribute from the original, abstract AbstractPaymentMethodType with your custom Settings object. This leads to the fatal error:

Uncaught Error: Cannot use object of type WooCommerce\PayPalCommerce\WcGateway\Settings\Settings as array in woocommerce/src/Blocks/Payments/Integrations/AbstractPaymentMethodType.php:34

as soon as calling get_setting() on the payment object. Please either override the get_setting() method too or (better) do not override the settings attribute within your AdvancedCardPaymentMethod class. https://github.com/woocommerce/woocommerce-paypal-payments/blob/trunk/modules/ppcp-blocks/src/AdvancedCardPaymentMethod.php#L78

Environment

Latest WP, Woo and PayPal Payments.

dennisnissle commented 2 weeks ago

@InpsydeNiklas Any update on this issue? Seems more like a bug than a third party enhancement to me as you are clearly violating the Woo's object model.