squareOAuthService = $squareOAuthService; } public function handle(WP_REST_Request $data): WP_REST_Response { Sanitizer::verifyNonce($data->get_header('X-WP-Nonce')); $this->squareOAuthService->disconnect(); return new WP_REST_Response( [ 'message' => BackendStrings::getPaymentStrings()['square_disconnected'], 'data' => ['connected' => false], ], 200 ); } }