Do not use custom ajax endpoint for get order from session

This commit is contained in:
Emili Castells Guasch 2024-05-20 18:03:31 +02:00
parent e93e9db3be
commit a42488b41d
4 changed files with 1 additions and 68 deletions

View file

@ -10,7 +10,6 @@ declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\Blocks;
use Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry;
use WooCommerce\PayPalCommerce\Blocks\Endpoint\GetPayPalOrderFromSession;
use WooCommerce\PayPalCommerce\Blocks\Endpoint\UpdateShippingEndpoint;
use WooCommerce\PayPalCommerce\Button\Assets\SmartButtonInterface;
use WooCommerce\PayPalCommerce\Vendor\Dhii\Container\ServiceProvider;
@ -91,16 +90,6 @@ class BlocksModule implements ModuleInterface {
}
);
add_action(
'wc_ajax_' . GetPayPalOrderFromSession::ENDPOINT,
static function () use ( $c ) {
$endpoint = $c->get( 'blocks.endpoint.get-paypal-order-from-session' );
assert( $endpoint instanceof GetPayPalOrderFromSession );
$endpoint->handle_request();
}
);
// Enqueue frontend scripts.
add_action(
'wp_enqueue_scripts',