Example #1
0
 public function __construct($pConfigFile = '')
 {
     if ($pConfigFile != '') {
         $this->parseFile($pConfigFile);
     }
     parent::__construct();
 }
Example #2
0
 /**
  * Check whether method available for checkout or not
  * Logic based on merchant country, methods dependence
  *
  * @param string|null $methodCode
  * @return bool
  * @SuppressWarnings(PHPMD.CyclomaticComplexity)
  */
 public function isMethodAvailable($methodCode = null)
 {
     return parent::isMethodAvailable($methodCode);
 }
Example #3
0
 /**
  * Constructor
  *
  * @author Art <*****@*****.**>
  *
  * @param array $cfg Default configuration overrides
  */
 public function __construct(array $cfg = [])
 {
     self::setDefaultConfig();
     parent::__construct(self::$defaults, $cfg);
 }
Example #4
0
 /**
  * Check whether method available for checkout or not
  * Logic based on merchant country, methods dependence
  *
  * @param string|null $methodCode
  * @return bool
  * @SuppressWarnings(PHPMD.CyclomaticComplexity)
  */
 public function isMethodAvailable($methodCode = null)
 {
     $result = parent::isMethodAvailable($methodCode);
     switch ($methodCode) {
         case self::METHOD_WPP_EXPRESS:
         case self::METHOD_WPS_EXPRESS:
             if ($this->isMethodActive(self::METHOD_PAYFLOWPRO) || $this->isMethodActive(self::METHOD_PAYMENT_PRO)) {
                 $result = true;
             }
             break;
         case self::METHOD_WPP_BML:
         case self::METHOD_WPS_BML:
             // check for express payments dependence
             if (!$this->isMethodActive(self::METHOD_WPP_EXPRESS) && !$this->isMethodActive(self::METHOD_WPS_EXPRESS)) {
                 $result = false;
             }
             break;
         case self::METHOD_WPP_PE_EXPRESS:
             // check for direct payments dependence
             if ($this->isMethodActive(self::METHOD_PAYFLOWLINK) || $this->isMethodActive(self::METHOD_PAYFLOWADVANCED)) {
                 $result = true;
             } elseif (!$this->isMethodActive(self::METHOD_PAYFLOWPRO)) {
                 $result = false;
             }
             break;
         case self::METHOD_WPP_PE_BML:
             // check for express payments dependence
             if (!$this->isMethodActive(self::METHOD_WPP_PE_EXPRESS)) {
                 $result = false;
             }
             break;
         case self::METHOD_BILLING_AGREEMENT:
             $result = $this->isWppApiAvailabe();
             break;
     }
     return $result;
 }
 /**
  * Returns the default configuration
  *
  * @author Art <*****@*****.**>
  * @return array
  */
 public function getDefaultConfig()
 {
     return $this->config->getDefaultConfig();
 }
Example #6
0
 public function all()
 {
     $this->config = $this->getFileContentsSafely();
     return parent::all();
 }