mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
Add merchant capability check
This commit is contained in:
parent
7abf075087
commit
2c8e139442
2 changed files with 21 additions and 7 deletions
|
@ -1366,7 +1366,8 @@ return array(
|
|||
return new CardPaymentsConfiguration(
|
||||
$container->get( 'settings.connection-state' ),
|
||||
$container->get( 'wcgateway.settings' ),
|
||||
$container->get( 'api.helpers.dccapplies' )
|
||||
$container->get( 'api.helpers.dccapplies' ),
|
||||
$container->get( 'wcgateway.helper.dcc-product-status' )
|
||||
);
|
||||
},
|
||||
|
||||
|
|
|
@ -62,6 +62,13 @@ class CardPaymentsConfiguration {
|
|||
*/
|
||||
private DccApplies $dcc_applies;
|
||||
|
||||
/**
|
||||
* Manages the Seller status.
|
||||
*
|
||||
* @var DCCProductStatus
|
||||
*/
|
||||
private DCCProductStatus $dcc_status;
|
||||
|
||||
/**
|
||||
* This classes lazily resolves settings on first access. This flag indicates
|
||||
* whether the setting values were resolved, or still need to be evaluated.
|
||||
|
@ -120,18 +127,24 @@ class CardPaymentsConfiguration {
|
|||
*/
|
||||
private bool $hide_fastlane_watermark = false;
|
||||
|
||||
|
||||
/**
|
||||
* Initializes the gateway details based on the provided Settings instance.
|
||||
*
|
||||
* @param ConnectionState $connection_state Connection state instance.
|
||||
* @param Settings $settings Plugin settings instance.
|
||||
* @param DccApplies $dcc_applies DCC eligibility helper.
|
||||
* @param ConnectionState $connection_state Connection state instance.
|
||||
* @param Settings $settings Plugin settings instance.
|
||||
* @param DccApplies $dcc_applies DCC eligibility helper.
|
||||
* @param DCCProductStatus $dcc_status Manages the Seller status.
|
||||
*/
|
||||
public function __construct( ConnectionState $connection_state, Settings $settings, DccApplies $dcc_applies ) {
|
||||
public function __construct(
|
||||
ConnectionState $connection_state,
|
||||
Settings $settings,
|
||||
DccApplies $dcc_applies,
|
||||
DCCProductStatus $dcc_status
|
||||
) {
|
||||
$this->connection_state = $connection_state;
|
||||
$this->settings = $settings;
|
||||
$this->dcc_applies = $dcc_applies;
|
||||
$this->dcc_status = $dcc_status;
|
||||
|
||||
$this->is_resolved = false;
|
||||
}
|
||||
|
@ -241,7 +254,7 @@ class CardPaymentsConfiguration {
|
|||
*/
|
||||
$this->use_acdc = (bool) apply_filters(
|
||||
'woocommerce_paypal_payments_is_acdc_active',
|
||||
$this->dcc_applies->for_country_currency()
|
||||
$this->dcc_applies->for_country_currency() && $this->dcc_status->is_active()
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue