mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-10 07:59:53 +08:00
Use a base gateway class with minimal config
This commit is contained in:
parent
6aa87da598
commit
84fd6e552d
5 changed files with 35 additions and 8 deletions
|
@ -6,11 +6,15 @@ namespace Inpsyde\PayPalCommerce\WcGateway;
|
|||
use Dhii\Data\Container\ContainerInterface;
|
||||
use Inpsyde\PayPalCommerce\WcGateway\Checkout\DisableGateways;
|
||||
use Inpsyde\PayPalCommerce\WcGateway\Gateway\WcGateway;
|
||||
use Inpsyde\PayPalCommerce\WcGateway\Gateway\WcGatewayBase;
|
||||
use Inpsyde\PayPalCommerce\WcGateway\Notice\ConnectAdminNotice;
|
||||
use Inpsyde\PayPalCommerce\WcGateway\Settings\Settings;
|
||||
use Inpsyde\PayPalCommerce\WcGateway\Settings\SettingsFields;
|
||||
|
||||
return [
|
||||
'wcgateway.gateway.base' => function (ContainerInterface $container) : WcGatewayBase {
|
||||
return new WcGatewayBase();
|
||||
},
|
||||
'wcgateway.gateway' => function (ContainerInterface $container) : WcGateway {
|
||||
$sessionHandler = $container->get('session.handler');
|
||||
$cartRepository = $container->get('api.cart-repository');
|
||||
|
@ -24,7 +28,7 @@ return [
|
|||
return new DisableGateways($sessionHandler);
|
||||
},
|
||||
'wcgateway.settings' => function (ContainerInterface $container) : Settings {
|
||||
$gateway = $container->get('wcgateway.gateway');
|
||||
$gateway = $container->get('wcgateway.gateway.base');
|
||||
$settingsField = $container->get('wcgateway.settings.fields');
|
||||
return new Settings($gateway, $settingsField);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue