diff --git a/includes/Gateways.php b/includes/Gateways.php index 2622d76..a5cd966 100644 --- a/includes/Gateways.php +++ b/includes/Gateways.php @@ -34,10 +34,13 @@ public function payment_gateways( array $gateways ) { } // All other cases, the default POS gateways are added - return array_merge($gateways, array( - 'WCPOS\WooCommercePOS\Gateways\Cash', - 'WCPOS\WooCommercePOS\Gateways\Card', - )); + return array_merge( + $gateways, + array( + 'WCPOS\WooCommercePOS\Gateways\Cash', + 'WCPOS\WooCommercePOS\Gateways\Card', + ) + ); } /** @@ -58,8 +61,7 @@ public function available_payment_gateways( ?array $gateways ): ?array { } // use POS settings - $settings_service = new Services\Settings(); - $settings = $settings_service->get_payment_gateways_settings(); + $settings = woocommerce_pos_get_settings( 'payment_gateways' ); // Get all payment gateways $all_gateways = WC()->payment_gateways->payment_gateways; @@ -75,9 +77,9 @@ public function available_payment_gateways( ?array $gateways ): ?array { * There is an issue over-writing the description field because some gateways use this for info, * eg: Account Funds uses it to show the current balance. */ -// if ( isset( $settings['gateways'][ $gateway->id ]['description'] ) ) { -// $gateway->description = $settings['gateways'][ $gateway->id ]['description']; -// } + // if ( isset( $settings['gateways'][ $gateway->id ]['description'] ) ) { + // $gateway->description = $settings['gateways'][ $gateway->id ]['description']; + // } $gateway->icon = ''; $gateway->enabled = 'yes'; @@ -88,9 +90,12 @@ public function available_payment_gateways( ?array $gateways ): ?array { } // Order the available gateways according to the settings - uksort( $_available_gateways, function ( $a, $b ) use ( $settings ) { - return $settings['gateways'][ $a ]['order'] <=> $settings['gateways'][ $b ]['order']; - }); + uksort( + $_available_gateways, + function ( $a, $b ) use ( $settings ) { + return $settings['gateways'][ $a ]['order'] <=> $settings['gateways'][ $b ]['order']; + } + ); return $_available_gateways; } diff --git a/includes/Services/Auth.php b/includes/Services/Auth.php index 890ebf2..6fc4a7b 100644 --- a/includes/Services/Auth.php +++ b/includes/Services/Auth.php @@ -35,7 +35,7 @@ public static function instance(): Auth { /** * Constructor is private to prevent direct instantiation. - * Or Settings::instance() instead. + * Or Auth::instance() instead. */ public function __construct() { }