woocommerce-paypal-payments/modules/ppcp-compat/src/class-compatmodule.php

65 lines
1.4 KiB
PHP
Raw Normal View History

2021-07-15 06:51:37 -05:00
<?php
/**
* The compatibility module.
*
* @package WooCommerce\PayPalCommerce\Compat
*/
declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\Compat;
use Dhii\Container\ServiceProvider;
use Dhii\Modular\Module\ModuleInterface;
use Interop\Container\ServiceProviderInterface;
use Psr\Container\ContainerInterface;
use WooCommerce\PayPalCommerce\Compat\PPEC\PPECHelper;
2021-07-15 06:51:37 -05:00
/**
* Class CompatModule
*/
class CompatModule implements ModuleInterface {
/**
* Setup the compatibility module.
*
* @return ServiceProviderInterface
*/
public function setup(): ServiceProviderInterface {
return new ServiceProvider(
require __DIR__ . '/../services.php',
require __DIR__ . '/../extensions.php'
);
}
/**
* Run the compatibility module.
*
* @param ContainerInterface|null $container The Container.
*/
public function run( ContainerInterface $container ): void {
$this->initialize_ppec_compat_layer( $container );
2021-07-15 06:51:37 -05:00
}
/**
* Returns the key for the module.
*
* @return string|void
*/
public function getKey() {
}
/**
* Sets up the PayPal Express Checkout compatibility layer.
*
* @param ContainerInterface|null $container The Container.
* @return void
*/
private function initialize_ppec_compat_layer( $container ): void {
// Process PPEC subscription renewals through PayPal Payments.
$handler = $container->get( 'compat.ppec.subscriptions-handler' );
$handler->maybe_hook();
}
2021-07-15 06:51:37 -05:00
}