array_keys() fatal error in class-wc-gateway-stripe.php
-
Hello, I’m setting up a website for my client and I have installed the WooCommerce Stripe Payment Gateway plugin. After activating it, the following error appears:
Fatal error: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in /home/wisniewski/domains/cruises.wisniewskiw.pl/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-gateway-stripe.php:662 Stack trace: #0 /home/wisniewski/domains/cruises.wisniewskiw.pl/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-gateway-stripe.php(662): array_keys() #1 /home/wisniewski/domains/cruises.wisniewskiw.pl/public_html/wp-includes/class-wp-hook.php(324): WC_Gateway_Stripe->reorder_available_payment_gateways() #2 /home/wisniewski/domains/cruises.wisniewskiw.pl/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters() #3 /home/wisniewski/domains/cruises.wisniewskiw.pl/public_html/wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php(333): apply_filters() #4 /home/wisniewski/domains/cruises.wisniewskiw.pl/public_html/wp-content/plugins/woocommerce/src/Internal/Admin/WcPayWelcomePage.php(391): WC_Payment_Gateways->get_available_payment_gateways() #5 /home/wisniewski/domains/cruises.wisniewskiw.pl/public_html/wp-content/plugins/woocommerce/src/Internal/Admin/WcPayWelcomePage.php(80): Automattic\WooCommerce\Internal\Admin\WcPayWelcomePage->get_incentive() #6 /home/wisniewski/domains/cruises.wisniewskiw.pl/public_html/wp-content/plugins/woocommerce/src/Internal/Admin/WcPayWelcomePage.php(98): Automattic\WooCommerce\Internal\Admin\WcPayWelcomePage->must_be_visible() #7 /home/wisniewski/domains/cruises.wisniewskiw.pl/public_html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Internal\Admin\WcPayWelcomePage->register_payments_welcome_page() #8 /home/wisniewski/domains/cruises.wisniewskiw.pl/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #9 /home/wisniewski/domains/cruises.wisniewskiw.pl/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() #10 /home/wisniewski/domains/cruises.wisniewskiw.pl/public_html/wp-admin/includes/menu.php(161): do_action() #11 /home/wisniewski/domains/cruises.wisniewskiw.pl/public_html/wp-admin/menu.php(422): require_once(‘/home/wisniewsk…’) #12 /home/wisniewski/domains/cruises.wisniewskiw.pl/public_html/wp-admin/admin.php(158): require(‘/home/wisniewsk…’) #13 /home/wisniewski/domains/cruises.wisniewskiw.pl/public_html/wp-admin/plugins.php(10): require_once(‘/home/wisniewsk…’) #14 {main} thrown in /home/wisniewski/domains/cruises.wisniewskiw.pl/public_html/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-gateway-stripe.php on line 662
I found a previous thread where the solution
return gateways;helped, but after updating the plugin, the changes will be overwritten and the problem will reappear:https://wordpress.org/support/topic/php-fatal-error-417/
Is there another way to fix this?
So far:
- I called the
gatewaysarray on the front-page and they were listed correctly. - The
$gatewaysvariable referred to by the error is empty. - None of the functions in
functions.phpare causing this error, as I’ve tried with an empty file and the error still displays.
It’s important to note – the error only displays on the admin side.
The page I need help with: [log in to see the link]
- I called the
The topic ‘array_keys() fatal error in class-wc-gateway-stripe.php’ is closed to new replies.