mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Merge branch 'master' of github.com:woocommerce/paypal-for-woocommerce
This commit is contained in:
commit
7fbd288fa4
19 changed files with 912 additions and 328 deletions
|
@ -860,18 +860,23 @@ class SmartButton implements SmartButtonInterface {
|
|||
* @throws \WooCommerce\PayPalCommerce\WcGateway\Exception\NotFoundException If a setting has not been found.
|
||||
*/
|
||||
private function dcc_is_enabled(): bool {
|
||||
if ( ! is_checkout() ) {
|
||||
return false;
|
||||
}
|
||||
if ( ! $this->dcc_applies->for_country_currency() ) {
|
||||
return false;
|
||||
}
|
||||
$keys = array(
|
||||
'dcc_enabled' => 'is_checkout',
|
||||
'client_id',
|
||||
'client_secret',
|
||||
'dcc_enabled',
|
||||
);
|
||||
foreach ( $keys as $key => $callback ) {
|
||||
if ( $this->settings->has( $key ) && $this->settings->get( $key ) && $callback() ) {
|
||||
return true;
|
||||
foreach ( $keys as $key ) {
|
||||
if ( ! $this->settings->has( $key ) || ! $this->settings->get( $key ) ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue