mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +08:00
62 lines
1.2 KiB
PHP
62 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* The session module.
|
|
*
|
|
* @package WooCommerce\PayPalCommerce\Session
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace WooCommerce\PayPalCommerce\Session;
|
|
|
|
use Dhii\Container\ServiceProvider;
|
|
use Dhii\Modular\Module\ModuleInterface;
|
|
use WooCommerce\PayPalCommerce\Session\Cancellation\CancelController;
|
|
use Interop\Container\ServiceProviderInterface;
|
|
use Psr\Container\ContainerInterface;
|
|
|
|
/**
|
|
* Class SessionModule
|
|
*/
|
|
class SessionModule implements ModuleInterface {
|
|
|
|
/**
|
|
* Sets up the module.
|
|
*
|
|
* @return ServiceProviderInterface
|
|
*/
|
|
public function setup(): ServiceProviderInterface {
|
|
return new ServiceProvider(
|
|
require __DIR__ . '/../services.php',
|
|
require __DIR__ . '/../extensions.php'
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Run the module.
|
|
*
|
|
* @param ContainerInterface|null $container The container.
|
|
*/
|
|
public function run( ContainerInterface $container ): void {
|
|
add_action(
|
|
'woocommerce_init',
|
|
function () use ( $container ) {
|
|
$controller = $container->get( 'session.cancellation.controller' );
|
|
/**
|
|
* The Cancel controller.
|
|
*
|
|
* @var CancelController $controller
|
|
*/
|
|
$controller->run();
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Returns the key for the module.
|
|
*
|
|
* @return string|void
|
|
*/
|
|
public function getKey() {
|
|
}
|
|
}
|