function pre_confirmation_check()
 {
     global $oscTemplate, $order;
     parent::pre_confirmation_check();
     $oscTemplate->addBlock('<script type="text/javascript" src="ext/modules/payment/paymill/public/javascript/BrandDetection.js"></script>', 'header_tags');
     $oscTemplate->addBlock('<script type="text/javascript" src="ext/modules/payment/paymill/public/javascript/cc.js"></script>', 'header_tags');
     $months_array = array();
     $months_array[1] = array('01', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_JANUARY);
     $months_array[2] = array('02', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_FEBRUARY);
     $months_array[3] = array('03', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_MARCH);
     $months_array[4] = array('04', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_APRIL);
     $months_array[5] = array('05', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_MAY);
     $months_array[6] = array('06', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_JUNE);
     $months_array[7] = array('07', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_JULY);
     $months_array[8] = array('08', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_AUGUST);
     $months_array[9] = array('09', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_SEPTEMBER);
     $months_array[10] = array('10', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_OCTOBER);
     $months_array[11] = array('11', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_NOVEMBER);
     $months_array[12] = array('12', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_DECEMBER);
     $today = getdate();
     $years_array = array();
     for ($i = $today['year']; $i < $today['year'] + 10; $i++) {
         $years_array[$i] = array(tep_output_string(strftime('%Y', mktime(0, 0, 0, 1, 1, $i))), tep_output_string_protected(strftime('%Y', mktime(0, 0, 0, 1, 1, $i))));
     }
     $this->fastCheckout->setFastCheckoutFlag($this->fastCheckoutFlag);
     $payment = $this->getPayment($_SESSION['customer_id']);
     $script = '<script type="text/javascript">' . 'var cclogging = "' . MODULE_PAYMENT_PAYMILL_CC_LOGGING . '";' . 'var cc_expiery_invalid = "' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_EXPIRY_INVALID . '";' . 'var cc_owner_invalid = "' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_OWNER_INVALID . '";' . 'var cc_card_number_invalid = "' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_CARDNUMBER_INVALID . '";' . 'var cc_cvc_number_invalid = "' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_CVC_INVALID . '";' . 'var brand = "' . $payment['card_type'] . '";' . 'var paymill_total = ' . json_encode($this->format_raw($order->info['total'])) . ';' . 'var paymill_currency = ' . json_encode(strtoupper($order->info['currency'])) . ';' . 'var paymill_cc_months = ' . json_encode($months_array) . ';' . 'var paymill_cc_years = ' . json_encode($years_array) . ';' . 'var paymill_cc_number_val = "' . $payment['last4'] . '";' . 'var paymill_cc_cvc_val = "' . $payment['cvc'] . '";' . 'var paymill_cc_card_type = "' . utf8_decode($payment['card_type']) . '";' . 'var paymill_cc_holder_val = "' . $payment['card_holder'] . '";' . 'var paymill_cc_expiry_month_val = "' . $payment['expire_month'] . '";' . 'var paymill_cc_expiry_year_val = "' . $payment['expire_year'] . '";' . 'var paymill_cc_fastcheckout = ' . ($this->fastCheckout->canCustomerFastCheckoutCc($_SESSION['customer_id']) ? 'true' : 'false') . ';' . 'var checkout_payment_link = "' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'step=step2', 'SSL', true, false) . '&payment_error=' . $this->code . '&error=";' . 'var logos =  new Array();' . "logos['amex'] = " . strtolower(MODULE_PAYMENT_PAYMILL_CC_AMEX) . ";" . "logos['carta-si'] = " . strtolower(MODULE_PAYMENT_PAYMILL_CC_CARTASI) . ";" . "logos['dankort'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_DANKORT) . ";" . "logos['carte-bleue'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_CARTEBLEUE) . ";" . "logos['discover'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_DISCOVER) . ";" . "logos['diners-club'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_DINERSCLUB) . ";" . "logos['china-unionpay'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_UNIONPAY) . ";" . "logos['maestro'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_MAESTRO) . ";" . "logos['jcb'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_JCB) . ";" . "logos['mastercard'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_MASTERCARD) . ";" . "logos['visa'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_VISA) . ";" . "var allBrandsDisabled = !logos['amex'] && !logos['carta-si'] && !logos['dankort'] && !logos['carte-bleue'] && !logos['discover'] && !logos['diners-club'] && !logos['china-unionpay'] && !logos['maestro'] && !logos['jcb'] && !logos['mastercard'] && !logos['visa'];" . '</script>';
     $oscTemplate->addBlock($script, 'header_tags');
     $oscTemplate->addBlock('<form id="paymill_form" action="' . tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL') . '" method="post"></form>', 'footer_scripts');
 }
 function pre_confirmation_check()
 {
     global $oscTemplate, $order;
     parent::pre_confirmation_check();
     $oscTemplate->addBlock('<script type="text/javascript" src="ext/modules/payment/paymill/public/javascript/Iban.js"></script>', 'header_tags');
     $oscTemplate->addBlock('<script type="text/javascript" src="ext/modules/payment/paymill/public/javascript/elv.js"></script>', 'header_tags');
     $oscTemplate->addBlock('<script type="text/javascript" src="ext/modules/payment/paymill/public/javascript/Sepa.js"></script>', 'header_tags');
     $this->fastCheckout->setFastCheckoutFlag($this->fastCheckoutFlag);
     $payment = $this->getPayment($_SESSION['customer_id']);
     $script = '<script type="text/javascript">' . 'var elvlogging = "' . MODULE_PAYMENT_PAYMILL_ELV_LOGGING . '";' . 'var sepaActive ="' . MODULE_PAYMENT_PAYMILL_ELV_SEPA . '";' . 'var elv_account_number_invalid = "' . MODULE_PAYMENT_PAYMILL_ELV_TEXT_ACCOUNT_INVALID . '";' . 'var elv_bank_code_invalid = "' . MODULE_PAYMENT_PAYMILL_ELV_TEXT_BANKCODE_INVALID . '";' . 'var elv_bank_owner_invalid = "' . MODULE_PAYMENT_PAYMILL_ELV_TEXT_ACCOUNT_HOLDER_INVALID . '";' . 'var elv_iban_invalid = "' . MODULE_PAYMENT_PAYMILL_ELV_TEXT_IBAN_INVALID . '";' . 'var elv_bic_invalid = "' . MODULE_PAYMENT_PAYMILL_ELV_TEXT_BIC_INVALID . '";' . 'var paymill_account_name = ' . json_encode(tep_output_string_protected($order->billing['firstname'] . ' ' . $order->billing['lastname'])) . ';' . 'var paymill_elv_code = "' . $payment['code'] . '";' . 'var paymill_elv_holder = "' . utf8_decode($payment['holder']) . '";' . 'var paymill_elv_account = "' . $payment['account'] . '";' . 'var paymill_elv_iban = "' . $payment['iban'] . '";' . 'var paymill_elv_bic = "' . $payment['bic'] . '";' . 'var paymill_elv_fastcheckout = ' . ($this->fastCheckout->canCustomerFastCheckoutElv($_SESSION['customer_id']) ? 'true' : 'false') . ';' . 'var checkout_payment_link = "' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'step=step2', 'SSL', true, false) . '&payment_error=' . $this->code . '&error=' . '";' . '</script>';
     $oscTemplate->addBlock($script, 'header_tags');
     $oscTemplate->addBlock('<form id="paymill_form" action="' . tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL') . '" method="post" style="display: none;"></form>', 'footer_scripts');
 }