WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\Notes

WooCommercePayments::install_and_activate_wcpay() private WC 1.0

Install and activate WooCommerce Payments.

{} It's a method of the class: WooCommercePayments{}

No Hooks.

Return

true|false. Whether the plugin was successfully activated.

Usage

// private - for code of main (parent) class only
$result = $this->install_and_activate_wcpay();

Code of WooCommercePayments::install_and_activate_wcpay() WC 5.3.0

<?php
private function install_and_activate_wcpay() {
	$install_request = array( 'plugins' => self::PLUGIN_SLUG );
	$installer       = new \Automattic\WooCommerce\Admin\API\Plugins();
	$result          = $installer->install_plugins( $install_request );
	if ( is_wp_error( $result ) ) {
		return false;
	}

	wc_admin_record_tracks_event( 'woocommerce_payments_install', array( 'context' => 'inbox' ) );

	$activate_request = array( 'plugins' => self::PLUGIN_SLUG );
	$result           = $installer->activate_plugins( $activate_request );
	if ( is_wp_error( $result ) ) {
		return false;
	}

	return true;
}