squarePaymentService = $squarePaymentService; } public function handle(WP_REST_Request $data): WP_REST_Response { Sanitizer::verifyNonce($data->get_header('X-WP-Nonce')); $locations = $this->squarePaymentService->getLocations(); return new WP_REST_Response(['locations' => $locations], 200); } }