Automattic\WooCommerce\Admin\API
Plugins::connect_wcpay
Returns a URL that can be used to point the merchant to the WooPayments onboarding flow.
Метод класса: Plugins{}
Хуков нет.
Возвращает
\WP_Error|Массив
. Connect URL.
Использование
$Plugins = new Plugins(); $Plugins->connect_wcpay();
Код Plugins::connect_wcpay() Plugins::connect wcpay WC 9.9.3
public function connect_wcpay() { if ( ! class_exists( 'WC_Payments' ) ) { return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error communicating with the WooPayments plugin.', 'woocommerce' ), 500 ); } // Use a WooPayments connect link to let the WooPayments plugin handle the connection flow. return array( 'connectUrl' => add_query_arg( array( 'wcpay-connect' => '1', 'from' => 'WCADMIN_PAYMENT_TASK', '_wpnonce' => wp_create_nonce( 'wcpay-connect' ), ), admin_url( 'admin.php' ) ), ); }