Skip to content

Commit

Permalink
fix: use WC_Payment_Gateways instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Jun 3, 2024
1 parent 610593f commit c37039c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inc/compatibility/woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit c37039c

Please sign in to comment.