mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
♻️ Refactor to use the EnvironmentConfig
This commit is contained in:
parent
ed13064a16
commit
a1f80f1d3d
3 changed files with 42 additions and 59 deletions
|
@ -79,6 +79,7 @@ use WooCommerce\PayPalCommerce\ApiClient\Repository\PartnerReferralsData;
|
|||
use WooCommerce\PayPalCommerce\ApiClient\Repository\PayeeRepository;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Authentication\ConnectBearer;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Helper\EnvironmentConfig;
|
||||
|
||||
return array(
|
||||
'api.host' => function( ContainerInterface $container ) : string {
|
||||
|
@ -879,4 +880,20 @@ return array(
|
|||
'api.partner_merchant_id-sandbox' => static function( ContainerInterface $container ) : string {
|
||||
return CONNECT_WOO_SANDBOX_MERCHANT_ID;
|
||||
},
|
||||
'api.env.paypal-host' => static function ( ContainerInterface $container ) : EnvironmentConfig {
|
||||
/** @type EnvironmentConfig<string> Configuration object */
|
||||
return EnvironmentConfig::create(
|
||||
'string',
|
||||
$container->get( 'api.paypal-host-production' ),
|
||||
$container->get( 'api.paypal-host-sandbox' )
|
||||
);
|
||||
},
|
||||
'api.env.endpoint.login-seller' => static function ( ContainerInterface $container ) : EnvironmentConfig {
|
||||
/** @type EnvironmentConfig<LoginSeller> Configuration object */
|
||||
return EnvironmentConfig::create(
|
||||
LoginSeller::class,
|
||||
$container->get( 'api.endpoint.login-seller-production' ),
|
||||
$container->get( 'api.endpoint.login-seller-sandbox' )
|
||||
);
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue