Title: Accepted Cards Logos
Last modified: August 30, 2016

---

# Accepted Cards Logos

 *  Resolved [Vegard Wikeby](https://wordpress.org/support/users/vegardwikeby/)
 * (@vegardwikeby)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/accepted-cards-logos/)
 * On the checkout page all of the payment logos Stripe accepts shows up in your
   plugin. This is great for any American user, but for Europeans we can’t accept
   JCB, Discover and Diners Club.
 * For me in Norway I can only accept VISA and MasterCard as far as I am aware.
 * [https://support.stripe.com/questions/which-cards-and-payment-types-can-i-accept-with-stripe](https://support.stripe.com/questions/which-cards-and-payment-types-can-i-accept-with-stripe)
 * Would it be possible to add the feature to your brilliant plugin to select ourselves
   in the backend which card logos we want to be visible in the checkout?
 * Thanks.
 * [https://wordpress.org/plugins/stripe-for-woocommerce/](https://wordpress.org/plugins/stripe-for-woocommerce/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Stephen Zuniga](https://wordpress.org/support/users/stephenzuniga001/)
 * (@stephenzuniga001)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/accepted-cards-logos/#post-6413446)
 * There’s a filter you can add to your functions.php to replace the image url with
   your own. [https://github.com/stezu/stripe-for-woocommerce/wiki/Hooks#s4wc_icon_url](https://github.com/stezu/stripe-for-woocommerce/wiki/Hooks#s4wc_icon_url)
 * You would have to use photoshop or find an image online to use for your store.
   I would recommend uploading that image into your site and linking to it instead
   of linking to an external site from google.
 *  [webmicroz](https://wordpress.org/support/users/webmicroz/)
 * (@webmicroz)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/accepted-cards-logos/#post-6413547)
 * 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');
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Accepted Cards Logos’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/stripe-for-woocommerce.svg)
 * [Stripe for WooCommerce](https://wordpress.org/plugins/stripe-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/stripe-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/stripe-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/stripe-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/stripe-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/stripe-for-woocommerce/reviews/)

## Tags

 * [checkout](https://wordpress.org/support/topic-tag/checkout/)

 * 2 replies
 * 3 participants
 * Last reply from: [webmicroz](https://wordpress.org/support/users/webmicroz/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/accepted-cards-logos/#post-6413547)
 * Status: resolved