Move axo block module loading to the correct place plus some minor PHPCS fixes

This commit is contained in:
Daniel Dudzic 2024-09-16 17:16:29 +02:00
parent 47d5874e62
commit a1ded99f3f
No known key found for this signature in database
GPG key ID: 31B40D33E3465483
3 changed files with 4 additions and 29 deletions

View file

@ -72,9 +72,9 @@ class AxoBlockModule implements ServiceModule, ExtendingModule, ExecutableModule
function () use ( $c ) {
add_filter(
'woocommerce_paypal_payments_localized_script_data',
function( array $localized_script_data ) use ($c) {
function( array $localized_script_data ) use ( $c ) {
$module = $this;
$api = $c->get( 'api.sdk-client-token' );
$api = $c->get( 'api.sdk-client-token' );
assert( $api instanceof SdkClientToken );
$logger = $c->get( 'woocommerce.logger.woocommerce' );
@ -106,31 +106,6 @@ class AxoBlockModule implements ServiceModule, ExtendingModule, ExecutableModule
}
);
// woocommerce_store_api_register_payment_requirements(
// array(
// 'data_callback' => function() use ( $c ): array {
// $smart_button = $c->get( 'button.smart-button' );
// assert( $smart_button instanceof SmartButtonInterface );
//
// if ( isset( $smart_button->script_data()['continuation'] ) ) {
// return array( 'ppcp_continuation' );
// }
//
// return array();
// },
// )
// );
// add_action(
// 'wc_ajax_' . UpdateShippingEndpoint::ENDPOINT,
// static function () use ( $c ) {
// $endpoint = $c->get( 'blocks.endpoint.update-shipping' );
// assert( $endpoint instanceof UpdateShippingEndpoint );
//
// $endpoint->handle_request();
// }
// );
// Enqueue frontend scripts.
add_action(
'wp_enqueue_scripts',

View file

@ -68,7 +68,7 @@ class BlocksModule implements ServiceModule, ExtendingModule, ExecutableModule {
'woocommerce_blocks_payment_method_type_registration',
function( PaymentMethodRegistry $payment_method_registry ) use ( $c ): void {
$payment_method_registry->register( $c->get( 'blocks.method' ) );
// $payment_method_registry->register( $c->get( 'blocks.advanced-card-method' ) );
$payment_method_registry->register( $c->get( 'blocks.advanced-card-method' ) );
}
);