Exemplo n.º 1
0
 /**
  * Returns the HTML code for the Yellowpay payment method.
  * 
  * @param array $data post data from the user
  * 
  * @return  string  HTML code
  */
 function _yellowpay($data = array())
 {
     global $_ARRAYLANG;
     $objSettings = new \Cx\Modules\Calendar\Controller\CalendarSettings();
     $arrCalendarSettings = $objSettings->getYellowpaySettings();
     $arrOrder = array('ORDERID' => $data['orderID'], 'AMOUNT' => $data['amount'], 'CURRENCY' => $data['currency'], 'PARAMPLUS' => "section=Calendar&cmd=success&handler=yellowpay");
     $arrSettings = array();
     $arrSettings['postfinance_shop_id']['value'] = $arrCalendarSettings['paymentYellowpayPspid'];
     $arrSettings['postfinance_hash_signature_in']['value'] = $arrCalendarSettings['paymentYellowpayShaIn'];
     $arrSettings['postfinance_authorization_type']['value'] = $arrCalendarSettings['paymentYellowpayAuthorization'] == 0 ? 'SAL' : 'RES';
     $arrSettings['postfinance_use_testserver']['value'] = $arrCalendarSettings['paymentTestserver'];
     $landingPage = \Env::get('em')->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\Page')->findOneByModuleCmdLang('Calendar', 'success', FRONTEND_LANG_ID);
     $yellowpayForm = \Yellowpay::getForm($arrOrder, $_ARRAYLANG['TXT_CALENDAR_START_PAYMENT'], false, $arrSettings, $landingPage);
     if (_PAYMENT_DEBUG && \Yellowpay::$arrError) {
         $strError = '<font color="red"><b>' . $_ARRAYLANG['TXT_SHOP_PSP_FAILED_TO_INITIALISE_YELLOWPAY'] . '<br /></b>';
         if (_PAYMENT_DEBUG) {
             $strError .= join('<br />', \Yellowpay::$arrError);
             //.'<br />';
         }
         return $strError . '</font>';
     }
     return $yellowpayForm;
 }
Exemplo n.º 2
0
 /**
  * Performs the settings menu based on the $_GET request
  *
  * @return null
  */
 function showSettings()
 {
     global $objDatabase, $_ARRAYLANG, $_CORELANG;
     $this->_objTpl->loadTemplateFile('module_calendar_settings.html');
     $this->_pageTitle = $_ARRAYLANG['TXT_CALENDAR_MENU_SETTINGS'];
     $this->_objTpl->setGlobalVariable(array('TXT_' . $this->moduleLangVar . '_GLOBAL' => $_ARRAYLANG['TXT_CALENDAR_GLOBAL'], 'TXT_' . $this->moduleLangVar . '_REGISTRATION_FORMS' => $_ARRAYLANG['TXT_CALENDAR_REGISTRATION_FORMS'], 'TXT_' . $this->moduleLangVar . '_MAIL_TEMPLATES' => $_ARRAYLANG['TXT_CALENDAR_MAIL_TEMPLATES'], 'TXT_' . $this->moduleLangVar . '_PUBLICATION' => $_ARRAYLANG['TXT_CALENDAR_PUBLICATION'], 'TXT_' . $this->moduleLangVar . '_PAYMENT' => $_ARRAYLANG['TXT_CALENDAR_PAYMENT'], 'TXT_' . $this->moduleLangVar . '_DATE_DISPLAY' => $_ARRAYLANG['TXT_CALENDAR_DATE_DISPLAY'], 'TXT_' . $this->moduleLangVar . '_SAVE' => $_ARRAYLANG['TXT_CALENDAR_SAVE']));
     $objSettings = new \Cx\Modules\Calendar\Controller\CalendarSettings();
     switch ($_GET['tpl']) {
         /* case 'hosts':
                $objSettings->hosts($this->_objTpl);
                break;
            case 'modify_host':
                $objSettings->modifyHost($this->_objTpl, intval($_GET['id']));
                break; */
         case 'mails':
             $objSettings->mails($this->_objTpl);
             break;
         case 'modify_mail':
             $objSettings->modifyMail($this->_objTpl, intval($_GET['id']));
             break;
         case 'forms':
             $objSettings->forms($this->_objTpl);
             break;
         case 'modify_form':
             $objSettings->modifyForm($this->_objTpl, intval($_GET['id']));
             break;
             /* case 'payment':
                $objSettings->payment($this->_objTpl);
                break; */
         /* case 'payment':
            $objSettings->payment($this->_objTpl);
            break; */
         case 'date':
             $objSettings->dateDisplay($this->_objTpl);
             break;
         case 'general':
         default:
             $objSettings->general($this->_objTpl);
     }
     $this->okMessage = $objSettings->okMessage != '' ? $objSettings->okMessage : null;
     $this->errMessage = $objSettings->errMessage != '' ? $objSettings->errMessage : null;
     $this->_objTpl->parse('settings_content');
 }