mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Use DI for General Settings and store only after verification
This commit is contained in:
parent
268ab3a27a
commit
c13680b7f5
2 changed files with 28 additions and 19 deletions
|
@ -9,6 +9,7 @@ declare( strict_types = 1 );
|
|||
|
||||
namespace WooCommerce\PayPalCommerce\Settings;
|
||||
|
||||
use WooCommerce\PayPalCommerce\Settings\Data\GeneralSettings;
|
||||
use WooCommerce\PayPalCommerce\Settings\Endpoint\ConnectManualRestEndpoint;
|
||||
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
||||
use WooCommerce\PayPalCommerce\Settings\Endpoint\OnboardingRestEndpoint;
|
||||
|
@ -50,7 +51,8 @@ return array(
|
|||
return new ConnectManualRestEndpoint(
|
||||
$container->get( 'api.paypal-host-production' ),
|
||||
$container->get( 'api.paypal-host-sandbox' ),
|
||||
$container->get( 'woocommerce.logger.woocommerce' )
|
||||
$container->get( 'woocommerce.logger.woocommerce' ),
|
||||
$container->get( 'settings.general' )
|
||||
);
|
||||
},
|
||||
'settings.casual-selling.supported-countries' => static function ( ContainerInterface $container ) : array {
|
||||
|
@ -109,4 +111,7 @@ return array(
|
|||
|
||||
return in_array( $country, $eligible_countries, true );
|
||||
},
|
||||
'settings.general' => static function ( ContainerInterface $container ) : GeneralSettings {
|
||||
return new GeneralSettings();
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue