Add block support in GooglePay

This commit is contained in:
Pedro Silva 2023-08-25 16:25:20 +01:00
parent eff390f564
commit 6a205d1413
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
8 changed files with 232 additions and 19 deletions

View file

@ -9,6 +9,7 @@ declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\Googlepay;
use Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry;
use WooCommerce\PayPalCommerce\Button\Assets\ButtonInterface;
use WooCommerce\PayPalCommerce\Vendor\Dhii\Container\ServiceProvider;
use WooCommerce\PayPalCommerce\Vendor\Dhii\Modular\Module\ModuleInterface;
@ -63,6 +64,12 @@ class GooglepayModule implements ModuleInterface {
}
);
add_action(
'woocommerce_blocks_payment_method_type_registration',
function( PaymentMethodRegistry $payment_method_registry ) use ( $c ): void {
$payment_method_registry->register( $c->get( 'googlepay.blocks-payment-method' ) );
}
);
}
/**