Skip to content

Commit

Permalink
Merge pull request #4248 from Codeinwp/fix/duplicate-bank-statement
Browse files Browse the repository at this point in the history
fix: use `WC_Payment_Gateways` instance
  • Loading branch information
Soare-Robert-Daniel authored Jun 5, 2024
2 parents 610593f + c37039c commit 78eda64
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 78eda64

Please sign in to comment.