mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
✨ Add php getter to determine branded-only state
This commit is contained in:
parent
dab2127a64
commit
9d16b19bd4
1 changed files with 15 additions and 0 deletions
|
@ -298,4 +298,19 @@ class GeneralSettings extends AbstractDataModel {
|
|||
public function get_installation_path() : string {
|
||||
return $this->data['installation_path'] ?? InstallationPathEnum::DIRECT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the plugin is in the branded-experience mode and shows/enables only
|
||||
* payment methods that are PayPal's own brand.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function own_brand_only() : bool {
|
||||
$brand_only_paths = array(
|
||||
InstallationPathEnum::CORE_PROFILER,
|
||||
InstallationPathEnum::PAYMENT_SETTINGS,
|
||||
);
|
||||
|
||||
return in_array( $this->get_installation_path(), $brand_only_paths, true );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue