WordPress at Your Fingertips
function is not described

WC_Admin_Addons::install_woocommerce_payments_addon() public WC 1.0

Install WooCommerce Payments from the Extensions screens.

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

Hooks from the method

Return

null. Nothing.

Usage

$result = WC_Admin_Addons::install_woocommerce_payments_addon( $section );
$section(string)
Extenstions tab.
Default: '_featured'

Code of WC_Admin_Addons::install_woocommerce_payments_addon() WC 5.9.0

public static function install_woocommerce_payments_addon( $section = '_featured' ) {
	check_admin_referer( 'install-addon_woocommerce-payments' );

	$wcpay_plugin_id = 'woocommerce-payments';
	$wcpay_plugin    = array(
		'name'      => __( 'WooCommerce Payments', 'woocommerce' ),
		'repo-slug' => 'woocommerce-payments',
	);

	WC_Install::background_installer( $wcpay_plugin_id, $wcpay_plugin );

	do_action( 'woocommerce_addon_installed', $wcpay_plugin_id, $section );

	wp_safe_redirect( remove_query_arg( array( 'install-addon', '_wpnonce' ) ) );
	exit;
}