arding steps.', 'woocommerce' ), 'context' => array( 'view', 'edit' ), 'readonly' => true, 'items' => array( 'type' => 'object', 'properties' => array( 'id' => array( 'type' => 'string', 'description' => esc_html__( 'The unique identifier for the step.', 'woocommerce' ), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'path' => array( 'type' => 'string', 'description' => esc_html__( 'The relative path of the step to use for frontend navigation.', 'woocommerce' ), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'required_steps' => array( 'type' => 'array', 'description' => esc_html__( 'The steps that are required to be completed before this step.', 'woocommerce' ), 'context' => array( 'view', 'edit' ), 'readonly' => true, 'items' => array( 'type' => 'string', ), ), 'status' => array( 'type' => 'string', 'description' => esc_html__( 'The current status of the step.', 'woocommerce' ), 'context' => array( 'view', 'edit' ), 'readonly' => true, 'enum' => array( WooPaymentsService::ONBOARDING_STEP_STATUS_NOT_STARTED, WooPaymentsService::ONBOARDING_STEP_STATUS_STARTED, WooPaymentsService::ONBOARDING_STEP_STATUS_COMPLETED, ), ), 'errors' => array( 'type' => 'array', 'description' => esc_html__( 'Errors list for the step.', 'woocommerce' ), 'context' => array( 'view', 'edit' ), 'readonly' => true, 'items' => array( 'type' => 'object', 'properties' => array( 'code' => array( 'type' => 'string', 'readonly' => true, ), 'message' => array( 'type' => 'string', 'readonly' => true, ), 'context' => array( 'type' => 'object', 'readonly' => true, ), ), ), ), 'actions' => array( 'type' => 'object', 'description' => esc_html__( 'The available actions for the step.', 'woocommerce' ), 'context' => array( 'view', 'edit' ), 'readonly' => true, 'properties' => array( 'start' => array( 'type' => 'object', 'description' => esc_html__( 'Action to signal the step start.', 'woocommerce' ), 'properties' => $this->get_schema_properties_for_onboarding_step_action(), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'save' => array( 'type' => 'object', 'description' => esc_html__( 'Action to save step information in the database.', 'woocommerce' ), 'properties' => $this->get_schema_properties_for_onboarding_step_action(), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'check' => array( 'type' => 'object', 'description' => esc_html__( 'Action to check the step status.', 'woocommerce' ), 'properties' => $this->get_schema_properties_for_onboarding_step_action(), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'finish' => array( 'type' => 'object', 'description' => esc_html__( 'Action to signal the step completion.', 'woocommerce' ), 'properties' => $this->get_schema_properties_for_onboarding_step_action(), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'clean' => array( 'type' => 'object', 'description' => esc_html__( 'Action to clean the step progress.', 'woocommerce' ), 'properties' => $this->get_schema_properties_for_onboarding_step_action(), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'auth' => array( 'type' => 'object', 'description' => esc_html__( 'Action to authorize the WPCOM connection.', 'woocommerce' ), 'properties' => $this->get_schema_properties_for_onboarding_step_action(), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'init' => array( 'type' => 'object', 'description' => esc_html__( 'Action to initialize a test account.', 'woocommerce' ), 'properties' => $this->get_schema_properties_for_onboarding_step_action(), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'kyc_session' => array( 'type' => 'object', 'description' => esc_html__( 'Action to create or resume an embedded KYC session.', 'woocommerce' ), 'properties' => $this->get_schema_properties_for_onboarding_step_action(), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'kyc_session_finish' => array( 'type' => 'object', 'description' => esc_html__( 'Action to finish an embedded KYC session.', 'woocommerce' ), 'properties' => $this->get_schema_properties_for_onboarding_step_action(), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'kyc_fallback' => array( 'type' => 'object', 'description' => esc_html__( 'Action to use as a fallback when dealing with errors with the embedded KYC.', 'woocommerce' ), 'properties' => $this->get_schema_properties_for_onboarding_step_action(), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'reset' => array( 'type' => 'object', 'description' => esc_html__( 'Action to reset the onboarding process, either partially, for a certain step, or fully.', 'woocommerce' ), 'properties' => $this->get_schema_properties_for_onboarding_step_action(), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'test_account_disable' => array( 'type' => 'object', 'description' => esc_html__( 'Action to disable the test account currently in use', 'woocommerce' ), 'properties' => $this->get_schema_properties_for_onboarding_step_action(), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), ), ), 'context' => array( 'type' => 'object', 'description' => esc_html__( 'Various contextual data for the step to use.', 'woocommerce' ), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), ), ), ), 'context' => array( 'type' => 'object', 'description' => esc_html__( 'Various contextual data for the onboarding process to use.', 'woocommerce' ), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), ); return $schema; } /** * Get the schema properties for an onboarding step action. * * @return array[] The schema properties for an onboarding step action. */ private function get_schema_properties_for_onboarding_step_action(): array { return array( 'type' => array( 'type' => 'string', 'description' => esc_html__( 'The action type to determine how to use the URL.', 'woocommerce' ), 'enum' => array( WooPaymentsService::ACTION_TYPE_REST, WooPaymentsService::ACTION_TYPE_REDIRECT ), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'href' => array( 'type' => 'string', 'description' => esc_html__( 'The URL to use for the action.', 'woocommerce' ), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), ); } }