mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
54 lines
1.3 KiB
PHP
54 lines
1.3 KiB
PHP
|
<?php
|
||
|
/**
|
||
|
* The blocks module.
|
||
|
*
|
||
|
* @package WooCommerce\PayPalCommerce\Blocks
|
||
|
*/
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
namespace WooCommerce\PayPalCommerce\Blocks;
|
||
|
|
||
|
use Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry;
|
||
|
use WooCommerce\PayPalCommerce\Vendor\Dhii\Container\ServiceProvider;
|
||
|
use WooCommerce\PayPalCommerce\Vendor\Dhii\Modular\Module\ModuleInterface;
|
||
|
use WooCommerce\PayPalCommerce\Vendor\Interop\Container\ServiceProviderInterface;
|
||
|
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
||
|
|
||
|
/**
|
||
|
* Class BlocksModule
|
||
|
*/
|
||
|
class BlocksModule implements ModuleInterface {
|
||
|
/**
|
||
|
* {@inheritDoc}
|
||
|
*/
|
||
|
public function setup(): ServiceProviderInterface {
|
||
|
return new ServiceProvider(
|
||
|
require __DIR__ . '/../services.php',
|
||
|
require __DIR__ . '/../extensions.php'
|
||
|
);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* {@inheritDoc}
|
||
|
*/
|
||
|
public function run( ContainerInterface $c ): void {
|
||
|
if ( class_exists( 'Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType' ) ) {
|
||
|
add_action(
|
||
|
'woocommerce_blocks_payment_method_type_registration',
|
||
|
function( PaymentMethodRegistry $payment_method_registry ) use ( $c ): void {
|
||
|
$payment_method_registry->register( $c->get( 'blocks.method' ) );
|
||
|
}
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Returns the key for the module.
|
||
|
*
|
||
|
* @return string|void
|
||
|
*/
|
||
|
public function getKey() {
|
||
|
}
|
||
|
}
|