mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
✨ Add PHP API to query seller-type
This commit is contained in:
parent
fa74ba97c3
commit
c0bbd2a6f8
1 changed files with 25 additions and 0 deletions
|
@ -11,6 +11,7 @@ namespace WooCommerce\PayPalCommerce\Settings\Data;
|
|||
|
||||
use RuntimeException;
|
||||
use WooCommerce\PayPalCommerce\Settings\DTO\MerchantConnectionDTO;
|
||||
use WooCommerce\PayPalCommerce\Settings\Enum\SellerTypeEnum;
|
||||
|
||||
/**
|
||||
* Class GeneralSettings
|
||||
|
@ -197,6 +198,30 @@ class GeneralSettings extends AbstractDataModel {
|
|||
&& $this->data['client_secret'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the merchant uses a business account.
|
||||
*
|
||||
* Note: It's possible that the seller type is unknown, and both methods,
|
||||
* `is_casual_seller()` and `is_business_seller()` return false.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_business_seller() : bool {
|
||||
return SellerTypeEnum::BUSINESS === $this->data['seller_type'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the merchant is a casual seller using a personal account.
|
||||
*
|
||||
* Note: It's possible that the seller type is unknown, and both methods,
|
||||
* `is_casual_seller()` and `is_business_seller()` return false.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_casual_seller() : bool {
|
||||
return SellerTypeEnum::PERSONAL === $this->data['seller_type'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the currently connected merchant ID.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue