From c37039c9cbf5d0ea327664f354e82285c6ba797a Mon Sep 17 00:00:00 2001 From: "Soare Robert Daniel (Mac 2023)" Date: Mon, 3 Jun 2024 16:48:59 +0300 Subject: [PATCH] fix: use WC_Payment_Gateways instance --- inc/compatibility/woocommerce.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/compatibility/woocommerce.php b/inc/compatibility/woocommerce.php index bc1a9893ba..bb474214c2 100644 --- a/inc/compatibility/woocommerce.php +++ b/inc/compatibility/woocommerce.php @@ -213,7 +213,7 @@ private function get_payment_method() { $payment_method = WC()->session->get( 'chosen_payment_method' ); if ( ! $payment_method ) { // If payment method is null, see if there is only one option; - $payment_gateways = new WC_Payment_Gateways(); + $payment_gateways = WC_Payment_Gateways::instance(); $available_payment_methods = $payment_gateways->get_available_payment_gateways(); if ( is_array( $available_payment_methods ) && count( $available_payment_methods ) === 1 ) { return array_keys( $available_payment_methods )[0];