public function __construct() { $this->id = 'everypay'; $this->icon = apply_filters('woocommerce_everypay_icon', plugins_url('images/pay-via-everypay.png', __FILE__)); $this->has_fields = true; $this->method_title = 'Everypay Cards Settings'; $this->init_form_fields(); $this->init_settings(); $this->supports = array('products', 'refunds'); $this->nag_name = 'everypay_nag_notice_' . date('W'); $this->title = $this->get_option('everypay_title'); $this->description = $this->get_option('description'); $this->everypayPublicKey = $this->get_option('everypayPublicKey'); $this->everypaySecretKey = $this->get_option('everypaySecretKey'); $this->everypayMaxInstallments = $this->get_option('everypay_maximum_installments'); //$this->everypay_storecurrency = $this->get_option('everypay_storecurrency'); $this->everypay_sandbox = $this->get_option('everypay_sandbox'); $this->errors = array(); $this->fee = 0; if (!defined("EVERYPAY_SANDBOX")) { define("EVERYPAY_SANDBOX", $this->everypay_sandbox == 'yes' ? true : false); } if (EVERYPAY_SANDBOX) { Everypay::setTestMode(); } // The hooks add_filter('woocommerce_available_payment_gateways', array($this, 'everypay_payment_gateway_disable')); add_filter('woocommerce_payment_gateways', array($this, 'add_everypay_gateway_class')); add_filter('query_vars', array($this, 'add_everypay_var')); add_action('wp_enqueue_scripts', array($this, 'add_everypay_js')); //add_action('woocommerce_cart_calculate_fees', array($this, 'calculate_order_totals')); add_action('admin_init', array($this, 'nag_everypay')); add_action('admin_notices', array($this, 'show_everypay_notices')); add_action('admin_enqueue_scripts', array($this, 'load_everypay_admin')); if (is_admin()) { add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options')); } }