Exemple #1
0
 public function __construct()
 {
     parent::__construct();
     $this->id = 'skrill';
     $this->title = 'Skrill';
     $this->has_fields = false;
     $this->enabled = FFLCommerce_Base::get_options()->get_option('fflcommerce_skrill_enabled');
     $this->title = FFLCommerce_Base::get_options()->get_option('fflcommerce_skrill_title');
     $this->email = FFLCommerce_Base::get_options()->get_option('fflcommerce_skrill_email');
     $this->locale = $this->getLocale();
     $skrillIcon = FFLCommerce_Base::get_options()->get_option('fflcommerce_skrill_icon');
     if (!filter_var($skrillIcon, FILTER_VALIDATE_URL)) {
         $this->icon = fflcommerce::assets_url() . '/assets/images/icons/skrill.png';
     } else {
         $this->icon = $skrillIcon;
     }
     $pMeth = (array) FFLCommerce_Base::get_options()->get_option('fflcommerce_skrill_payment_methods_multicheck');
     $cList = '';
     foreach ($pMeth as $key => $value) {
         if ($value) {
             $cList = $cList . $key . ',';
         }
     }
     $cList = rtrim($cList, ",");
     $this->payment_methods = $cList;
     add_action('init', array($this, 'check_status_response'));
     if (isset($_GET['skrillPayment']) && $_GET['skrillPayment'] == true) {
         add_action('init', array($this, 'generate_skrill_form'));
     }
     add_action('valid-skrill-status-report', array($this, 'successful_request'));
     add_action('receipt_skrill', array($this, 'receipt_skrill'));
 }
Exemple #2
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 #3
0
 public function __construct()
 {
     parent::__construct();
     $this->id = 'cod';
     $this->icon = '';
     $this->has_fields = false;
     $this->enabled = FFLCommerce_Base::get_options()->get('fflcommerce_cod_enabled');
     $this->title = FFLCommerce_Base::get_options()->get('fflcommerce_cod_title');
     $this->description = FFLCommerce_Base::get_options()->get('fflcommerce_cod_description');
     add_action('thankyou_cod', array(&$this, 'thankyou_page'));
 }
 public function __construct()
 {
     parent::__construct();
     $this->id = 'bank_transfer';
     $this->icon = '';
     $this->has_fields = false;
     $this->enabled = FFLCommerce_Base::get_options()->get('fflcommerce_bank_transfer_enabled');
     $this->title = FFLCommerce_Base::get_options()->get('fflcommerce_bank_transfer_title');
     $this->description = FFLCommerce_Base::get_options()->get('fflcommerce_bank_transfer_description');
     $this->bank_name = FFLCommerce_Base::get_options()->get('fflcommerce_bank_transfer_bank_name');
     $this->acc_number = FFLCommerce_Base::get_options()->get('fflcommerce_bank_transfer_acc_number');
     $this->sort_code = FFLCommerce_Base::get_options()->get('fflcommerce_bank_transfer_sort_code');
     $this->account_holder = FFLCommerce_Base::get_options()->get('fflcommerce_bank_transfer_account_holder');
     $this->iban = FFLCommerce_Base::get_options()->get('fflcommerce_bank_transfer_iban');
     $this->bic = FFLCommerce_Base::get_options()->get('fflcommerce_bank_transfer_bic');
     $this->additional = FFLCommerce_Base::get_options()->get('fflcommerce_bank_transfer_additional');
     add_action('thankyou_bank_transfer', array(&$this, 'thankyou_page'));
 }
Exemple #5
0
 public function __construct()
 {
     parent::__construct();
     /* installs our gateway options in the settings */
     $this->id = 'futurepay';
     $this->icon = fflcommerce::assets_url() . '/assets/images/icons/futurepay.png';
     $this->has_fields = false;
     $this->enabled = FFLCommerce_Base::get_options()->get('fflcommerce_futurepay_enabled');
     $this->title = FFLCommerce_Base::get_options()->get('fflcommerce_futurepay_title');
     $this->description = FFLCommerce_Base::get_options()->get('fflcommerce_futurepay_description');
     $this->gmid = FFLCommerce_Base::get_options()->get('fflcommerce_futurepay_gmid');
     self::$request_url = FFLCommerce_Base::get_options()->get('fflcommerce_futurepay_mode') == 'no' ? self::FUTUREPAY_LIVE_URL : self::FUTUREPAY_SANDBOX_URL;
     add_action('init', array($this, 'check_response'));
     add_action('valid-futurepay-request', array($this, 'successful_request'), 10, 2);
     add_action('receipt_futurepay', array($this, 'receipt_page'));
     add_action('admin_notices', array($this, 'futurepay_notices'));
     add_action('wp_footer', array($this, 'futurepay_script'));
     $this->currency_symbol = get_fflcommerce_currency_symbol();
     $this->shop_base_country = fflcommerce_countries::get_base_country();
 }
Exemple #6
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'));
 }
 /**
  * This method makes sure we require payment for the particular gateway being used.
  *
  * @param fflcommerce_payment_gateway $gateway the payment gateway
  * that is being used during checkout
  * @return boolean true when the gateway should be processed, otherwise false
  * @since 1.2
  */
 public static function process_gateway($gateway)
 {
     if ($gateway === null) {
         if (fflcommerce_cart::$subtotal > 0) {
             fflcommerce::add_error(__('Invalid payment method.', 'fflcommerce'));
         }
         return false;
     }
     $shipping_total = fflcommerce_cart::$shipping_total;
     if (self::get_options()->get('fflcommerce_prices_include_tax') == 'yes') {
         $shipping_total += fflcommerce_cart::$shipping_tax_total;
     }
     return $gateway->process_gateway(number_format(fflcommerce_cart::$subtotal, 2, '.', ''), number_format($shipping_total, 2, '.', ''), number_format(fflcommerce_cart::$discount_total, 2, '.', ''));
 }