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
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
@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.
Describe the Bug
Seems like you are overriding the default
settings
attribute from the original, abstractAbstractPaymentMethodType
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 theget_setting()
method too or (better) do not override the settings attribute within yourAdvancedCardPaymentMethod
class. https://github.com/woocommerce/woocommerce-paypal-payments/blob/trunk/modules/ppcp-blocks/src/AdvancedCardPaymentMethod.php#L78Environment
Latest WP, Woo and PayPal Payments.