Exemple #1
0
 public function __construct()
 {
     parent::__construct();
     $options = FFLCommerce_Base::get_options();
     $this->id = 'fflcommerce_worldpay';
     $this->icon = fflcommerce::assets_url() . '/assets/images/icons/worldpay.png';
     $this->has_fields = false;
     $this->enabled = $options->get('fflcommerce_worldpay_is_enabled');
     $this->title = $options->get('fflcommerce_worldpay_method_title');
     $this->description = $options->get('fflcommerce_worldpay_checkout_description');
     $this->testmode = $options->get('fflcommerce_worldpay_test_mode');
     $this->installation_id = $options->get('fflcommerce_worldpay_install_id');
     $this->fixed_currency = $options->get('fflcommerce_worldpay_fixed_currency');
     $this->md5_encrypt = $options->get('fflcommerce_worldpay_md5');
     $this->secret_word = $options->get('fflcommerce_worldpay_md5_secret_word');
     $this->response_pass = $options->get('fflcommerce_worldpay_response_password');
     $this->receive_err_log = $options->get('fflcommerce_worldpay_receive_security_logs');
     $this->emailto_err_log = $options->get('fflcommerce_worldpay_security_logs_emailto');
     $this->currency = $options->get('fflcommerce_currency');
     $this->notify_url = fflcommerce_request_api::query_request('?js-api=JS_Gateway_WorldPay', false);
     add_action('fflcommerce_api_js_gateway_worldpay', array($this, 'check_worldpay_response'));
     add_action('admin_notices', array($this, 'worldpay_notices'));
     add_action('receipt_fflcommerce_worldpay', array($this, 'receipt_page'));
     add_action('wp_footer', array($this, 'worldpay_script'));
 }
Exemple #2
0
 public function __construct()
 {
     parent::__construct();
     $options = FFLCommerce_Base::get_options();
     $this->id = 'paypal';
     $this->icon = FFLCOMMERCE_URL . '/assets/images/icons/paypal.png';
     $this->has_fields = false;
     $this->enabled = $options->get('fflcommerce_paypal_enabled');
     $this->title = $options->get('fflcommerce_paypal_title');
     $this->email = $options->get('fflcommerce_paypal_email');
     $this->description = $options->get('fflcommerce_paypal_description');
     $this->force_payment = $options->get('fflcommerce_paypal_force_payment');
     $this->testmode = $options->get('fflcommerce_paypal_testmode');
     $this->testemail = $options->get('fflcommerce_sandbox_email');
     $this->send_shipping = $options->get('fflcommerce_paypal_send_shipping');
     $this->decimals = min($options->get('fflcommerce_price_num_decimals'), in_array($options->get('fflcommerce_currency'), self::$no_decimal_currencies) ? 0 : 2);
     $this->liveurl = 'https://www.paypal.com/webscr';
     $this->testurl = 'https://www.sandbox.paypal.com/webscr';
     $this->notify_url = fflcommerce_request_api::query_request('?js-api=JS_Gateway_Paypal', false);
     add_action('fflcommerce_settings_scripts', array($this, 'admin_scripts'));
     add_action('receipt_paypal', array($this, 'receipt_page'));
     add_action('fflcommerce_api_js_gateway_paypal', array($this, 'check_ipn_response'));
     add_action('init', array($this, 'legacy_ipn_response'));
 }
Exemple #3
0
function fflcommerce_init()
{
    // Override default translations with custom .mo's found in wp-content/languages/fflcommerce first.
    load_textdomain('fflcommerce', WP_LANG_DIR . '/fflcommerce/fflcommerce-' . get_locale() . '.mo');
    load_plugin_textdomain('fflcommerce', false, dirname(plugin_basename(__FILE__)) . '/languages/');
    add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'fflcommerce_admin_bar_links');
    // instantiate options -after- loading text domains
    $options = FFLCommerce_Base::get_options();
    fflcommerce_post_type();
    // register taxonomies
    new fflcommerce_cron();
    // -after- text domains and Options instantiation allows settings translations
    fflcommerce_set_image_sizes();
    // called -after- our Options are loaded
    // add Singletons here so that the taxonomies are loaded before calling them.
    fflcommerce_session::instance();
    // Start sessions if they aren't already
    fflcommerce::instance();
    // Utility functions, uses sessions
    fflcommerce_customer::instance();
    // Customer class, sorts session data such as location
    // FFL Commerce will instantiate gateways and shipping methods on this same 'init' action hook
    // with a very low priority to ensure text domains are loaded first prior to installing any external options
    fflcommerce_shipping::instance();
    // Shipping class. loads shipping methods
    fflcommerce_payment_gateways::instance();
    // Payment gateways class. loads payment methods
    fflcommerce_cart::instance();
    // Cart class, uses sessions
    add_filter('mce_external_plugins', 'fflcommerce_register_shortcode_editor');
    add_filter('mce_buttons', 'fflcommerce_register_shortcode_buttons');
    if (!is_admin()) {
        /* Catalog Filters */
        add_filter('loop-shop-query', create_function('', 'return array("orderby" => "' . $options->get('fflcommerce_catalog_sort_orderby') . '","order" => "' . $options->get('fflcommerce_catalog_sort_direction') . '");'));
        add_filter('loop_shop_columns', create_function('', 'return ' . $options->get('fflcommerce_catalog_columns') . ';'));
        add_filter('loop_shop_per_page', create_function('', 'return ' . $options->get('fflcommerce_catalog_per_page') . ';'));
        fflcommerce_catalog_query::instance();
        // front end queries class
        fflcommerce_request_api::instance();
        // front end request api for URL's
    }
    fflcommerce_roles_init();
    do_action('fflcommerce_initialize_plugins');
}