gateway = $gateway; $this->http = $http; $this->account = $account; } /** * Initializes this class's WP hooks. * * @return void */ public function init_hooks() { add_action( 'woocommerce_system_status_report', [ $this, 'render_status_report_section' ], 1 ); add_filter( 'woocommerce_debug_tools', [ $this, 'debug_tools' ] ); } /** * Add WCPay tools to the Woo debug tools. * * @param array $tools List of current available tools. */ public function debug_tools( $tools ) { $tools['clear_wcpay_account_cache'] = [ 'name' => sprintf( /* translators: %s: WooPayments */ __( 'Clear %s account cache', 'woocommerce-payments' ), 'WooPayments' ), 'button' => __( 'Clear', 'woocommerce-payments' ), 'desc' => sprintf( /* translators: %s: WooPayments */ __( 'This tool will clear the account cached values used in %s.', 'woocommerce-payments' ), 'WooPayments' ), 'callback' => [ $this->account, 'refresh_account_data' ], ]; return $tools; } /** * Renders WCPay information on the status page. */ public function render_status_report_section() { ?> http->is_connected() ) : ?> gateway->is_connected() ) : ?> gateway->get_option( 'current_protection_level' ) === 'advanced' ) : ?>

WooPayments

:
: http->is_connected() ? esc_html__( 'Yes', 'woocommerce-payments' ) : ' ' . esc_html__( 'No', 'woocommerce-payments' ) . ''; ?>
: http->is_connected() ? $this->http->get_blog_id() : '-' ); ?>
: gateway->is_connected() ? esc_html( $this->account->get_stripe_account_id() ?? '-' ) : ' ' . esc_html__( 'Not connected', 'woocommerce-payments' ) . ''; ?>
: gateway->needs_setup() ? ' ' . esc_html__( 'Needs setup', 'woocommerce-payments' ) . '' : ( $this->gateway->is_enabled() ? esc_html__( 'Enabled', 'woocommerce-payments' ) : esc_html__( 'Disabled', 'woocommerce-payments' ) ); ?>
: is_test() ? esc_html_e( 'Enabled', 'woocommerce-payments' ) : esc_html_e( 'Disabled', 'woocommerce-payments' ); ?>
: gateway->get_upe_enabled_payment_method_ids() ) ); ?>
:
: gateway->get_option( 'platform_checkout_button_locations', [] ); $woopay_enabled_locations = empty( $woopay_enabled_locations ) ? 'no locations enabled' : implode( ',', $woopay_enabled_locations ); echo esc_html( WC_Payments_Features::is_woopay_enabled() ? __( 'Enabled', 'woocommerce-payments' ) . ' (' . $woopay_enabled_locations . ')' : __( 'Disabled', 'woocommerce-payments' ) ); ?>
:
: gateway->get_option( 'payment_request' ); $payment_request_enabled_locations = $this->gateway->get_option( 'payment_request_button_locations', [] ); $payment_request_enabled_locations = empty( $payment_request_enabled_locations ) ? 'no locations enabled' : implode( ',', $payment_request_enabled_locations ); echo esc_html( $payment_request_enabled ? __( 'Enabled', 'woocommerce-payments' ) . ' (' . $payment_request_enabled_locations . ')' : __( 'Disabled', 'woocommerce-payments' ) ); ?>
: gateway->get_option( 'current_protection_level' ) ); ?>
: gateway->get_option( 'advanced_fraud_protection_settings' ) ), true ); $list = array_filter( array_map( function ( $rule ) { if ( empty( $rule['key'] ) ) { return null; } switch ( $rule['key'] ) { case 'avs_verification': return 'AVS Verification'; case 'international_ip_address': return 'International IP Address'; case 'ip_address_mismatch': return 'IP Address Mismatch'; case 'address_mismatch': return 'Address Mismatch'; case 'purchase_price_threshold': return 'Purchase Price Threshold'; case 'order_items_threshold': return 'Order Items Threshold'; default: // Ignore all others. return null; } }, $adv_fraud_settings ) ); echo empty( $list ) ? '-' : esc_html( implode( ',', $list ) ); ?>
:
: gateway->get_option( 'manual_capture' ); echo $manual_capture_enabled ? esc_html_e( 'Enabled', 'woocommerce-payments' ) : esc_html_e( 'Disabled', 'woocommerce-payments' ); ?>
:
: