protected function getModeFromCardType($t) { // $t is Shopware_Controllers_Backend_BuiswPayOne::$creditcards [value] foreach (Shopware_Controllers_Backend_BuiswPaymentPayone::$creditcards as $c) { if ($c['value'] == $t) { $key = $c['key'] . '_mode'; return Shopware_Controllers_Backend_BuiswPaymentPayone::Config($key); } } return 'test'; }
protected function getAuthMode($subpay) { switch ($subpay) { case 'creditcard': $key = $this->search_multi_array($usersettings['payonesubpay_creditcard_card'], Shopware_Controllers_Backend_BuiswPaymentPayone::$creditcards); $subpay = Shopware_Controllers_Backend_BuiswPaymentPayone::$creditcards[$key]['key']; break; case 'onlinepay': $key = $this->search_multi_array($usersettings['payonesubpay_creditcard_card'], Shopware_Controllers_Backend_BuiswPaymentPayone::$creditcards); $subpay = Shopware_Controllers_Backend_BuiswPaymentPayone::$creditcards[$key]['key']; break; } $m = Shopware_Controllers_Backend_BuiswPaymentPayone::Config($subpay . '_authmethod'); return ($m == 'auth') ? 'authorization' : 'preauthorization'; }
protected function checkPaymentScore($key, $cScore, $allowedScores) { $res = ($cScore->status == false); $res |= in_array(Shopware_Controllers_Backend_BuiswPaymentPayone::Config($key . "_ampelwert"), $allowedScores[$cScore->ampelwert]); $res |= ($cScore->infoscore > Shopware_Controllers_Backend_BuiswPaymentPayone::Config($key . "_boniscore")); return (Shopware_Controllers_Backend_BuiswPaymentPayone::Config($key . "_active") == "on" && $res); }
public function Config($k = null, $v = null) { if (self::$config === null) { self::$config = array (); $sql = 'select * from ' . Shopware_Plugins_Frontend_buiswPaymentPayone_Bootstrap::TABLE_CONFIG; $res = Shopware()->Db()->fetchAll($sql); foreach ($res as $r) { self::$config[$r['key']] = $r['val']; } foreach (array_merge(self::$creditcards, self::$directdebits, self::$otherPayments) as $c) { $active = $c['key'] . '_active'; $mode = $c['key'] . '_mode'; if (!array_key_exists($active, self::$config)) { self::$config[$active] = 'on'; } if (!array_key_exists($mode, self::$config)) { self::$config[$mode] = 'test'; } } if (!array_key_exists('send_cart', self::$config)) { self::$config['send_cart'] = 'off'; } if (!array_key_exists('bonitaets_mode', self::$config)) { self::$config['bonitaets_mode'] = 'test'; } if (!array_key_exists('bonitaets_type', self::$config)) { self::$config['bonitaets_type'] = 'NO'; } if (!array_key_exists('bonitaets_lifetime', self::$config)) { self::$config['bonitaets_lifetime'] = '30'; } if (!array_key_exists('bonitaets_minbasketvalue', self::$config)) { self::$config['bonitaets_minbasketvalue'] = '100'; } if (!array_key_exists('bonitaets_defaultindex', self::$config)) { self::$config['bonitaets_defaultindex'] = '250'; } if (!array_key_exists('addresscheck_type', self::$config)) { self::$config['addresscheck_type'] = 'NO'; } } if (!$k) { return self::$config; } if ($v !== null) { $sql = 'insert into ' . Shopware_Plugins_Frontend_buiswPaymentPayone_Bootstrap::TABLE_CONFIG . '(`key`,`val`) values (?,?) on duplicate key update `val`=?'; Shopware()->Db()->query($sql, array($k, $v, $v)); self::$config[$k] = $v; } return self::$config[$k]; }