/**
  * get_icon function.
  *
  * @access public
  * @return string
  */
 public function get_icon()
 {
     $icon = '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/visa.svg') . '" alt="Visa" width="32" style="margin-left: 0.3em" />';
     $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/mastercard.svg') . '" alt="Mastercard" width="32" style="margin-left: 0.3em" />';
     $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/amex.svg') . '" alt="Amex" width="32" style="margin-left: 0.3em" />';
     $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/discover.svg') . '" alt="Discover" width="32" style="margin-left: 0.3em" />';
     return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
 }
 /**
  * get_icon function.
  *
  * @access public
  * @return string
  */
 public function get_icon()
 {
     $icon = '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/visa.png') . '" alt="Visa" />';
     $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/mastercard.png') . '" alt="Mastercard" />';
     $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/amex.png') . '" alt="Amex" />';
     if ('USD' === get_woocommerce_currency()) {
         $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/discover.png') . '" alt="Discover" />';
         $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/jcb.png') . '" alt="JCB" />';
         $icon .= '<img src="' . WC_HTTPS::force_https_url(plugins_url('/assets/images/diners.png', dirname(__FILE__))) . '" alt="Diners" />';
     }
     if ($this->bitcoin) {
         $icon .= '<img src="' . WC_HTTPS::force_https_url(plugins_url('/assets/images/bitcoin.png', dirname(__FILE__))) . '" alt="Bitcoin" />';
     }
     return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
 }
 /**
  * get_icon function.
  *
  * @access public
  * @return string
  */
 public function get_icon()
 {
     $ext = version_compare(WC()->version, '2.6', '>=') ? '.svg' : '.png';
     $style = version_compare(WC()->version, '2.6', '>=') ? 'style="margin-left: 0.3em"' : '';
     $icon = '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/visa' . $ext) . '" alt="Visa" width="32" ' . $style . ' />';
     $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/mastercard' . $ext) . '" alt="Mastercard" width="32" ' . $style . ' />';
     $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/amex' . $ext) . '" alt="Amex" width="32" ' . $style . ' />';
     if ('USD' === get_woocommerce_currency()) {
         $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/discover' . $ext) . '" alt="Discover" width="32" ' . $style . ' />';
         $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/jcb' . $ext) . '" alt="JCB" width="32" ' . $style . ' />';
         $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/diners' . $ext) . '" alt="Diners" width="32" ' . $style . ' />';
     }
     if ($this->bitcoin) {
         $icon .= '<img src="' . WC_HTTPS::force_https_url(plugins_url('/assets/images/bitcoin' . $ext, WC_STRIPE_MAIN_FILE)) . '" alt="Bitcoin" width="32" ' . $style . ' />';
     }
     return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
 }
Пример #4
0
    $card_type = $card_meta['cardtype'];
    if ('American Express' == $card_type) {
        $card_type_img = 'amex';
    } elseif ('Diners Club' == $card_type) {
        $card_type_img = 'diners';
    } else {
        $card_type_img = strtolower($card_type);
    }
    $cc_last4 = substr($card_meta['token'], -4);
    $is_default = $card_meta['is_default'];
    $cc_exp = $card_meta['expiry'];
    ?>
		<tr>
			<td>
				<img src="<?php 
    echo WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/' . $card_type_img . '.png');
    ?>
" alt=""/>
				<?php 
    printf(__('%s ending in %s %s', 'woocommerce-payeezy'), $card_type, $cc_last4, 'yes' == $is_default ? '(default)' : '');
    ?>
			</td>
			<td><?php 
    printf(__('%s/%s'), substr($cc_exp, 0, 2), substr($cc_exp, -2));
    ?>
</td>
			<td>
				<a href="#" data-id="<?php 
    echo esc_attr($card->ID);
    ?>
" data-title="<?php 
Пример #5
0
 /**
  * @deprecated 2.1.0
  * @param $content
  * @return string
  */
 public function force_ssl($content)
 {
     _deprecated_function('Woocommerce->force_ssl', '2.1', 'WC_HTTPS::force_https_url');
     return WC_HTTPS::force_https_url($content);
 }
 /**
  * get_icon function.
  *
  * @access public
  * @return string
  */
 public function get_icon()
 {
     switch (WC()->countries->get_base_country()) {
         case 'US':
             $allowed = array('visa', 'mastercard', 'amex', 'discover', 'diners', 'jcb');
             break;
         default:
             $allowed = array('visa', 'mastercard', 'amex');
             break;
     }
     $icon = '';
     foreach ($allowed as $name) {
         $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/' . $name . '.png') . '" alt="' . $this->cards[$name] . '" style="width:40px;" />';
     }
     return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
 }
 /**
  * Get the sample check image HTML
  *
  * @since 4.0.0
  * @return string sample check image HTML
  */
 protected function get_sample_check_html()
 {
     $image_url = WC_HTTPS::force_https_url($this->get_gateway()->get_plugin()->get_payment_gateway_framework_assets_url() . '/images/sample-check.png');
     $html = sprintf('<div class="js-sv-wc-payment-gateway-echeck-form-sample-check" style="display: none;"><img width="541" height="270" src="%s" /></div>', esc_url($image_url));
     /**
      * Payment Gateway Payment Form Sample eCheck HTML.
      *
      * Filters the HTML rendered for the same eCheck image.
      *
      * @since 4.0.0
      * @param string $html
      * @param \SV_WC_Payment_Gateway_Payment_Form $this payment form instance
      */
     return apply_filters('wc_' . $this->get_gateway()->get_id() . '_payment_form_sample_check_html', $html, $this);
 }
 /**
  * 
  * Envia mesajes de error al checkout segun la version
  * @author ivelazquex <*****@*****.**>
  * @param $url string
  * @return string
  */
 private function forceSSL($url)
 {
     global $woocommerce;
     if (class_exists('WC_HTTPS')) {
         // version >= 2.3
         return WC_HTTPS::force_https_url($url);
     } else {
         // version < 2.3
         return $woocommerce->force_ssl($url);
     }
 }
 /**
  * Add selected card icons to payment method label, defaults to Visa/MC/Amex/Discover
  */
 public function get_icon()
 {
     global $woocommerce;
     $icon = '';
     if ($this->icon) {
         if (get_option('woocommerce_force_ssl_checkout') == 'no') {
             // use icon provided by filter
             $icon = '<img src="' . esc_url($this->icon) . '" alt="' . esc_attr($this->title) . '" />';
         } else {
             // use icon provided by filter
             $icon = '<img src="' . esc_url(WC_HTTPS::force_https_url($this->icon)) . '" alt="' . esc_attr($this->title) . '" />';
         }
     } elseif (!empty($this->cardtypes)) {
         if (get_option('woocommerce_force_ssl_checkout') == 'no') {
             // display icons for the selected card types
             foreach ($this->cardtypes as $card_type) {
                 $icon .= '<img src="' . esc_url($this->get_plugin_url() . '/assets/card-' . strtolower(str_replace(' ', '-', $card_type)) . '.png') . '" alt="' . esc_attr(strtolower($card_type)) . '" />';
             }
         } else {
             // display icons for the selected card types
             foreach ($this->cardtypes as $card_type) {
                 $icon .= '<img src="' . esc_url(WC_HTTPS::force_https_url($this->get_plugin_url()) . '/assets/card-' . strtolower(str_replace(' ', '-', $card_type)) . '.png') . '" alt="' . esc_attr(strtolower($card_type)) . '" />';
             }
         }
     }
     return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
 }
Пример #10
0
 /**
  * gateway_icon_create
  *
  * Helper to get the a gateway icon image tag
  *
  * @access protected
  * @return void
  */
 protected function gateway_icon_create($icon, $max_height)
 {
     $icon_url = WC_HTTPS::force_https_url(plugin_dir_url(__FILE__) . 'assets/images/cards/' . $icon . '.png');
     return '<img src="' . $icon_url . '" alt="' . esc_attr($this->get_title()) . '" style="max-height:' . $max_height . '"/>';
 }
 /**
  * Returns the payment method image URL (if any) for the given $type, ie
  * if $type is 'amex' a URL to the american express card icon will be
  * returned.  If $type is 'echeck', a URL to the echeck icon will be
  * returned.
  *
  * @since 1.0.0
  * @param string $type the payment method cc type or name
  * @return string the image URL or null
  */
 public function get_payment_method_image_url($type)
 {
     $image_type = strtolower($type);
     // translate card name to type as needed
     switch ($image_type) {
         case 'american express':
             $image_type = 'amex';
             break;
         case 'discover':
             $image_type = 'disc';
             break;
         case 'mastercard':
             $image_type = 'mc';
             break;
         case 'paypal':
             $image_type = 'paypal';
             break;
         case 'visa debit':
             $image_type = 'visa-debit';
             break;
         case 'visa electron':
             $image_type = 'visa-electron';
             break;
         case 'card':
             $image_type = 'cc-plain';
             break;
             // default: accept $type as is
     }
     // use plain card image if type is not known
     if (!$image_type) {
         if ($this->is_credit_card_gateway()) {
             $image_type = 'cc-plain';
         }
     }
     /**
      * Payment Gateway Fallback to PNG Filter.
      *
      * Allow actors to enable the use of PNGs over SVGs for payment icon images.
      *
      * @since 4.0.0
      * @param bool $use_svg true by default, false to use PNGs
      */
     $image_extension = apply_filters('wc_payment_gateway_' . $this->get_plugin()->get_id() . '_use_svg', true) ? '.svg' : '.png';
     // first, is the card image available within the plugin?
     if (is_readable($this->get_plugin()->get_payment_gateway_framework_assets_path() . '/images/card-' . $image_type . $image_extension)) {
         return WC_HTTPS::force_https_url($this->get_plugin()->get_payment_gateway_framework_assets_url() . '/images/card-' . $image_type . $image_extension);
     }
     // default: is the card image available within the framework?
     if (is_readable($this->get_plugin()->get_payment_gateway_framework_assets_path() . '/images/card-' . $image_type . $image_extension)) {
         return WC_HTTPS::force_https_url($this->get_plugin()->get_payment_gateway_framework_assets_url() . '/images/card-' . $image_type . $image_extension);
     }
     return null;
 }
 /**
  * get_icon function.
  *
  * @return string
  */
 public function get_icon()
 {
     $icon = $this->icon ? '<img src="' . WC_HTTPS::force_https_url($this->icon) . '" alt="' . esc_attr($this->get_title()) . '" />' : '';
     return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
 }
Пример #13
0
 /**
  * get_icon function.
  *
  * @return string
  */
 public function get_icon()
 {
     $link = null;
     switch (WC()->countries->get_base_country()) {
         case 'US':
         case 'NZ':
         case 'CZ':
         case 'HU':
         case 'MY':
             $icon = 'https://www.paypalobjects.com/webstatic/mktg/logo/AM_mc_vs_dc_ae.jpg';
             break;
         case 'TR':
             $icon = 'https://www.paypalobjects.com/webstatic/mktg/logo-center/logo_paypal_odeme_secenekleri.jpg';
             break;
         case 'GB':
             $icon = 'https://www.paypalobjects.com/webstatic/mktg/Logo/AM_mc_vs_ms_ae_UK.png';
             break;
         case 'MX':
             $icon = array('https://www.paypal.com/es_XC/Marketing/i/banner/paypal_visa_mastercard_amex.png', 'https://www.paypal.com/es_XC/Marketing/i/banner/paypal_debit_card_275x60.gif');
             $link = 'https://www.paypal.com/mx/cgi-bin/webscr?cmd=xpt/Marketing/general/WIPaypal-outside';
             break;
         case 'FR':
             $icon = 'https://www.paypalobjects.com/webstatic/mktg/logo-center/logo_paypal_moyens_paiement_fr.jpg';
             break;
         case 'AU':
             $icon = 'https://www.paypalobjects.com/webstatic/en_AU/mktg/logo/Solutions-graphics-1-184x80.jpg';
             break;
         case 'DK':
             $icon = 'https://www.paypalobjects.com/webstatic/mktg/logo-center/logo_PayPal_betalingsmuligheder_dk.jpg';
             break;
         case 'RU':
             $icon = 'https://www.paypalobjects.com/webstatic/ru_RU/mktg/business/pages/logo-center/AM_mc_vs_dc_ae.jpg';
             break;
         case 'NO':
             $icon = 'https://www.paypalobjects.com/webstatic/mktg/logo-center/banner_pl_just_pp_319x110.jpg';
             break;
         case 'CA':
             $icon = 'https://www.paypalobjects.com/webstatic/en_CA/mktg/logo-image/AM_mc_vs_dc_ae.jpg';
             break;
         case 'HK':
             $icon = 'https://www.paypalobjects.com/webstatic/en_HK/mktg/logo/AM_mc_vs_dc_ae.jpg';
             break;
         case 'SG':
             $icon = 'https://www.paypalobjects.com/webstatic/en_SG/mktg/Logos/AM_mc_vs_dc_ae.jpg';
             break;
         case 'TW':
             $icon = 'https://www.paypalobjects.com/webstatic/en_TW/mktg/logos/AM_mc_vs_dc_ae.jpg';
             break;
         case 'TH':
             $icon = 'https://www.paypalobjects.com/webstatic/en_TH/mktg/Logos/AM_mc_vs_dc_ae.jpg';
             break;
         default:
             $icon = WC_HTTPS::force_https_url(WC()->plugin_url() . '/includes/gateways/paypal/assets/images/paypal.png');
             $link = null;
             break;
     }
     if (is_null($link)) {
         $link = 'https://www.paypal.com/' . strtolower(WC()->countries->get_base_country()) . '/webapps/mpp/paypal-popup';
     }
     if (is_array($icon)) {
         $icon_html = '';
         foreach ($icon as $i) {
             $icon_html .= '<img src="' . esc_attr($i) . '" alt="PayPal Acceptance Mark" />';
         }
     } else {
         $icon_html = '<img src="' . esc_attr(apply_filters('woocommerce_paypal_icon', $icon)) . '" alt="PayPal Acceptance Mark" />';
     }
     if ($link) {
         $what_is_paypal = sprintf('<a href="%1$s" class="about_paypal" onclick="javascript:window.open(\'%1$s\',\'WIPaypal\',\'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=1060, height=700\'); return false;" title="' . esc_attr__('What is PayPal?', 'woocommerce') . '">' . esc_attr__('What is PayPal?', 'woocommerce') . '</a>', esc_url($link));
     } else {
         $what_is_paypal = '';
     }
     return apply_filters('woocommerce_gateway_icon', $icon_html . $what_is_paypal, $this->id);
 }
 /**
  * get_icon function.
  *
  * @access public
  * @return string
  */
 public function get_icon()
 {
     $icon = '<br>';
     if (is_array($this->cardtypes)) {
         $card_types = array_reverse($this->cardtypes);
         foreach ($card_types as $card_type) {
             $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/' . $card_type . '.png') . '" alt="' . $card_type . '" />';
         }
     }
     return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
 }
 /**
  * get_icon function.
  *
  * @see WC_Payment_Gateway::get_icon()
  * @return string card icons
  */
 public function get_icon()
 {
     global $wc_elavon_vm;
     $icon = '';
     if ($this->icon) {
         // default behavior
         $icon = '<img src="' . esc_url(WC_HTTPS::force_https_url($this->icon)) . '" alt="' . esc_attr($this->title) . '" />';
     } elseif ($this->cardtypes) {
         // display icons for the selected card types
         $icon = '';
         foreach ($this->cardtypes as $cardtype) {
             if (file_exists(wc_elavon_vm()->get_plugin_path() . '/assets/images/card-' . strtolower($cardtype) . '.png')) {
                 $icon .= '<img src="' . esc_url(WC_HTTPS::force_https_url(wc_elavon_vm()->get_plugin_url() . '/assets/images/card-' . strtolower($cardtype) . '.png')) . '" alt="' . esc_attr(strtolower($cardtype)) . '" />';
             }
         }
     }
     return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
 }
 /**
  * Forces the provided $content url to https protocol
  *
  * @since 1.0
  * @param string $content the url
  * @return string the url with https protocol
  */
 public static function force_https_url($content)
 {
     if (self::is_wc_version_gte_2_1()) {
         return WC_HTTPS::force_https_url($content);
     } else {
         global $woocommerce;
         return $woocommerce->force_ssl($content);
     }
 }
 /**
  * Force SSL on a URL
  *
  * @global object $woocommerce
  * @param string $url The URL to format
  * @return string
  */
 public static function force_https($url)
 {
     if (self::is_wc_2_1()) {
         return WC_HTTPS::force_https_url($url);
     } else {
         global $woocommerce;
         return $woocommerce->force_ssl($url);
     }
 }
 /**
  * Returns the payment method image URL (if any) for the given $type, ie
  * if $type is 'amex' a URL to the american express card icon will be
  * returned.  If $type is 'echeck', a URL to the echeck icon will be
  * returned.
  *
  * @since 1.0.0
  * @param string $type the payment method cc type or name
  * @return string the image URL or null
  */
 public function get_payment_method_image_url($type)
 {
     $image_type = strtolower($type);
     // translate card name to type as needed
     switch ($image_type) {
         case 'american express':
             $image_type = 'amex';
             break;
         case 'discover':
             $image_type = 'disc';
             break;
         case 'mastercard':
             $image_type = 'mc';
             break;
         case 'paypal':
             $image_type = 'paypal-1';
             break;
         case 'visa debit':
             $image_type = 'visa-debit';
             break;
         case 'visa electron':
             $image_type = 'visa-electron';
             break;
             // default: accept $type as is
     }
     // use plain card image if type is not known
     if (!$image_type) {
         if ($this->is_credit_card_gateway()) {
             $image_type = 'cc-plain';
         }
     }
     // first, is the card image available within the plugin?
     if (is_readable($this->get_plugin()->get_plugin_path() . '/assets/images/card-' . $image_type . '.png')) {
         return WC_HTTPS::force_https_url($this->get_plugin()->get_plugin_url()) . '/assets/images/card-' . $image_type . '.png';
     }
     // default: is the card image available within the framework?
     // NOTE: I don't particularly like hardcoding this path, but I don't see any real way around it
     if (is_readable($this->get_plugin()->get_plugin_path() . '/' . $this->get_plugin()->get_framework_image_path() . 'card-' . $image_type . '.png')) {
         return WC_HTTPS::force_https_url($this->get_plugin()->get_plugin_url()) . '/' . $this->get_plugin()->get_framework_image_path() . 'card-' . $image_type . '.png';
     }
     return null;
 }
 /**
  * get_icon function.
  *
  * @access public
  * @return string
  */
 public function get_icon()
 {
     $icon = '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/visa.png') . '" alt="Visa" />';
     $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/mastercard.png') . '" alt="Mastercard" />';
     $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/discover.png') . '" alt="Discover" />';
     $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/amex.png') . '" alt="Amex" />';
     $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/jcb.png') . '" alt="JCB" />';
     return apply_filters('woocommerce_gateway_icon', $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__));
 }
 /**
  * Get icons of all supported card types
  * @see WC_Payment_Gateway::get_icon()
  */
 public function get_icon()
 {
     $icon = '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . "/assets/images/icons/credit-cards/visa.png") . '" alt="Visa" />';
     $icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . "/assets/images/icons/credit-cards/mastercard.png") . '" alt="Mastercard" />';
     return apply_filters("woocommerce_gateway_icon", $icon, $this->id);
 }
Пример #22
0
        if (!is_ssl() && (is_checkout() || is_account_page() || apply_filters('woocommerce_force_ssl_checkout', false))) {
            if (0 === strpos($_SERVER['REQUEST_URI'], 'http')) {
                wp_safe_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));
                exit;
            } else {
                wp_safe_redirect('https://' . (!empty($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']) . $_SERVER['REQUEST_URI']);
                exit;
            }
        }
    }
    /**
     * Template redirect - if we end up on a page ensure it has the correct http/https url
     */
    public static function unforce_https_template_redirect()
    {
        if (function_exists('is_customize_preview') && is_customize_preview()) {
            return;
        }
        if (is_ssl() && $_SERVER['REQUEST_URI'] && !is_checkout() && !is_ajax() && !is_account_page() && apply_filters('woocommerce_unforce_ssl_checkout', true)) {
            if (0 === strpos($_SERVER['REQUEST_URI'], 'http')) {
                wp_safe_redirect(preg_replace('|^https://|', 'http://', $_SERVER['REQUEST_URI']));
                exit;
            } else {
                wp_safe_redirect('http://' . (!empty($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']) . $_SERVER['REQUEST_URI']);
                exit;
            }
        }
    }
}
WC_HTTPS::init();
 public function stripe_get_active_card_logo_url($type)
 {
     $image_type = strtolower($type);
     return WC_HTTPS::force_https_url(plugins_url('images/' . $image_type . '.jpg', __FILE__));
 }
Пример #24
0
 /**
  * Get PayPal images for a country
  * @param  string $country
  * @return array of image URLs
  */
 private function get_icon_image($country)
 {
     switch ($country) {
         case 'US':
         case 'NZ':
         case 'CZ':
         case 'HU':
         case 'MY':
             $icon = 'https://www.paypalobjects.com/webstatic/mktg/logo/AM_mc_vs_dc_ae.jpg';
             break;
         case 'TR':
             $icon = 'https://www.paypalobjects.com/webstatic/mktg/logo-center/logo_paypal_odeme_secenekleri.jpg';
             break;
         case 'GB':
             $icon = 'https://www.paypalobjects.com/webstatic/mktg/Logo/AM_mc_vs_ms_ae_UK.png';
             break;
         case 'MX':
             $icon = array('https://www.paypal.com/es_XC/Marketing/i/banner/paypal_visa_mastercard_amex.png', 'https://www.paypal.com/es_XC/Marketing/i/banner/paypal_debit_card_275x60.gif');
             break;
         case 'FR':
             $icon = 'https://www.paypalobjects.com/webstatic/mktg/logo-center/logo_paypal_moyens_paiement_fr.jpg';
             break;
         case 'AU':
             $icon = 'https://www.paypalobjects.com/webstatic/en_AU/mktg/logo/Solutions-graphics-1-184x80.jpg';
             break;
         case 'DK':
             $icon = 'https://www.paypalobjects.com/webstatic/mktg/logo-center/logo_PayPal_betalingsmuligheder_dk.jpg';
             break;
         case 'RU':
             $icon = 'https://www.paypalobjects.com/webstatic/ru_RU/mktg/business/pages/logo-center/AM_mc_vs_dc_ae.jpg';
             break;
         case 'NO':
             $icon = 'https://www.paypalobjects.com/webstatic/mktg/logo-center/banner_pl_just_pp_319x110.jpg';
             break;
         case 'CA':
             $icon = 'https://www.paypalobjects.com/webstatic/en_CA/mktg/logo-image/AM_mc_vs_dc_ae.jpg';
             break;
         case 'HK':
             $icon = 'https://www.paypalobjects.com/webstatic/en_HK/mktg/logo/AM_mc_vs_dc_ae.jpg';
             break;
         case 'SG':
             $icon = 'https://www.paypalobjects.com/webstatic/en_SG/mktg/Logos/AM_mc_vs_dc_ae.jpg';
             break;
         case 'TW':
             $icon = 'https://www.paypalobjects.com/webstatic/en_TW/mktg/logos/AM_mc_vs_dc_ae.jpg';
             break;
         case 'TH':
             $icon = 'https://www.paypalobjects.com/webstatic/en_TH/mktg/Logos/AM_mc_vs_dc_ae.jpg';
             break;
         default:
             $icon = WC_HTTPS::force_https_url(WC()->plugin_url() . '/includes/gateways/paypal/assets/images/paypal.png');
             break;
     }
     return apply_filters('woocommerce_paypal_icon', $icon);
 }
 function dt_woocommerce_change_paypal_icon()
 {
     return WC_HTTPS::force_https_url(WC()->plugin_url() . '/includes/gateways/paypal/assets/images/paypal.png');
 }
Пример #26
0
            public function payment_fields()
            {
                global $woocommerce;
                if (!$GLOBALS['paymill_active']) {
                    paymill_load_frontend_scripts();
                    // load frontend scripts
                    // settings
                    $GLOBALS['paymill_active'] = true;
                    $cart_total = WC_Payment_Gateway::get_order_total() * 100;
                    $currency = get_woocommerce_currency();
                    $no_logos = true;
                    // form ids
                    echo '<script>
						paymill_form_checkout_id = "form.checkout, form#order_review";
						paymill_form_checkout_submit_id = "#place_order";
						paymill_shop_name = "woocommerce";
						paymill_pcidss3 = ' . (empty($GLOBALS['paymill_settings']->paymill_general_settings['pci_dss_3']) || $GLOBALS['paymill_settings']->paymill_general_settings['pci_dss_3'] != '1' ? 1 : 0) . ';
						paymill_pcidss3_lang = "' . substr(apply_filters('plugin_locale', get_locale(), $domain), 0, 2) . '";
						</script>';
                    echo '<a href="https://www.paymill.com/" target="_blank"><img src="' . WC_HTTPS::force_https_url($this->logo_small) . '" alt="' . $this->title . '" /></a>';
                    echo '<p class="paymill_payment_description">' . $this->settings['description'] . '</p>';
                    require_once PAYMILL_DIR . 'lib/tpl/checkout_form.php';
                } else {
                    echo '<div class="paymill_notification paymill_notification_once_only"><strong>Error:</strong> Paymill can be loaded once only on the same page.</div>';
                }
                return true;
            }
 /**
  * Add selected card icons to payment method label, defaults to Visa/MC/Amex/Discover
  *
  * @return string HTML to print in icon section
  * @since 1.0.0
  */
 public function get_icon()
 {
     $icon = '';
     if ($this->icon) {
         // use icon provided by filter
         $icon .= '<img src="' . esc_url(WC_HTTPS::force_https_url($this->icon)) . '" alt="' . esc_attr($this->title) . '" />';
     }
     if (!empty($this->card_types)) {
         // display icons for the selected card types
         foreach ($this->card_types as $card_type) {
             if (file_exists(YITH_WCAUTHNET_DIR . 'assets/images/icons/credit-cards/' . strtolower($card_type) . '.png')) {
                 $icon .= '<img src="' . esc_url(WC_HTTPS::force_https_url(YITH_WCAUTHNET_URL) . '/assets/images/icons/credit-cards/' . strtolower($card_type) . '.png') . '" alt="' . esc_attr(strtolower($card_type)) . '" />';
             }
         }
     }
     return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
 }