mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
♻️ Favor DCC config class over settings access
This commit is contained in:
parent
0677364eb2
commit
bcd62f674d
6 changed files with 34 additions and 32 deletions
|
@ -17,6 +17,7 @@ use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
|||
use WooCommerce\PayPalCommerce\WcGateway\Gateway\CreditCardGateway;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Helper\DCCGatewayConfiguration;
|
||||
|
||||
return array(
|
||||
|
||||
|
@ -135,10 +136,10 @@ return array(
|
|||
},
|
||||
|
||||
'axo.smart-button-location-notice' => static function ( ContainerInterface $container ) : string {
|
||||
$settings = $container->get( 'wcgateway.settings' );
|
||||
assert( $settings instanceof Settings );
|
||||
$dcc_configuration = $container->get( 'wcgateway.configuration.dcc' );
|
||||
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
|
||||
|
||||
if ( $settings->has( 'axo_enabled' ) && $settings->get( 'axo_enabled' ) ) {
|
||||
if ( $dcc_configuration->use_fastlane() ) {
|
||||
$fastlane_settings_url = admin_url(
|
||||
sprintf(
|
||||
'admin.php?page=wc-settings&tab=checkout§ion=%1$s&ppcp-tab=%2$s#field-axo_heading',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue