• Resolved 1wiktorw1

    (@1wiktorw1)


    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:

    1. I called the gateways array on the front-page and they were listed correctly.
    2. The $gateways variable referred to by the error is empty.
    3. None of the functions in functions.php are 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]

Viewing 5 replies - 1 through 5 (of 5 total)
  • 👋 hey @1wiktorw1

    Thanks for reaching out about this. Let’s troubleshoot it together!

    As I understand, you’re setting up the website for your client and, upon activating the WooCommerce Stripe Payment Gateway plugin, the error displays on the admin side.

    Just to clarify, did you already have a chance to test with a default theme activated, like TT3, and see if the issue persists, or otherwise? The culprit of the issue reported in this ticket was discovered with the custom theme.

    I hope this is helpful! Please let us know if you have any further questions about this matter, or if we misinterpret your concern in any way. We will be happy to help you further.

    Thread Starter 1wiktorw1

    (@1wiktorw1)

    I just checked and the error also occurs when enabling another theme, TT4.

    Plugin Support omarfpg a11n

    (@omarfpg)

    Hi @1wiktorw1,

    I just checked and the error also occurs when enabling another theme, TT4.

    Thank you for testing this. Would you be able to try with every other plugin but WooCommerce and Stripe disabled? The culprit could be any third party custom code.

    I’m leaving you with a quick guide and some important considerations to test this:

    If changing the theme doesn’t help, you’ll want to deactivate all plugins except for WooCommerce and Stripe and take a look. If that fixes the problem, re-enable the other plugins one by one (gradually), checking after each to see where the issue is coming from.

    Some important considerations
    — Be sure you have a good backup in place of your full site and database. You can ask your host for backup functionality, or you can consider using a service like Jetpack. If something goes wrong, you will be able to restore it.

    — Also, you can consider using a plugin like Health Check & Troubleshooting. This is a plugin developed by the WordPress community, and it is helpful to disable plugins without affecting your current site visitors.

    — It is also important to consider staging functionality in case you would not like to touch your production site (you can ask your host if they offer this service), or you can use WP Staging to spin up a new test site quickly.

    You can find more about this in this guide.

    Please let us know about your findings.

    Thanks!
    -OP

    Thread Starter 1wiktorw1

    (@1wiktorw1)

    I’ve discovered that the problem is caused by the Axepta BNP Paribas plugin, but contacting their support is troublesome. Is there an easy and non-conflicting way to detach the reorder_available_payment_gateways function from the woocommerce_available_payment_gateways filter or overwrite it so it simply looks like this?

    public function reorder_available_payment_gateways( $gateways ){
    return $gateways
    }

    Zee

    (@doublezed2)

    Hello 1wiktorw1

    Thank you for your reply.

    I am glad to know that you have found the root cause of the problem.

    Our support policy does not allow custom-coded solutions.
    Therefore, I will be able to assist you with modifying the code.

    But you can consult a professional web developer with Woo expertise.
    They can guide you or do this customization for you.
    A good place to find a such dev is https://www.codeable.io

    I hope this sets you in the right direction. 🙂

    Best regards.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘array_keys() fatal error in class-wc-gateway-stripe.php’ is closed to new replies.