Exemple #1
0
 public function hookPayment($params)
 {
     if (!$this->active) {
         return;
     }
     if (!$this->checkCurrency()) {
         return;
     }
     if (!$this->checkModuleCurrency()) {
         return $this->display(__FILE__, 'templates/gopay_check_config.tpl');
     }
     global $smarty, $cookie;
     $param = '';
     $payUrl = 'modules/gopay/pay.php';
     $payMode = trim(Configuration::get('GOPAY_PAY_MODE'));
     // předvybraná platební metoda
     $preconfMethod = trim(Configuration::get('GOPAY_PRECONF_METHOD'));
     $paymentMethodList = GopaySoap::paymentMethodList();
     $paymentMethods = array();
     for ($i = 0; $i < count($paymentMethodList); $i++) {
         if ($preconfMethod == $paymentMethodList[$i]->code) {
             $param = "&paymentChannel=" . $paymentMethodList[$i]->code;
         }
         if (Configuration::get($paymentMethodList[$i]->code) == "1") {
             $paymentMethods[] = array('title' => $paymentMethodList[$i]->paymentMethod, 'logo' => $paymentMethodList[$i]->logo, 'code' => $paymentMethodList[$i]->code);
         }
     }
     $smarty->assign(array('payUrl' => $payUrl, 'cartId' => intval($params['cart']->id), 'param' => $param, 'paymentMethods' => $paymentMethods));
     // singlechoice mode
     if ($payMode == 'single') {
         return $this->display(__FILE__, 'templates/gopay_single.tpl');
     } else {
         return $this->display(__FILE__, 'templates/gopay_multi.tpl');
     }
 }