Automattic\WooCommerce\Admin\API
Plugins::connect_wcpay()
Returns a URL that can be used to by WCPay to verify business details with Stripe.
Method of the class: Plugins{}
No Hooks.
Return
WP_Error|Array
. Connect URL.
Usage
$Plugins = new Plugins(); $Plugins->connect_wcpay();
Plugins::connect_wcpay() Plugins::connect wcpay code WC 8.7.0
public function connect_wcpay() { if ( ! class_exists( 'WC_Payments_Account' ) ) { return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error communicating with the WooPayments plugin.', 'woocommerce' ), 500 ); } $args = WooCommercePayments::is_account_partially_onboarded() ? [ 'wcpay-login' => '1', '_wpnonce' => wp_create_nonce( 'wcpay-login' ), ] : [ 'wcpay-connect' => 'WCADMIN_PAYMENT_TASK', '_wpnonce' => wp_create_nonce( 'wcpay-connect' ), ]; return( array( 'connectUrl' => add_query_arg( $args, admin_url() ), ) ); }