Exemplo n.º 1
0
 /**
  * @return string
  */
 public function getIconUrl()
 {
     return Mollie_WC_Plugin::getPluginUrl('/assets/images/' . $this->getMollieMethodId() . '.png');
 }
Exemplo n.º 2
0
 /**
  * @param array $settings
  * @return array
  */
 public function addGlobalSettingsFields(array $settings)
 {
     wp_register_script('mollie_wc_admin_settings', Mollie_WC_Plugin::getPluginUrl('/assets/js/settings.js'), array('jquery'), Mollie_WC_Plugin::PLUGIN_VERSION);
     wp_enqueue_script('mollie_wc_admin_settings');
     $content = '' . $this->getPluginStatus() . $this->getMollieMethods();
     /* translators: Default payment description. {order_number} and {order_date} are available tags. */
     $default_payment_description = __('Order {order_number}', 'mollie-payments-for-woocommerce');
     $payment_description_tags = '<code>{order_number}</code>, <code>{order_date}</code>';
     $debug_desc = __('Log plugin events.', 'mollie-payments-for-woocommerce');
     // For WooCommerce 2.2.0+ display view logs link
     if (version_compare(Mollie_WC_Plugin::getStatusHelper()->getWooCommerceVersion(), '2.2.0', ">=")) {
         $debug_desc .= ' <a href="' . $this->getLogsUrl() . '">' . __('View logs', 'mollie-payments-for-woocommerce') . '</a>';
     } else {
         /* translators: Placeholder 1: Location of the log files */
         $debug_desc .= ' ' . sprintf(__('Log files are saved to <code>%s</code>', 'mollie-payments-for-woocommerce'), defined('WC_LOG_DIR') ? WC_LOG_DIR : WC()->plugin_path() . '/logs/');
     }
     // Global Mollie settings
     $mollie_settings = array(array('id' => $this->getSettingId('title'), 'title' => __('Mollie settings', 'mollie-payments-for-woocommerce'), 'type' => 'title', 'desc' => '<p id="' . Mollie_WC_Plugin::PLUGIN_ID . '">' . $content . '</p>' . '<p>' . __('The following options are required to use the plugin and are used by all Mollie payment methods', 'mollie-payments-for-woocommerce') . '</p>'), array('id' => $this->getSettingId('live_api_key'), 'title' => __('Live API key', 'mollie-payments-for-woocommerce'), 'default' => '', 'type' => 'text', 'desc' => sprintf(__('The API key is used to connect to Mollie. You can find your <strong>%s</strong> API key in your %sMollie profile%s', 'mollie-payments-for-woocommerce'), 'live', '<a href="https://www.mollie.com/beheer/account/profielen/" target="_blank">', '</a>'), 'css' => 'width: 350px', 'placeholder' => $live_placeholder = __('Live API key should start with live_', 'mollie-payments-for-woocommerce'), 'custom_attributes' => array('placeholder' => $live_placeholder, 'pattern' => '^live_\\w+$')), array('id' => $this->getSettingId('test_mode_enabled'), 'title' => __('Enable test mode', 'mollie-payments-for-woocommerce'), 'default' => 'no', 'type' => 'checkbox', 'desc_tip' => __('Enable test mode if you want to test the plugin without using real payments.', 'mollie-payments-for-woocommerce')), array('id' => $this->getSettingId('test_api_key'), 'title' => __('Test API key', 'mollie-payments-for-woocommerce'), 'default' => '', 'type' => 'text', 'desc' => sprintf(__('The API key is used to connect to Mollie. You can find your <strong>%s</strong> API key in your %sMollie profile%s', 'mollie-payments-for-woocommerce'), 'test', '<a href="https://www.mollie.com/beheer/account/profielen/" target="_blank">', '</a>'), 'css' => 'width: 350px', 'placeholder' => $test_placeholder = __('Test API key should start with test_', 'mollie-payments-for-woocommerce'), 'custom_attributes' => array('placeholder' => $test_placeholder, 'pattern' => '^test_\\w+$')), array('id' => $this->getSettingId('payment_description'), 'title' => __('Description', 'mollie-payments-for-woocommerce'), 'type' => 'text', 'desc' => sprintf(__('Payment description send to Mollie. Default <code>%s</code><br/>You can use the following tags: %s', 'mollie-payments-for-woocommerce'), $default_payment_description, $payment_description_tags), 'default' => $default_payment_description, 'css' => 'width: 350px'), array('id' => $this->getSettingId('payment_locale'), 'title' => __('Payment screen language', 'mollie-payments-for-woocommerce'), 'type' => 'select', 'options' => array('' => __('Detect using browser language', 'mollie-payments-for-woocommerce'), 'wp_locale' => sprintf(__('Send WordPress language (%s)', 'mollie-payments-for-woocommerce'), $this->getCurrentLocale()) . ' (' . __('default', 'mollie-payments-for-woocommerce') . ')', 'nl_NL' => __('Dutch', 'mollie-payments-for-woocommerce'), 'nl_BE' => __('Flemish (Belgium)', 'mollie-payments-for-woocommerce'), 'en' => __('English', 'mollie-payments-for-woocommerce'), 'de' => __('German', 'mollie-payments-for-woocommerce'), 'es' => __('Spanish', 'mollie-payments-for-woocommerce'), 'fr_FR' => __('French', 'mollie-payments-for-woocommerce'), 'fr_BE' => __('French (Belgium)', 'mollie-payments-for-woocommerce')), 'default' => 'wp_locale'), array('id' => $this->getSettingId('debug'), 'title' => __('Debug Log', 'mollie-payments-for-woocommerce'), 'type' => 'checkbox', 'desc' => $debug_desc, 'default' => 'yes'), array('id' => $this->getSettingId('sectionend'), 'type' => 'sectionend'));
     return $this->mergeSettings($settings, $mollie_settings);
 }