Automattic\WooCommerce\Internal\Admin\Settings\PaymentProviders

WCCore::get_iconpublicWC 1.0

Get the provider icon URL of the payment gateway.

Method of the class: WCCore{}

No Hooks.

Returns

String. The provider icon URL of the payment gateway.

Usage

$WCCore = new WCCore();
$WCCore->get_icon( $payment_gateway ): string;
$payment_gateway(WC_Payment_Gateway) (required)
The payment gateway object.

WCCore::get_icon() code WC 9.8.5

public function get_icon( WC_Payment_Gateway $payment_gateway ): string {
	// Provide custom icons for core payment gateways.
	switch ( $payment_gateway->id ) {
		case WC_Gateway_BACS::ID:
			return plugins_url( 'assets/images/payment_methods/bacs.svg', WC_PLUGIN_FILE );
		case WC_Gateway_Cheque::ID:
			return plugins_url( 'assets/images/payment_methods/cheque.svg', WC_PLUGIN_FILE );
		case WC_Gateway_COD::ID:
			return plugins_url( 'assets/images/payment_methods/cod.svg', WC_PLUGIN_FILE );
		case WC_Gateway_Paypal::ID:
			return plugins_url( 'assets/images/payment_methods/72x72/paypal.png', WC_PLUGIN_FILE );
	}

	return parent::get_icon( $payment_gateway );
}