you can do that by adding following function in your gateway as well
the function should be added in gateway class
public function get_icon() {
$icon = '';
if(is_array($this->stripe_cardtypes))
{
foreach ( $this->stripe_cardtypes as $card_type ) {
if ( $url = $this->get_payment_method_image_url( $card_type ) ) {
$icon .= '<img src="'.esc_url( $url ).'" alt="'.esc_attr( strtolower( $card_type ) ).'" />';
}
}
}
else
{
$icon .= '<img src="'.esc_url( plugins_url( 'images/stripe.png' , __FILE__ ) ).'" alt="Stripe Payment Gateway" />';
}
return apply_filters( 's4wc_icon_url', $icon, $this->id );
}
public function get_payment_method_image_url( $type ) {
$image_type = strtolower( $type );
return WC_HTTPS::force_https_url( plugins_url( 'images/' . $image_type . '.jpg' , __FILE__ ) );
}
/*Process Payment*/
Also in plugin constructor the code should be like
$this->icon = plugins_url( 'images/stripe.png' , __FILE__ ) ;
however you need to keep an images directory and place the cards logo as visa.jpg ,
Another thing you need to add is an array in init_form_fields() function
'stripe_cardtypes' => array(
'title' => __( 'Accepted Cards', 'woocommerce' ),
'type' => 'multiselect',
'class' => 'chosen_select',
'css' => 'width: 350px;',
'desc_tip' => __( 'Select the card types to accept.', 'woocommerce' ),
'options' => array(
'mastercard' => 'MasterCard',
'visa' => 'Visa',
'discover' => 'Discover',
'amex' => 'American Express',
'jcb' => 'JCB',
'dinersclub' => 'Dinners Club',
),
'default' => array( 'mastercard', 'visa', 'discover', 'amex' ),
),
and get an array of card types like this
$this->stripe_cardtypes = $this->get_option( 'stripe_cardtypes');