2020-09-01 10:02:47 +03:00
|
|
|
<?php
|
2020-09-01 10:12:54 +03:00
|
|
|
/**
|
|
|
|
* The services of the session module.
|
|
|
|
*
|
2020-09-11 14:11:10 +03:00
|
|
|
* @package WooCommerce\PayPalCommerce\Session
|
2020-09-01 10:12:54 +03:00
|
|
|
*/
|
|
|
|
|
2020-09-01 10:02:47 +03:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-09-11 14:11:10 +03:00
|
|
|
namespace WooCommerce\PayPalCommerce\Session;
|
2020-09-01 10:02:47 +03:00
|
|
|
|
2022-11-09 10:11:31 +02:00
|
|
|
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
2020-09-11 14:11:10 +03:00
|
|
|
use WooCommerce\PayPalCommerce\Session\Cancellation\CancelController;
|
|
|
|
use WooCommerce\PayPalCommerce\Session\Cancellation\CancelView;
|
2020-09-01 10:02:47 +03:00
|
|
|
|
2020-09-01 10:12:54 +03:00
|
|
|
return array(
|
2021-02-17 14:35:37 +01:00
|
|
|
'session.handler' => function ( ContainerInterface $container ) : SessionHandler {
|
2023-05-22 10:42:33 +03:00
|
|
|
return new SessionHandler();
|
2020-09-01 10:12:54 +03:00
|
|
|
},
|
2021-02-17 14:35:37 +01:00
|
|
|
'session.cancellation.view' => function ( ContainerInterface $container ) : CancelView {
|
2021-12-09 18:54:29 +02:00
|
|
|
return new CancelView(
|
|
|
|
$container->get( 'wcgateway.settings' ),
|
|
|
|
$container->get( 'wcgateway.funding-source.renderer' )
|
|
|
|
);
|
2020-09-01 10:12:54 +03:00
|
|
|
},
|
2021-02-17 14:35:37 +01:00
|
|
|
'session.cancellation.controller' => function ( ContainerInterface $container ) : CancelController {
|
2020-09-01 10:12:54 +03:00
|
|
|
return new CancelController(
|
|
|
|
$container->get( 'session.handler' ),
|
|
|
|
$container->get( 'session.cancellation.view' )
|
|
|
|
);
|
|
|
|
},
|
|
|
|
);
|