mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Check that PPEC settings is not null
This commit is contained in:
parent
d31b3719e3
commit
01942b6699
2 changed files with 9 additions and 48 deletions
|
@ -44,7 +44,12 @@ class PPECHelper {
|
|||
* @return bool
|
||||
*/
|
||||
public static function is_gateway_available() {
|
||||
return self::is_plugin_active() && is_callable( 'wc_gateway_ppec' ) && wc_gateway_ppec()->settings->get_active_api_credentials();
|
||||
if ( ! self::is_plugin_active() || ! is_callable( 'wc_gateway_ppec' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$ppec = wc_gateway_ppec();
|
||||
return is_object( $ppec ) && $ppec->settings && $ppec->settings->get_active_api_credentials();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue