From ef2283003686279ebe55f2edba9dfd98dee909eb Mon Sep 17 00:00:00 2001 From: moon Date: Wed, 12 Jun 2024 00:38:37 -0700 Subject: [PATCH] Implement is_complete for the square task --- .../class-wc-calypso-task-get-paid-with-square.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/includes/tasks/class-wc-calypso-task-get-paid-with-square.php b/includes/tasks/class-wc-calypso-task-get-paid-with-square.php index 6be8e388..8ba7a6b4 100644 --- a/includes/tasks/class-wc-calypso-task-get-paid-with-square.php +++ b/includes/tasks/class-wc-calypso-task-get-paid-with-square.php @@ -41,6 +41,18 @@ public function get_content() { ); } + /** + * Check if the task is complete. + * + * When Square is connected, it sets an access token in the options table. + * Count the access token and consider the task complete if it is not empty. + * + */ + public function is_complete() { + $access_token = get_option( 'wc_square_access_tokens', array() ); + return ! empty( $access_token ); + } + /** * Time. *