/** * @return Payfort_Fort_Config */ public static function getInstance($registry) { if (self::$instance === null) { self::$instance = new Payfort_Fort_Helper($registry); } return self::$instance; }
public function __construct($registry) { $this->pfHelper = Payfort_Fort_Helper::getInstance($registry); $this->pfConfig = Payfort_Fort_Config::getInstance($registry); $this->pfOrder = new Payfort_Fort_Order($registry); $this->registry = $registry; }
public function __construct(\Zend_Controller_Request_Abstract $request, \Zend_Controller_Response_Abstract $response, array $invokeArgs = array()) { $this->pfConfig = Payfort_Fort_Config::getInstance(); $this->pfPayment = Payfort_Fort_Payment::getInstance(); $this->pfHelper = Payfort_Fort_Helper::getInstance(); $this->pfOrder = new Payfort_Fort_Order(); $this->integrationType = 'redirection'; parent::__construct($request, $response, $invokeArgs); }
public function __construct($registry) { parent::__construct($registry); $this->pfConfig = Payfort_Fort_Config::getInstance($registry); $this->pfPayment = Payfort_Fort_Payment::getInstance($registry); $this->pfHelper = Payfort_Fort_Helper::getInstance($registry); $this->pfOrder = new Payfort_Fort_Order($registry); $this->integrationType = $this->pfConfig->getCcIntegrationType(); $this->paymentMethod = PAYFORT_FORT_PAYMENT_METHOD_CC; }
public function __construct() { parent::__construct(); $this->pfConfig = Payfort_Fort_Config::getInstance(); $this->pfHelper = Payfort_Fort_Helper::getInstance(); $this->pfPayment = Payfort_Fort_Payment::getInstance(); if (session_id() == '') { session_start(); } }
public function __construct() { global $woocommerce; $this->has_fields = false; $this->load_plugin_textdomain(); $this->icon = apply_filters('woocommerce_FORT_icon', PAYFORT_FORT_URL . 'assets/images/cards.png'); if (is_admin()) { $this->has_fields = true; $this->init_form_fields(); } // Define user set variables $this->title = Payfort_Fort_Language::__('Credit / Debit Card'); $this->description = $this->get_option('description'); $this->pfConfig = Payfort_Fort_Config::getInstance(); $this->pfHelper = Payfort_Fort_Helper::getInstance(); $this->pfPayment = Payfort_Fort_Payment::getInstance(); $this->enable_sadad = $this->get_option('enable_sadad') == 'yes' ? true : false; $baseCurrency = $this->pfHelper->getBaseCurrency(); $frontCurrency = $this->pfHelper->getFrontCurrency(); if ($this->pfHelper->getFortCurrency($baseCurrency, $frontCurrency) != 'SAR') { $this->enable_sadad = false; } $this->enable_naps = $this->get_option('enable_naps') == 'yes' ? true : false; if ($this->pfHelper->getFortCurrency($baseCurrency, $frontCurrency) != 'QAR') { $this->enable_naps = false; } $this->enable_credit_card = $this->get_option('enable_credit_card') == 'yes' ? true : false; // Actions add_action('woocommerce_receipt_' . $this->id, array($this, 'receipt_page')); add_action('wp_enqueue_scripts', array($this, 'payment_scripts')); // Save options add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options')); if (!$this->is_valid_for_use()) { $this->enabled = false; } //add_action('woocommerce_api_'.strtolower(get_class($this).'_process_response'), array(&$this, 'process_response')); //add_action('woocommerce_api_'.strtolower(get_class($this).'_merchantPageResponse'), array(&$this, 'merchantPageResponse')); //add_action('woocommerce_api_'.strtolower(get_class($this).'_merchantPageCancel'), array(&$this, 'merchantPageCancel')); add_action('woocommerce_wc_gateway_payfort_fort_process_response', array(&$this, 'process_response')); add_action('woocommerce_wc_gateway_payfort_fort_responseOnline', array(&$this, 'responseOnline')); add_action('woocommerce_wc_gateway_payfort_fort_merchantPageResponse', array(&$this, 'merchantPageResponse')); add_action('woocommerce_wc_gateway_payfort_fort_merchantPageCancel', array(&$this, 'merchantPageCancel')); }
public function __construct($registry) { parent::__construct($registry); $this->pfConfig = Payfort_Fort_Config::getInstance($registry); $this->pfHelper = Payfort_Fort_Helper::getInstance($registry); }
public function hookPayment($params) { $currency = Currency::getCurrencyInstance($this->context->cookie->id_currency); $isFailed = Tools::getValue('payfortforterror'); $url = $this->_getUrl('fc=module&module=payfortfort&controller=payment&action=postPaymentForm'); $SADAD = Configuration::get('PAYFORT_FORT_SADAD'); $NAPS = Configuration::get('PAYFORT_FORT_NAPS'); $credit_card = Configuration::get('PAYFORT_FORT_CREDIT_CARD'); $integration_type = Configuration::get('PAYFORT_FORT_INTEGRATION_TYPE'); $pfHelper = Payfort_Fort_Helper::getInstance(); $frontCurrency = $pfHelper->getFrontCurrency(); $baseCurrency = $pfHelper->getBaseCurrency(); $fortCurrency = $pfHelper->getFortCurrency($baseCurrency, $frontCurrency); if ($fortCurrency != 'SAR') { $SADAD = 0; } if ($fortCurrency != 'QAR') { $NAPS = 0; } $this->context->smarty->assign('url', $url); $this->context->smarty->assign('SADAD', $SADAD); $this->context->smarty->assign('NAPS', $NAPS); $this->context->smarty->assign('credit_card', $credit_card); $this->context->smarty->assign('integration_type', $integration_type); $this->context->smarty->assign('payfort_path', $this->getPathUri()); $arr_js_messages = array('error_invalid_card_number' => $this->l('error_invalid_card_number'), 'error_invalid_card_holder_name' => $this->l('error_invalid_card_holder_name'), 'error_invalid_expiry_date' => $this->l('error_invalid_expiry_date'), 'error_invalid_cvc_code' => $this->l('error_invalid_cvc_code'), 'error_invalid_cc_details' => $this->l('error_invalid_cc_details')); $js_msgs = $pfHelper->loadJsMessages($arr_js_messages); $this->context->smarty->assign('arr_js_messages', $js_msgs); return $this->display(__FILE__, 'views/templates/hook/payfortfort.tpl'); }
function __construct() { $this->pfConfig = Payfort_Fort_Config::getInstance(); $this->pfHelper = Payfort_Fort_Helper::getInstance(); }
public function __construct() { parent::__construct(); $this->pfHelper = Payfort_Fort_Helper::getInstance(); $this->pfConfig = Payfort_Fort_Config::getInstance(); $this->pfOrder = new Payfort_Fort_Order(); }