Remove unused ajax endpoint

This commit is contained in:
Emili Castells Guasch 2024-03-11 09:14:48 +01:00
parent 1b76c67e54
commit e201637353

View file

@ -80,26 +80,6 @@ class SavePaymentMethodsModule implements ModuleInterface {
return; return;
} }
add_filter(
'woocommerce_paypal_payments_localized_script_data',
function( array $localized_script_data ) use ( $c ) {
$api = $c->get( 'api.user-id-token' );
assert( $api instanceof UserIdToken );
$logger = $c->get( 'woocommerce.logger.woocommerce' );
assert( $logger instanceof LoggerInterface );
$localized_script_data = $this->add_id_token_to_script_data( $api, $logger, $localized_script_data );
$localized_script_data['ajax']['capture_card_payment'] = array(
'endpoint' => \WC_AJAX::get_endpoint( CaptureCardPayment::ENDPOINT ),
'nonce' => wp_create_nonce( CaptureCardPayment::nonce() ),
);
return $localized_script_data;
}
);
// Adds attributes needed to save payment method. // Adds attributes needed to save payment method.
add_filter( add_filter(
'ppcp_create_order_request_body_data', 'ppcp_create_order_request_body_data',
@ -402,16 +382,6 @@ class SavePaymentMethodsModule implements ModuleInterface {
} }
); );
add_action(
'wc_ajax_' . CaptureCardPayment::ENDPOINT,
static function () use ( $c ) {
$endpoint = $c->get( 'save-payment-methods.endpoint.capture-card-payment' );
assert( $endpoint instanceof CaptureCardPayment );
$endpoint->handle_request();
}
);
add_filter( add_filter(
'woocommerce_paypal_payments_save_payment_methods_eligible', 'woocommerce_paypal_payments_save_payment_methods_eligible',
function() { function() {