function tep_update_whos_online()
{
    global $customer_id;
    if (tep_session_is_registered('customer_id')) {
        $wo_customer_id = $customer_id;
        $customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $customer_id . "'");
        $customer = tep_db_fetch_array($customer_query);
        $wo_full_name = $customer['customers_firstname'] . ' ' . $customer['customers_lastname'];
    } else {
        $wo_customer_id = '';
        $wo_full_name = 'Guest';
    }
    $wo_session_id = tep_session_id();
    $wo_ip_address = tep_get_ip_address();
    $wo_last_page_url = tep_db_prepare_input(getenv('REQUEST_URI'));
    $current_time = time();
    $xx_mins_ago = $current_time - 900;
    // remove entries that have expired
    tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
    $stored_customer_query = tep_db_query("select session_id from " . TABLE_WHOS_ONLINE . " where session_id = '" . tep_db_input($wo_session_id) . "' limit 1");
    if (tep_db_num_rows($stored_customer_query) > 0) {
        tep_db_query("update " . TABLE_WHOS_ONLINE . " set customer_id = '" . (int) $wo_customer_id . "', full_name = '" . tep_db_input($wo_full_name) . "', ip_address = '" . tep_db_input($wo_ip_address) . "', time_last_click = '" . tep_db_input($current_time) . "', last_page_url = '" . tep_db_input($wo_last_page_url) . "' where session_id = '" . tep_db_input($wo_session_id) . "'");
    } else {
        tep_db_query("insert into " . TABLE_WHOS_ONLINE . " (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url) values ('" . (int) $wo_customer_id . "', '" . tep_db_input($wo_full_name) . "', '" . tep_db_input($wo_session_id) . "', '" . tep_db_input($wo_ip_address) . "', '" . tep_db_input($current_time) . "', '" . tep_db_input($current_time) . "', '" . tep_db_input($wo_last_page_url) . "')");
    }
}
Ejemplo n.º 2
0
 function get_email_footer()
 {
     global $order, $customer_id, $currencies;
     $email_footer = '';
     if (is_object($order) && $this->enabled) {
         $this->update_status();
         $ot_total_value = 0;
         reset($order->totals);
         while (list(, $ot) = each($order->totals)) {
             if ($ot['class'] == 'ot_total') {
                 $ot_total_value = $ot['value'];
                 break;
             }
         }
         $ot_total_value = round($ot_total_value * $currencies->get_value(MODULE_PAYMENT_INTERKASSA_DEFAULT_CURRENCY), $currencies->get_decimal_places(MODULE_PAYMENT_INTERKASSA_DEFAULT_CURRENCY));
         $ot_total_value = str_replace(',', '.', $ot_total_value);
         $insert_id = $order->info['id'];
         $sign = md5(MODULE_PAYMENT_INTERKASSA_LOGIN . ':' . $ot_total_value . ':' . $insert_id . ':' . '' . ':' . tep_session_id() . ':' . MODULE_PAYMENT_INTERKASSA_PASSWORD);
         $payment_url = (MODULE_PAYMENT_INTERKASSA_MODE == 'Test' ? 'https://test.interkassa.com/lib/payment.php' : 'https://interkassa.com/lib/payment.php') . '?ik_shop_id=' . urlencode(MODULE_PAYMENT_INTERKASSA_LOGIN) . '&ik_payment_amount=' . urlencode($ot_total_value) . '&ik_payment_id=' . $insert_id . '&ik_payment_desc=' . urlencode('Оплата заказа #' . $insert_id . ' в магазине ' . STORE_NAME) . '&ik_baggage_fields=' . tep_session_id() . '&ik_sign_hash=' . urlencode($sign);
         if (basename(SCRIPT_FILENAME) == FILENAME_ACCOUNT_HISTORY_INFO) {
             $email_footer = str_replace('>[link]<', '>' . substr($payment_url, 0, 33) . '...' . substr($payment_url, -10) . '<', MODULE_PAYMENT_INTERKASSA_TEXT_EMAIL_FOOTER);
             $email_footer = str_replace('[link]', $payment_url, $email_footer);
             //		  $email_footer = str_replace(' target="_blank"', '', $email_footer);
         } else {
             $email_footer = str_replace('[link]', $payment_url, MODULE_PAYMENT_INTERKASSA_TEXT_EMAIL_FOOTER);
         }
     }
     return $email_footer;
 }
 function get_current_page()
 {
     global $HTTP_GET_VARS, $HTTP_POST_VARS, $request_type;
     $get_vars = array();
     if (tep_not_null(REQUEST_URI)) {
         if (strpos(REQUEST_URI, '?')) {
             $current_page = PHP_SELF;
             //		  if (substr($current_page, 0, strlen(DIR_WS_CATALOG))==DIR_WS_CATALOG) $current_page = substr($current_page, strlen(DIR_WS_CATALOG));
             $qstring = substr(REQUEST_URI, strpos(REQUEST_URI, '?') + 1);
             $qstring_array = explode('&', str_replace('&amp;', '&', $qstring));
             reset($qstring_array);
             while (list(, $get_var) = each($qstring_array)) {
                 list($var_name, $var_value) = explode('=', $get_var);
                 if (!in_array($var_name, array('x', 'y'))) {
                     $get_vars[$var_name] = urldecode($var_value);
                 }
             }
         } else {
             $current_page = REQUEST_URI;
             $qstring = '';
         }
     } else {
         $current_page = basename(SCRIPT_FILENAME);
         $get_vars = $HTTP_GET_VARS;
     }
     if (!in_array(tep_session_name(), array_keys($get_vars))) {
         $get_vars[tep_session_name()] = tep_session_id();
     }
     return array('page' => $current_page, 'mode' => $request_type, 'get' => $get_vars, 'post' => $HTTP_POST_VARS, 'real_page' => basename(SCRIPT_FILENAME), 'real_get' => $HTTP_GET_VARS);
 }
Ejemplo n.º 4
0
function get_admin_link($page = '', $parameters = '', $add_session_id = true)
{
    global $request_type, $session_started, $SID;
    if (!tep_not_null($page)) {
        $page = PAGE_DEFAULT;
    }
    $link = _HTTP_ADMIN_SITE_ROOT . '/?';
    if (tep_not_null($parameters)) {
        $link .= $page . '&' . tep_output_string($parameters);
        $separator = '&';
    } else {
        $link .= $page;
        $separator = '&';
    }
    while (substr($link, -1) == '&' || substr($link, -1) == '?') {
        $link = substr($link, 0, -1);
    }
    // Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
    if ($add_session_id == true && $session_started == true && SESSION_FORCE_COOKIE_USE == 'False') {
        if (tep_not_null($SID)) {
            $_sid = $SID;
        } elseif ($request_type == 'NONSSL' && $connection == 'SSL' && ENABLE_SSL == true || $request_type == 'SSL' && $connection == 'NONSSL') {
            if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
                $_sid = tep_session_name() . '=' . tep_session_id();
            }
        }
    }
    if (isset($_sid)) {
        $link .= $separator . tep_output_string($_sid);
    }
    return $link;
}
Ejemplo n.º 5
0
function osc_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true)
{
    if (!tep_not_null($page)) {
        die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
    }
    if ($connection == 'NONSSL') {
        $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
    } elseif ($connection == 'SSL') {
        if (ENABLE_SSL == true) {
            $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
        } else {
            $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
        }
    } else {
        die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
    }
    if (tep_not_null($parameters)) {
        $link .= $page . '?' . tep_output_string($parameters);
        $separator = '&';
    } else {
        $link .= $page;
        $separator = '?';
    }
    while (substr($link, -1) == '&' || substr($link, -1) == '?') {
        $link = substr($link, 0, -1);
    }
    // Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
    if ($add_session_id == true && usu::$session_started == true && SESSION_FORCE_COOKIE_USE == 'False') {
        if (tep_not_null(usu::$sid)) {
            $_sid = usu::$sid;
        } elseif (usu::$request_type == 'NONSSL' && $connection == 'SSL' && ENABLE_SSL == true || usu::$request_type == 'SSL' && $connection == 'NONSSL') {
            if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
                $_sid = tep_session_name() . '=' . tep_session_id();
            }
        }
    }
    //commented out SEARCH_ENGINE_FRIENDLY_URLS since removed from oscmax 2.1 sql file
    /*   if ( ( SEARCH_ENGINE_FRIENDLY_URLS == 'true' ) && ( $search_engine_safe == true ) ) {
          while ( strstr( $link, '&&' ) ) $link = str_replace( '&&', '&', $link );
    
          $link = str_replace( '?', '/', $link );
          $link = str_replace( '&', '/', $link );
          $link = str_replace( '=', '/', $link );
    
          $separator = '?';
        }
    */
    if (isset($_sid)) {
        $link .= $separator . tep_output_string($_sid);
    }
    usu::$performance['std_url_array'][] = $link;
    if (defined('SEO_URLS_USE_W3C_VALID') && SEO_URLS_USE_W3C_VALID == 'true') {
        return htmlspecialchars(utf8_encode($link));
    }
    return $link;
}
Ejemplo n.º 6
0
function tep_update_whos_online()
{
    // WOL 1.6 - Need access to spider_flag and user_agent and moved some assignments up here from below
    global $customer_id, $spider_flag, $user_agent;
    $wo_ip_address = tep_get_ip_address();
    $wo_last_page_url = request_uri();
    $current_time = time();
    $xx_mins_ago = $current_time - 900;
    $wo_session_id = tep_session_id();
    $wo_user_agent = $user_agent;
    // WOL 1.6 EOF
    if ($customer_id > 0) {
        //if (tep_session_is_registered('customer_id')) {
        //$wo_session_id = tep_session_id();
        $wo_customer_id = $customer_id;
        $customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $customer_id . "'");
        $customer = tep_db_fetch_array($customer_query);
        $wo_full_name = $customer['customers_firstname'] . ' ' . $customer['customers_lastname'];
    } else {
        if ($spider_flag) {
            // Bots are customerID = -1
            $wo_customer_id = -1;
            // The Bots name is extracted from the User Agent in the WOE Admin screen
            $wo_full_name = $user_agent;
            // Session IDs are the WOE primary key.  If a Bot doesn't have a session (normally shouldn't),
            //   use the IP Address as unique identifier, otherwise, use the session ID
            if ($wo_session_id == "") {
                $wo_session_id = $wo_ip_address;
            }
        } else {
            // Must be a Guest
            $wo_full_name = 'Guest';
            $wo_customer_id = 0;
        }
        // WOL 1.6 EOF
    }
    // remove entries that have expired
    tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
    $stored_customer_query = tep_db_query("select count(*) as count from " . TABLE_WHOS_ONLINE . " where session_id = '" . tep_db_input($wo_session_id) . "'");
    $stored_customer = tep_db_fetch_array($stored_customer_query);
    if ($stored_customer['count'] > 0) {
        tep_db_query("update " . TABLE_WHOS_ONLINE . " set customer_id = '" . (int) $wo_customer_id . "', full_name = '" . tep_db_input($wo_full_name) . "', ip_address = '" . tep_db_input($wo_ip_address) . "', time_last_click = '" . tep_db_input($current_time) . "', last_page_url = '" . tep_db_input($wo_last_page_url) . "' where session_id = '" . tep_db_input($wo_session_id) . "'");
    } else {
        tep_db_query("insert into " . TABLE_WHOS_ONLINE . " (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url, http_referer, user_agent) values ('" . (int) $wo_customer_id . "', '" . tep_db_input($wo_full_name) . "', '" . tep_db_input($wo_session_id) . "', '" . tep_db_input($wo_ip_address) . "', '" . tep_db_input($current_time) . "', '" . tep_db_input($current_time) . "', '" . tep_db_input($wo_last_page_url) . "', '" . tep_db_input($_SERVER['HTTP_REFERER']) . "', '" . tep_db_input($user_agent) . "')");
    }
}
 function display_links($query_numrows, $max_rows_per_page, $max_page_links, $current_page_number, $parameters = '', $page_name = 'page')
 {
     global $PHP_SELF;
     if (tep_not_null($parameters) && substr($parameters, -1) != '&') {
         $parameters .= '&';
     }
     // calculate number of pages needing links
     $num_pages = ceil($query_numrows / $max_rows_per_page);
     $pages_array = array();
     for ($i = 1; $i <= $num_pages; $i++) {
         $pages_array[] = array('id' => $i, 'text' => $i);
     }
     if ($num_pages > 1) {
         $display_links = tep_draw_form('pages', basename($PHP_SELF), '', 'get');
         if ($current_page_number > 1) {
             $display_links .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $page_name . '=' . ($current_page_number - 1), 'NONSSL') . '" class="splitPageLink">' . PREVNEXT_BUTTON_PREV . '</a>&nbsp;&nbsp;';
         } else {
             $display_links .= PREVNEXT_BUTTON_PREV . '&nbsp;&nbsp;';
         }
         $display_links .= sprintf(TEXT_RESULT_PAGE, tep_draw_pull_down_menu($page_name, $pages_array, $current_page_number, 'onChange="this.form.submit();"'), $num_pages);
         if ($current_page_number < $num_pages && $num_pages != 1) {
             $display_links .= '&nbsp;&nbsp;<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $page_name . '=' . ($current_page_number + 1), 'NONSSL') . '" class="splitPageLink">' . PREVNEXT_BUTTON_NEXT . '</a>';
         } else {
             $display_links .= '&nbsp;&nbsp;' . PREVNEXT_BUTTON_NEXT;
         }
         if ($parameters != '') {
             if (substr($parameters, -1) == '&') {
                 $parameters = substr($parameters, 0, -1);
             }
             $pairs = explode('&', $parameters);
             while (list(, $pair) = each($pairs)) {
                 list($key, $value) = explode('=', $pair);
                 $display_links .= tep_draw_hidden_field(rawurldecode($key), rawurldecode($value));
             }
         }
         if (SID) {
             $display_links .= tep_draw_hidden_field(tep_session_name(), tep_session_id());
         }
         $display_links .= '</form>';
     } else {
         $display_links = sprintf(TEXT_RESULT_PAGE, $num_pages, $num_pages);
     }
     return $display_links;
 }
Ejemplo n.º 8
0
    }
}
if (isset($HTTP_GET_VARS['manufacturers_id']) && basename(SCRIPT_FILENAME) != FILENAME_MANUFACTURERS) {
    if (basename(SCRIPT_FILENAME) != FILENAME_ADVANCED_SEARCH && basename(SCRIPT_FILENAME) != FILENAME_ADVANCED_SEARCH_RESULT) {
        $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int) $HTTP_GET_VARS['manufacturers_id'] . "' and languages_id = '" . (int) DEFAULT_LANGUAGE_ID . "'");
        if (tep_db_num_rows($manufacturers_query) > 0) {
            $manufacturers = tep_db_fetch_array($manufacturers_query);
            $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_MANUFACTURERS, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']));
        }
    }
}
// if partner is set update partners
if (isset($HTTP_GET_VARS['partner']) && $session_started == true) {
    $partner_info_query = tep_db_query("select partners_id from " . TABLE_PARTNERS . " where partners_login = '******'partner'], 'CP1251', 'UTF-8'))) . "'");
    if (tep_db_num_rows($partner_info_query) < 1) {
        tep_db_query("insert into " . TABLE_PARTNERS . " (date_added, partners_login, date_of_last_logon, partners_register_type, partners_comission) values (now(), '" . tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['partner'])) . "', now(), 'auto', '" . tep_db_input(str_replace(',', '.', PARTNERS_COMISSION_DEFAULT / 100)) . "')");
        $partners_id = tep_db_insert_id();
    } else {
        $partner_info = tep_db_fetch_array($partner_info_query);
        $partners_id = $partner_info['partners_id'];
    }
    tep_db_query("insert into " . TABLE_PARTNERS_STATISTICS . " (partners_id, date_added, partners_statistics_page, partners_statistics_referer, partners_statistics_ip, partners_statistics_sid) values ('" . (int) $partners_id . "', now(), '" . tep_db_input(tep_db_prepare_input(REQUEST_URI)) . "', '" . tep_db_input(tep_db_prepare_input($_SERVER['HTTP_REFERER'])) . "', '" . tep_db_input(tep_get_ip_address()) . "', '" . tep_db_input(tep_session_id()) . "')");
    @tep_setcookie(str_replace('.', '_', STORE_NAME) . '_partner', $partners_id, time() + 60 * 60 * 24 * 30 * 2, '/');
}
// set which precautions should be checked
define('WARN_INSTALL_EXISTENCE', 'true');
define('WARN_CONFIG_WRITEABLE', 'false');
define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true');
define('WARN_SESSION_AUTO_START', 'true');
define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true');
$holiday_products_array = array('pearls' => array('title' => 'Ђ∆емчужинаї вашей библиотеки', 'products' => '152879, 152879, 164742, 166080, 244419, 276036, 307975, 44451, 44455, 45277, 45284, 47537, 524851, 549504, 62377', 'categories' => ''), 'art_albums' => array('title' => 'јльбомы по искусству', 'products' => '151248, 177562, 227545, 275800, 302609, 305304, 305345, 305905, 306189, 308790, 310516, 326703, 332484, 333583, 351876, 355236, 385907, 3870, 3884, 394134, 408614, 416433, 417561, 423783, 43872, 43879, 43982, 45016, 450274, 45040, 45541, 467051, 468197, 473169, 473180, 473181, 473190, 50388, 50445, 512932, 526223, 545250, 62009', 'categories' => ''), 'pets' => array('title' => '¬аши любимые питомцы', 'products' => '11308, 19503, 243569, 392509, 39910, 39913, 439461, 470371, 49446, 49455, 544530', 'categories' => ''), 'children' => array('title' => 'ƒетский Ќовый год', 'products' => '124613, 225298, 25222, 269475, 271673, 272098, 275298, 289242, 293623, 293624, 297554, 297648, 297649, 298433, 298466, 304929, 304930, 305004, 307479, 308927, 309508, 309709, 309709, 309710, 309710, 309712, 309712, 31134, 38982, 39458, 39784, 39784, 39785, 39786, 39787, 39788, 39788, 39790, 39790, 39791, 39791, 39795, 39799, 39998, 39998, 44561, 477244, 480629, 481035, 481036, 481038, 488411, 488412, 488413, 50995, 51056, 512939, 513991, 524395, 524471, 525152, 525425, 528934, 529049, 529050, 529051, 530685, 530726, 530900, 530901, 530902, 530903, 533382, 54117, 54199, 54290, 548651, 550001, 57222, 666515, 671325, 78137, 246321, 301109, 308927, 315131, 40712, 447897, 49131, 533187, 548656', 'categories' => '4946, 4987'), 'adventures' => array('title' => 'ћир путешествий и приключений', 'products' => '102635, 221700, 227545, 313937, 422826, 43947, 43949, 448966, 45471, 455812, 468528, 529778', 'categories' => ''), 'men' => array('title' => 'ѕодарки дл¤ насто¤щих мужчин', 'products' => '43901, 111616, 39944, 98000, 43744, 39961, 106390, 166091, 39954, 245990, 39946, 434611, 127472, 310371, 334410, 411303, 437137, 439455, 467793, 478709, 501918, 501992, 524435, 524436, 524437, 524438, 525963, 54023, 548939, 65757, 90793', 'categories' => ''), 'feast' => array('title' => 'ѕраздничный стол', 'products' => '127377, 127463, 165179, 176134, 178534, 186113, 225259, 238505, 238509, 245601, 306174, 310010, 331002, 334380, 354418, 400956, 419019, 43726, 449824, 450048, 468194, 480992, 499862, 501919, 513356, 513551, 531134, 533353, 544816, 548809, 549123, 549398, 549503, 549863, 57003, 57666, 62235, 667042', 'categories' => ''), 'christmas' => array('title' => '–ождество', 'products' => '16739, 272302, 275543, 40210, 467253, 499757, 512645, 513038, 513046, 528760, 544610, 549263, 289391, 305962, 306345, 307085, 318316, 396525, 433076, 465379, 481098, 499328, 533278', 'categories' => ''), 'souvenirs' => array('title' => '—увениры и при¤тные мелочи', 'products' => '425028, 425065, 425094, 425170, 425171, 425175, 425176, 425177, 425178, 425180, 425181, 425183', 'categories' => '4893, 3406, 3415, 3419, 3429, 4872, 9506'), 'women' => array('title' => '“олько дл¤ женщин', 'products' => '49453, 76750, 102773, 174786, 195937, 241647, 245920, 258642, 267722, 270181, 275127, 306380, 308222, 43745, 448967, 464270, 49453, 500025, 525199, 531137, 532184, 544552, 545236, 549828', 'categories' => ''), 'encyclopedia' => array('title' => 'Ёнциклопедии', 'products' => '164683, 214042, 236812, 39907, 39939, 39940, 39945, 39949, 39953, 39966, 45020, 45378, 462128, 68400', 'categories' => ''));
Ejemplo n.º 9
0
function tep_session_recreate()
{
    global $SID;
    if (PHP_VERSION >= 5.1) {
        session_regenerate_id(true);
        if (!empty($SID)) {
            $SID = tep_session_name() . '=' . tep_session_id();
        }
    }
}
Ejemplo n.º 10
0
        mkdir($categories_cache_dir, 0777);
    }
    $categories_cache_filename = $categories_cache_dir . 'tree_' . $current_category_id . '.html';
    $include_categories_cache_filename = false;
    if (file_exists($categories_cache_filename)) {
        if (date('Y-m-d H:i:s', filemtime($categories_cache_filename)) > $type_info['products_last_modified']) {
            $include_categories_cache_filename = true;
        }
    }
    $box_info_query = tep_db_query("select blocks_name from " . TABLE_BLOCKS . " where blocks_filename = '" . tep_db_input(basename(__FILE__)) . "' and language_id = '" . (int) $languages_id . "'");
    $box_info = tep_db_fetch_array($box_info_query);
    $boxHeading = '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'tPath=' . $check_products_types_id) . '">' . $box_info['blocks_name'] . '</a>';
    $boxID = $type_info['products_types_path'];
    if ($include_categories_cache_filename == false) {
        $boxContent = tep_show_category(0, 0, '', $check_products_types_id);
        $boxContent = str_replace('?' . tep_session_name() . '=' . tep_session_id(), '', $boxContent);
        $fp = fopen($categories_cache_filename, 'w');
        fwrite($fp, $boxContent);
        fclose($fp);
    } else {
        $boxContent = '';
        $fp = fopen($categories_cache_filename, 'r');
        while (!feof($fp)) {
            $boxContent .= fgets($fp, 400);
        }
        fclose($fp);
    }
    if (tep_not_null($boxContent)) {
        include DIR_WS_TEMPLATES_BOXES . 'box.php';
    }
}
Ejemplo n.º 11
0
 $order = new order();
 $params['ACTION'] = 'S';
 $params['CURRENCY'] = $order->info['currency'];
 $params['EMAIL'] = $order->customer['email_address'];
 $params['AMT'] = $paypal_uk_express->format_raw($order->info['total']);
 $params['RETURNURL'] = tep_href_link('ext/modules/payment/paypal/express_uk.php', 'osC_Action=retrieve', 'SSL', true, false);
 $params['CANCELURL'] = tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL', true, false);
 if ($order->content_type == 'virtual') {
     $params['NOSHIPPING'] = '1';
 }
 $post_string = '';
 foreach ($params as $key => $value) {
     $post_string .= $key . '[' . strlen(trim($value)) . ']=' . trim($value) . '&';
 }
 $post_string = substr($post_string, 0, -1);
 $response = $paypal_uk_express->sendTransactionToGateway($api_url, $post_string, array('X-VPS-REQUEST-ID: ' . md5($cartID . tep_session_id() . rand())));
 $response_array = array();
 parse_str($response, $response_array);
 if ($response_array['RESULT'] == '0') {
     tep_redirect($paypal_url . '&token=' . $response_array['TOKEN']);
 } else {
     switch ($response_array['RESULT']) {
         case '1':
         case '26':
             $error_message = MODULE_PAYMENT_PAYPAL_UK_EXPRESS_ERROR_CFG_ERROR;
             break;
         case '1000':
             $error_message = MODULE_PAYMENT_PAYPAL_UK_EXPRESS_ERROR_EXPRESS_DISABLED;
             break;
         default:
             $error_message = MODULE_PAYMENT_PAYPAL_UK_EXPRESS_ERROR_GENERAL;
Ejemplo n.º 12
0
function tep_hide_session_id()
{
    global $session_started, $SID;
    if ($session_started == true && tep_not_null($SID)) {
        return tep_draw_hidden_field(tep_session_name(), tep_session_id());
    }
}
Ejemplo n.º 13
0
 function before_process()
 {
     global $HTTP_POST_VARS, $order, $sendto;
     if (isset($HTTP_POST_VARS['cc_owner_firstname']) && !empty($HTTP_POST_VARS['cc_owner_firstname']) && isset($HTTP_POST_VARS['cc_owner_lastname']) && !empty($HTTP_POST_VARS['cc_owner_lastname']) && isset($HTTP_POST_VARS['cc_type']) && isset($this->cc_types[$HTTP_POST_VARS['cc_type']]) && isset($HTTP_POST_VARS['cc_number_nh-dns']) && !empty($HTTP_POST_VARS['cc_number_nh-dns'])) {
         if (MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTION_SERVER == 'Live') {
             $api_url = 'https://payflowpro.verisign.com/transaction';
         } else {
             $api_url = 'https://pilot-payflowpro.verisign.com/transaction';
         }
         $name = explode(' ', $HTTP_POST_VARS['cc_owner'], 2);
         $params = array('USER' => tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_USERNAME) ? MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_USERNAME : MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_VENDOR, 'VENDOR' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_VENDOR, 'PARTNER' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PARTNER, 'PWD' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PASSWORD, 'TENDER' => 'C', 'TRXTYPE' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTION_METHOD == 'Sale' ? 'S' : 'A', 'AMT' => $this->format_raw($order->info['total']), 'CURRENCY' => $order->info['currency'], 'FIRSTNAME' => $HTTP_POST_VARS['cc_owner_firstname'], 'LASTNAME' => $HTTP_POST_VARS['cc_owner_lastname'], 'STREET' => $order->billing['street_address'], 'CITY' => $order->billing['city'], 'STATE' => tep_get_zone_code($order->billing['country']['id'], $order->billing['zone_id'], $order->billing['state']), 'COUNTRY' => $order->billing['country']['iso_code_2'], 'ZIP' => $order->billing['postcode'], 'CLIENTIP' => tep_get_ip_address(), 'EMAIL' => $order->customer['email_address'], 'ACCT' => $HTTP_POST_VARS['cc_number_nh-dns'], 'ACCTTYPE' => $HTTP_POST_VARS['cc_type'], 'CARDSTART' => $HTTP_POST_VARS['cc_starts_month'] . $HTTP_POST_VARS['cc_starts_year'], 'EXPDATE' => $HTTP_POST_VARS['cc_expires_month'] . $HTTP_POST_VARS['cc_expires_year'], 'CVV2' => $HTTP_POST_VARS['cc_cvc_nh-dns'], 'BUTTONSOURCE' => 'osCommerce22_Default_PRO2DP');
         if ($HTTP_POST_VARS['cc_type'] == '9' || $HTTP_POST_VARS['cc_type'] == 'S') {
             $params['CARDISSUE'] = $HTTP_POST_VARS['cc_issue_nh-dns'];
         }
         if (is_numeric($sendto) && $sendto > 0) {
             $params['SHIPTOFIRSTNAME'] = $order->delivery['firstname'];
             $params['SHIPTOLASTNAME'] = $order->delivery['lastname'];
             $params['SHIPTOSTREET'] = $order->delivery['street_address'];
             $params['SHIPTOCITY'] = $order->delivery['city'];
             $params['SHIPTOSTATE'] = tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], $order->delivery['state']);
             $params['SHIPTOCOUNTRY'] = $order->delivery['country']['iso_code_2'];
             $params['SHIPTOZIP'] = $order->delivery['postcode'];
         }
         $post_string = '';
         foreach ($params as $key => $value) {
             $post_string .= $key . '[' . strlen(urlencode(utf8_encode(trim($value)))) . ']=' . urlencode(utf8_encode(trim($value))) . '&';
         }
         $post_string = substr($post_string, 0, -1);
         $response = $this->sendTransactionToGateway($api_url, $post_string, array('X-VPS-REQUEST-ID: ' . md5($cartID . tep_session_id() . rand())));
         $response_array = array();
         parse_str($response, $response_array);
         if ($response_array['RESULT'] != '0') {
             switch ($response_array['RESULT']) {
                 case '1':
                 case '26':
                     $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_CFG_ERROR;
                     break;
                 case '7':
                     $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_ADDRESS;
                     break;
                 case '12':
                     $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_DECLINED;
                     break;
                 case '23':
                 case '24':
                     $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_INVALID_CREDIT_CARD;
                     break;
                 default:
                     $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_GENERAL;
                     break;
             }
             tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, 'error_message=' . urlencode($error_message), 'SSL'));
         }
     } else {
         tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, 'error_message=' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_ALL_FIELDS_REQUIRED, 'SSL'));
     }
 }
Ejemplo n.º 14
0
 function process_button()
 {
     global $customer_id, $order, $currency, $cartID;
     $process_button_string = '';
     $params = array('VPSProtocol' => '2.23', 'ReferrerID' => 'C74D7B82-E9EB-4FBD-93DB-76F0F551C802', 'Vendor' => substr(MODULE_PAYMENT_SAGE_PAY_FORM_VENDOR_LOGIN_NAME, 0, 15));
     if (MODULE_PAYMENT_SAGE_PAY_FORM_TRANSACTION_METHOD == 'Payment') {
         $params['TxType'] = 'PAYMENT';
     } elseif (MODULE_PAYMENT_SAGE_PAY_FORM_TRANSACTION_METHOD == 'Deferred') {
         $params['TxType'] = 'DEFERRED';
     } else {
         $params['TxType'] = 'AUTHENTICATE';
     }
     $crypt = array('VendorTxCode' => substr(date('YmdHis') . '-' . $customer_id . '-' . $cartID, 0, 40), 'Amount' => $this->format_raw($order->info['total']), 'Currency' => $currency, 'Description' => substr(STORE_NAME, 0, 100), 'SuccessURL' => tep_href_link(FILENAME_CHECKOUT_PROCESS, tep_session_name() . '=' . tep_session_id(), 'SSL', false), 'FailureURL' => tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&' . tep_session_name() . '=' . tep_session_id(), 'SSL', false), 'CustomerName' => substr($order->billing['firstname'] . ' ' . $order->billing['lastname'], 0, 100), 'CustomerEMail' => substr($order->customer['email_address'], 0, 255), 'BillingSurname' => substr($order->billing['lastname'], 0, 20), 'BillingFirstnames' => substr($order->billing['firstname'], 0, 20), 'BillingAddress1' => substr($order->billing['street_address'], 0, 100), 'BillingCity' => substr($order->billing['city'], 0, 40), 'BillingPostCode' => substr($order->billing['postcode'], 0, 10), 'BillingCountry' => $order->billing['country']['iso_code_2']);
     if ($crypt['BillingCountry'] == 'US') {
         $crypt['BillingState'] = tep_get_zone_code($order->billing['country']['id'], $order->billing['zone_id'], '');
     }
     $crypt['BillingPhone'] = substr($order->customer['telephone'], 0, 20);
     $crypt['DeliverySurname'] = substr($order->delivery['lastname'], 0, 20);
     $crypt['DeliveryFirstnames'] = substr($order->delivery['firstname'], 0, 20);
     $crypt['DeliveryAddress1'] = substr($order->delivery['street_address'], 0, 100);
     $crypt['DeliveryCity'] = substr($order->delivery['city'], 0, 40);
     $crypt['DeliveryPostCode'] = substr($order->delivery['postcode'], 0, 10);
     $crypt['DeliveryCountry'] = $order->delivery['country']['iso_code_2'];
     if ($crypt['DeliveryCountry'] == 'US') {
         $crypt['DeliveryState'] = tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], '');
     }
     if (tep_not_null(MODULE_PAYMENT_SAGE_PAY_FORM_VENDOR_EMAIL)) {
         $crypt['VendorEMail'] = substr(MODULE_PAYMENT_SAGE_PAY_FORM_VENDOR_EMAIL, 0, 255);
     }
     switch (MODULE_PAYMENT_SAGE_PAY_FORM_SEND_EMAIL) {
         case 'No One':
             $crypt['SendEMail'] = 0;
             break;
         case 'Customer and Vendor':
             $crypt['SendEMail'] = 1;
             break;
         case 'Vendor Only':
             $crypt['SendEMail'] = 2;
             break;
     }
     if (tep_not_null(MODULE_PAYMENT_SAGE_PAY_FORM_CUSTOMER_EMAIL_MESSAGE)) {
         $crypt['eMailMessage'] = substr(MODULE_PAYMENT_SAGE_PAY_FORM_CUSTOMER_EMAIL_MESSAGE, 0, 7500);
     }
     $contents = array();
     foreach ($order->products as $product) {
         $product_name = $product['name'];
         if (isset($product['attributes'])) {
             foreach ($product['attributes'] as $att) {
                 $product_name .= '; ' . $att['option'] . '=' . $att['value'];
             }
         }
         $contents[] = str_replace(array(':', "\n", "\r", '&'), '', $product_name) . ':' . $product['qty'] . ':' . $this->format_raw($product['final_price']) . ':' . $this->format_raw($product['tax'] / 100 * $product['final_price']) . ':' . $this->format_raw($product['tax'] / 100 * $product['final_price'] + $product['final_price']) . ':' . $this->format_raw(($product['tax'] / 100 * $product['final_price'] + $product['final_price']) * $product['qty']);
     }
     foreach ($this->getOrderTotalsSummary() as $ot) {
         $contents[] = str_replace(array(':', "\n", "\r", '&'), '', strip_tags($ot['title'])) . ':---:---:---:---:' . $this->format_raw($ot['value']);
     }
     $crypt['Basket'] = substr(sizeof($contents) . ':' . implode(':', $contents), 0, 7500);
     $crypt['Apply3DSecure'] = '0';
     $crypt_string = '';
     foreach ($crypt as $key => $value) {
         $crypt_string .= $key . '=' . trim($value) . '&';
     }
     $crypt_string = substr($crypt_string, 0, -1);
     $params['Crypt'] = base64_encode($this->simpleXor($crypt_string, MODULE_PAYMENT_SAGE_PAY_FORM_ENCRYPTION_PASSWORD));
     foreach ($params as $key => $value) {
         $process_button_string .= tep_draw_hidden_field($key, $value);
     }
     return $process_button_string;
 }
Ejemplo n.º 15
0
 function process_button($transactionID = 0, $key = "")
 {
     global $order;
     $my_currency = MODULE_PAYMENT_IRIDIUM_CURRENCY;
     $amount = number_format($order->info['total'], 2, '.', '') * 100;
     $ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
     $process_button_string = tep_draw_hidden_field('MerchantID', MODULE_PAYMENT_IRIDIUM_MERCHANTID) . tep_draw_hidden_field('Password', MODULE_PAYMENT_IRIDIUM_PASSWORD) . tep_draw_hidden_field('PaymentProcessorDomain', MODULE_PAYMENT_IRIDIUM_GATEWAY) . tep_draw_hidden_field('PaymentProcessorPort', MODULE_PAYMENT_IRIDIUM_GATEWAY_PORT) . tep_draw_hidden_field('Amount', $amount) . tep_draw_hidden_field('CardName', $_POST['CardName']) . tep_draw_hidden_field('CardNumber', $_POST['CardNumber']) . tep_draw_hidden_field('IssueNumber', $_POST['IssueNumber']) . tep_draw_hidden_field('CV2', $_POST['CV2']) . tep_draw_hidden_field('CurrencyISOCode', $this->get_CurrentCurrency()) . tep_draw_hidden_field('transactionID', $transactionID) . tep_draw_hidden_field('sess_id', tep_session_id()) . tep_draw_hidden_field('ExpiryDateMonth', $_POST['ExpiryDateMonth']) . tep_draw_hidden_field('ExpiryDateYear', $_POST['ExpiryDateYear']) . tep_draw_hidden_field('StartDateMonth', $_POST['StartDateMonth']) . tep_draw_hidden_field('StartDateYear', $_POST['StartDateYear']) . tep_draw_hidden_field('OrderID', $transactionID) . tep_draw_hidden_field('Address1', $_POST['Addr1']) . tep_draw_hidden_field('City', $_POST['City']) . tep_draw_hidden_field('State', $_POST['State']) . tep_draw_hidden_field('PostCode', $_POST['PostCode']) . tep_draw_hidden_field('CountryISOCode', $_POST['Country']) . tep_draw_hidden_field('EmailID', $order->billing['email'] ? $order->billing['email'] : ADMIN_EMAIL) . tep_draw_hidden_field('Phone', $_POST['Telephone']) . tep_draw_hidden_field('IPAddress', $ip) . tep_draw_hidden_field('transactionID', $transactionID) . tep_draw_hidden_field('key', $key) . tep_draw_hidden_field('sess_id', tep_session_id()) . tep_draw_hidden_field('return_url', tep_href_link("userinfo.php", '', 'SSL'));
     //tep_draw_hidden_field('cancel_url', tep_href_link("checkout_payment.php", '', 'SSL'));
     //tep_draw_hidden_field('CountryISOCode', $order->billing['country']);
     $process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id());
     return $process_button_string;
 }
Ejemplo n.º 16
0
        $products_url = str_replace('http://', '', $product_info['products_url']);
        $slash_pos = (int) strpos($products_url, '/');
        if ($slash_pos == 0) {
            $slash_pos = 20;
        }
        if (strlen($products_url) > $slash_pos + 20) {
            $products_url_short = substr($products_url, 0, $slash_pos + 1) . '...' . substr($products_url, -20);
        } else {
            $products_url_short = $products_url;
        }
        $lc_text .= '<div class="row_product_author">' . TEXT_URL . ' <a href="' . tep_href_link(FILENAME_REDIRECT, 'goto=' . urlencode($products_url)) . '" target="_blank">' . $products_url_short . '</a></div>' . "\n";
    }
    $lc_text .= '<div class="clear">' . "\n";
    $lc_text .= '<div class="row_product_price">' . $currencies->format($product_info['products_price'], false, $product_info['products_currency']) . ' <span>(' . $currencies->display_price($product_info['products_price'] / $currencies->currencies[$product_info['products_currency']]['value'], 0) . ')</span></div>' . "\n";
    $form_link_1 = str_replace('[form_action]', 'add_product&to=foreign', $form_link);
    $form_link_2 = str_replace('[form_action]', 'buy_now&type=1&product_id=' . $product_info['products_id'] . '&' . tep_session_name() . '=' . tep_session_id(), $form_link);
    $form_string = tep_draw_form('p_form_' . $product_info['products_id'] . '_foreign', $form_link_1, 'post', ($popup == 'on' && (ALLOW_GUEST_TO_ADD_CART == 'true' || tep_session_is_registered('customer_id')) ? 'onsubmit="if (getXMLDOM(\'' . $form_link_2 . '&to=foreign\', \'shopping_cart\')) { document.getElementById(\'p_l_' . $product_info['products_id'] . '\').innerHTML = new_text_foreign; return false; }"' : '') . ' class="productListing-form"') . tep_draw_hidden_field('products_id', $product_info['products_id']);
    $lc_text .= '<div class="row_product_buy" id="p_l_' . $product_info['products_id'] . '"">';
    if (in_array($product_info['products_id'], $products_in_foreign_cart)) {
        $lc_text .= tep_image_button('button_in_order2.gif', IMAGE_BUTTON_IN_ORDER2);
    } else {
        $lc_text .= $form_string . tep_image_submit('button_in_order.gif', IMAGE_BUTTON_IN_ORDER) . '<br /></form>' . "\n";
    }
    $lc_text .= '</div>' . "\n";
    $lc_text .= '</div>' . "\n";
    if (tep_not_null($product_info['products_description'])) {
        $lc_text .= '<div class="row_product_description">' . nl2br($product_info['products_description']) . '</div>';
    }
    $lc_text .= '<script language="javascript" type="text/javascript"><!--' . "\n" . ' var new_text_foreign = \'' . tep_image_button('button_in_order2.gif', IMAGE_BUTTON_IN_ORDER2) . '\';' . "\n" . '//--></script>';
    echo '<div class="product_description">' . $lc_text . '</div>';
} else {
Ejemplo n.º 17
0
 function process_button()
 {
     global $customer_id, $order, $sendto, $currency;
     $process_button_string = $this->_InsertFP(MODULE_PAYMENT_AUTHORIZENET_CC_SIM_LOGIN_ID, MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_KEY, $this->format_raw($order->info['total']), rand(1, 1000), $currency);
     $process_button_string .= tep_draw_hidden_field('x_login', substr(MODULE_PAYMENT_AUTHORIZENET_CC_SIM_LOGIN_ID, 0, 20)) . tep_draw_hidden_field('x_version', '3.1') . tep_draw_hidden_field('x_show_form', 'PAYMENT_FORM') . tep_draw_hidden_field('x_relay_response', 'TRUE') . tep_draw_hidden_field('x_relay_url', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false)) . tep_draw_hidden_field('x_first_name', substr($order->billing['firstname'], 0, 50)) . tep_draw_hidden_field('x_last_name', substr($order->billing['lastname'], 0, 50)) . tep_draw_hidden_field('x_company', substr($order->billing['company'], 0, 50)) . tep_draw_hidden_field('x_address', substr($order->billing['street_address'], 0, 60)) . tep_draw_hidden_field('x_city', substr($order->billing['city'], 0, 40)) . tep_draw_hidden_field('x_state', substr($order->billing['state'], 0, 40)) . tep_draw_hidden_field('x_zip', substr($order->billing['postcode'], 0, 20)) . tep_draw_hidden_field('x_country', substr($order->billing['country']['title'], 0, 60)) . tep_draw_hidden_field('x_phone', substr($order->customer['telephone'], 0, 25)) . tep_draw_hidden_field('x_cust_id', substr($customer_id, 0, 20)) . tep_draw_hidden_field('x_customer_ip', tep_get_ip_address()) . tep_draw_hidden_field('x_email', substr($order->customer['email_address'], 0, 255)) . tep_draw_hidden_field('x_description', substr(STORE_NAME, 0, 255)) . tep_draw_hidden_field('x_amount', substr($this->format_raw($order->info['total']), 0, 15)) . tep_draw_hidden_field('x_currency_code', substr($currency, 0, 3)) . tep_draw_hidden_field('x_method', 'CC') . tep_draw_hidden_field('x_type', MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_METHOD == 'Capture' ? 'AUTH_CAPTURE' : 'AUTH_ONLY');
     if (is_numeric($sendto) && $sendto > 0) {
         $process_button_string .= tep_draw_hidden_field('x_ship_to_first_name', substr($order->delivery['firstname'], 0, 50)) . tep_draw_hidden_field('x_ship_to_last_name', substr($order->delivery['lastname'], 0, 50)) . tep_draw_hidden_field('x_ship_to_company', substr($order->delivery['company'], 0, 50)) . tep_draw_hidden_field('x_ship_to_address', substr($order->delivery['street_address'], 0, 60)) . tep_draw_hidden_field('x_ship_to_city', substr($order->delivery['city'], 0, 40)) . tep_draw_hidden_field('x_ship_to_state', substr($order->delivery['state'], 0, 40)) . tep_draw_hidden_field('x_ship_to_zip', substr($order->delivery['postcode'], 0, 20)) . tep_draw_hidden_field('x_ship_to_country', substr($order->delivery['country']['title'], 0, 60));
     }
     if (MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_MODE == 'Test') {
         $process_button_string .= tep_draw_hidden_field('x_test_request', 'TRUE');
     }
     for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
         $process_button_string .= tep_draw_hidden_field('x_line_item', $i + 1 . '<|>' . substr($order->products[$i]['name'], 0, 31) . '<|>' . substr($order->products[$i]['name'], 0, 255) . '<|>' . $order->products[$i]['qty'] . '<|>' . $this->format_raw($order->products[$i]['final_price']) . '<|>' . ($order->products[$i]['tax'] > 0 ? 'YES' : 'NO'));
     }
     $tax_value = 0;
     reset($order->info['tax_groups']);
     while (list($key, $value) = each($order->info['tax_groups'])) {
         if ($value > 0) {
             $tax_value += $this->format_raw($value);
         }
     }
     if ($tax_value > 0) {
         $process_button_string .= tep_draw_hidden_field('x_tax', $this->format_raw($tax_value));
     }
     $process_button_string .= tep_draw_hidden_field('x_freight', $this->format_raw($order->info['shipping_cost'])) . tep_draw_hidden_field(tep_session_name(), tep_session_id());
     return $process_button_string;
 }
Ejemplo n.º 18
0
 function process_button()
 {
     global $HTTP_SERVER_VARS, $order, $customer_id;
     $sequence = rand(1, 1000);
     $process_button_string = tep_draw_hidden_field('x_Login', MODULE_PAYMENT_AUTHORIZENET_LOGIN) . tep_draw_hidden_field('x_Card_Num', $this->cc_card_number) . tep_draw_hidden_field('x_Exp_Date', $this->cc_expiry_month . substr($this->cc_expiry_year, -2)) . tep_draw_hidden_field('x_Amount', number_format($order->info['total'], 2)) . tep_draw_hidden_field('x_Relay_URL', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false)) . tep_draw_hidden_field('x_Method', MODULE_PAYMENT_AUTHORIZENET_METHOD == 'Credit Card' ? 'CC' : 'ECHECK') . tep_draw_hidden_field('x_Version', '3.0') . tep_draw_hidden_field('x_Cust_ID', $customer_id) . tep_draw_hidden_field('x_Email_Customer', MODULE_PAYMENT_AUTHORIZENET_EMAIL_CUSTOMER == 'True' ? 'TRUE' : 'FALSE') . tep_draw_hidden_field('x_first_name', $order->billing['firstname']) . tep_draw_hidden_field('x_last_name', $order->billing['lastname']) . tep_draw_hidden_field('x_address', $order->billing['street_address']) . tep_draw_hidden_field('x_city', $order->billing['city']) . tep_draw_hidden_field('x_state', $order->billing['state']) . tep_draw_hidden_field('x_zip', $order->billing['postcode']) . tep_draw_hidden_field('x_country', $order->billing['country']['title']) . tep_draw_hidden_field('x_phone', $order->customer['telephone']) . tep_draw_hidden_field('x_email', $order->customer['email_address']) . tep_draw_hidden_field('x_ship_to_first_name', $order->delivery['firstname']) . tep_draw_hidden_field('x_ship_to_last_name', $order->delivery['lastname']) . tep_draw_hidden_field('x_ship_to_address', $order->delivery['street_address']) . tep_draw_hidden_field('x_ship_to_city', $order->delivery['city']) . tep_draw_hidden_field('x_ship_to_state', $order->delivery['state']) . tep_draw_hidden_field('x_ship_to_zip', $order->delivery['postcode']) . tep_draw_hidden_field('x_ship_to_country', $order->delivery['country']['title']) . tep_draw_hidden_field('x_Customer_IP', $HTTP_SERVER_VARS['REMOTE_ADDR']) . $this->InsertFP(MODULE_PAYMENT_AUTHORIZENET_LOGIN, MODULE_PAYMENT_AUTHORIZENET_TXNKEY, number_format($order->info['total'], 2), $sequence);
     if (MODULE_PAYMENT_AUTHORIZENET_TESTMODE == 'Test') {
         $process_button_string .= tep_draw_hidden_field('x_Test_Request', 'TRUE');
     }
     $process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id());
     return $process_button_string;
 }
Ejemplo n.º 19
0
function tep_hide_session_id()
{
    $string = '';
    if (defined('SID') && tep_not_null(SID)) {
        $string = tep_draw_hidden_field(tep_session_name(), tep_session_id());
    }
    return $string;
}
Ejemplo n.º 20
0
 function before_process()
 {
     global $order, $sendto, $ppeuk_token, $ppeuk_payerid, $HTTP_POST_VARS, $comments;
     if (empty($comments)) {
         if (isset($HTTP_POST_VARS['ppecomments']) && tep_not_null($HTTP_POST_VARS['ppecomments'])) {
             $comments = tep_db_prepare_input($HTTP_POST_VARS['ppecomments']);
             $order->info['comments'] = $comments;
         }
     }
     if (MODULE_PAYMENT_PAYPAL_UK_EXPRESS_TRANSACTION_SERVER == 'Live') {
         $api_url = 'https://payflowpro.verisign.com/transaction';
     } else {
         $api_url = 'https://pilot-payflowpro.verisign.com/transaction';
     }
     $params = array('USER' => tep_not_null(MODULE_PAYMENT_PAYPAL_UK_EXPRESS_USERNAME) ? MODULE_PAYMENT_PAYPAL_UK_EXPRESS_USERNAME : MODULE_PAYMENT_PAYPAL_UK_EXPRESS_VENDOR, 'VENDOR' => MODULE_PAYMENT_PAYPAL_UK_EXPRESS_VENDOR, 'PARTNER' => MODULE_PAYMENT_PAYPAL_UK_EXPRESS_PARTNER, 'PWD' => MODULE_PAYMENT_PAYPAL_UK_EXPRESS_PASSWORD, 'TENDER' => 'P', 'TRXTYPE' => MODULE_PAYMENT_PAYPAL_UK_EXPRESS_TRANSACTION_METHOD == 'Sale' ? 'S' : 'A', 'EMAIL' => $order->customer['email_address'], 'TOKEN' => $ppeuk_token, 'ACTION' => 'D', 'PAYERID' => $ppeuk_payerid, 'AMT' => $this->format_raw($order->info['total']), 'CURRENCY' => $order->info['currency'], 'BUTTONSOURCE' => 'osCommerce22_Default_PRO2EC');
     if (is_numeric($sendto) && $sendto > 0) {
         $params['SHIPTOSTREET'] = $order->delivery['street_address'];
         $params['SHIPTOCITY'] = $order->delivery['city'];
         $params['SHIPTOSTATE'] = tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], $order->delivery['state']);
         $params['SHIPTOCOUNTRY'] = $order->delivery['country']['iso_code_2'];
         $params['SHIPTOZIP'] = $order->delivery['postcode'];
     }
     $post_string = '';
     foreach ($params as $key => $value) {
         $post_string .= $key . '[' . strlen(trim($value)) . ']=' . trim($value) . '&';
     }
     $post_string = substr($post_string, 0, -1);
     $response = $this->sendTransactionToGateway($api_url, $post_string, array('X-VPS-REQUEST-ID: ' . md5($cartID . tep_session_id() . rand())));
     $response_array = array();
     parse_str($response, $response_array);
     if ($response_array['RESULT'] != '0') {
         switch ($response_array['RESULT']) {
             case '1':
             case '26':
                 $error_message = MODULE_PAYMENT_PAYPAL_UK_EXPRESS_ERROR_CFG_ERROR;
                 break;
             case '7':
                 $error_message = MODULE_PAYMENT_PAYPAL_UK_EXPRESS_ERROR_ADDRESS;
                 break;
             case '12':
                 $error_message = MODULE_PAYMENT_PAYPAL_UK_EXPRESS_ERROR_DECLINED;
                 break;
             case '1000':
                 $error_message = MODULE_PAYMENT_PAYPAL_UK_EXPRESS_ERROR_EXPRESS_DISABLED;
                 break;
             default:
                 $error_message = MODULE_PAYMENT_PAYPAL_UK_EXPRESS_ERROR_GENERAL;
                 break;
         }
         tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, 'error_message=' . urlencode($error_message), 'SSL'));
     }
 }
Ejemplo n.º 21
0
     mkdir($categories_cache_dir, 0777);
 }
 $categories_cache_dir .= $products_types['products_types_id'] . '/';
 if (!is_dir($categories_cache_dir)) {
     mkdir($categories_cache_dir, 0777);
 }
 $categories_cache_filename = $categories_cache_dir . 'tree_0.html';
 $include_categories_cache_filename = false;
 if (file_exists($categories_cache_filename)) {
     if (date('Y-m-d H:i:s', filemtime($categories_cache_filename)) > $products_types['products_last_modified']) {
         $include_categories_cache_filename = true;
     }
 }
 if ($include_categories_cache_filename == false) {
     $categories_string = tep_show_category(0, 1, '', $products_types['products_types_id'], true);
     $categories_string = str_replace('?' . tep_session_name() . '=' . tep_session_id(), '', $categories_string);
     $fp = fopen($categories_cache_filename, 'w');
     fwrite($fp, $categories_string);
     fclose($fp);
 } else {
     $categories_string = '';
     $fp = fopen($categories_cache_filename, 'r');
     while (!feof($fp)) {
         $categories_string .= fgets($fp, 400);
     }
     fclose($fp);
 }
 if ($products_types['products_types_default_status'] == '0') {
     echo '		<div class="li"><div class="level_1"><a href="' . tep_href_link(FILENAME_CATEGORIES, 'tPath=' . $products_types['products_types_id'] . '&view=all') . '" class="active">' . TEXT_ALL_CATEGORY_PRODUCTS . '</a></div></div>' . "\n";
 } elseif ($products_types['products_types_default_status'] == '1') {
     $specials_types_query = tep_db_query("select specials_types_id, specials_types_path, specials_types_name from " . TABLE_SPECIALS_TYPES . " where specials_types_id in ('" . implode("', '", $active_specials_types_array) . "') and language_id = '" . (int) DEFAULT_LANGUAGE_ID . "' order by sort_order, specials_types_name limit 4");
 function process_button()
 {
     global $order, $cart, $customer_id, $currencies, $cart_Sofortueberweisung_Direct_ID;
     $order_id = substr($cart_Sofortueberweisung_Direct_ID, strpos($cart_Sofortueberweisung_Direct_ID, '-') + 1);
     $parameter = array();
     $parameter['kdnr'] = MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_KDNR;
     // Repräsentiert Ihre Kundennummer bei der Sofortüberweisung
     $parameter['projekt'] = MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_PROJEKT;
     // Die verantwortliche Projektnummer bei der Sofortüberweisung, zu der die Zahlung gehört
     $parameter['betrag'] = number_format($order->info['total'] * $currencies->get_value('EUR'), 2, '.', '');
     // Beziffert den Zahlungsbetrag, der an Sie übermittelt werden soll
     $vzweck1 = str_replace('{{orderid}}', $order_id, MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_TEXT_V_ZWECK_1);
     $vzweck2 = str_replace('{{orderid}}', $order_id, MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_TEXT_V_ZWECK_2);
     $vzweck1 = str_replace('{{order_date}}', strftime(DATE_FORMAT_SHORT), $vzweck1);
     $vzweck2 = str_replace('{{order_date}}', strftime(DATE_FORMAT_SHORT), $vzweck2);
     $vzweck1 = str_replace('{{customer_id}}', $customer_id, $vzweck1);
     $vzweck2 = str_replace('{{customer_id}}', $customer_id, $vzweck2);
     $vzweck1 = str_replace('{{customer_name}}', $order->customer['firstname'] . ' ' . $order->customer['lastname'], $vzweck1);
     $vzweck2 = str_replace('{{customer_name}}', $order->customer['firstname'] . ' ' . $order->customer['lastname'], $vzweck2);
     $vzweck1 = str_replace('{{customer_company}}', $order->customer['company'], $vzweck1);
     $vzweck2 = str_replace('{{customer_company}}', $order->customer['company'], $vzweck2);
     $vzweck1 = str_replace('{{customer_email}}', $order->customer['email_address'], $vzweck1);
     $vzweck2 = str_replace('{{customer_email}}', $order->customer['email_address'], $vzweck2);
     // Kürzen auf 27 Zeichen
     $vzweck1 = substr($vzweck1, 0, 27);
     $vzweck2 = substr($vzweck2, 0, 27);
     $parameter['v_zweck_1'] = tep_output_string($vzweck1);
     // Definieren Sie hier Ihre Verwendungszwecke
     $parameter['v_zweck_2'] = tep_output_string($vzweck2);
     // Definieren Sie hier Ihre Verwendungszwecke
     $parameter['kunden_var_0'] = tep_output_string($order_id);
     // Eindeutige Identifikation der Zahlung, z.B. Session ID oder Auftragsnummer.
     $parameter['kunden_var_1'] = tep_output_string($customer_id);
     $parameter['kunden_var_2'] = tep_output_string(tep_session_id());
     $parameter['kunden_var_3'] = tep_output_string($cart->cartID);
     $parameter['kunden_var_4'] = '';
     $parameter['kunden_var_5'] = '';
     // $parameter['Partner'] = '';
     if (strlen(MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_INPUT_PASSWORT) > 0) {
         $tmparray = array($parameter['betrag'], $parameter['v_zweck_1'], $parameter['v_zweck_2'], '', '', '', $parameter['kunden_var_0'], $parameter['kunden_var_1'], $parameter['kunden_var_2'], $parameter['kunden_var_3'], $parameter['kunden_var_4'], $parameter['kunden_var_5'], MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_INPUT_PASSWORT);
         $parameter['key'] = md5(implode("|", $tmparray));
     }
     $process_button_string = '';
     reset($parameter);
     while (list($key, $value) = each($parameter)) {
         $process_button_string .= tep_draw_hidden_field($key, $value) . "\n";
     }
     return $process_button_string;
 }
tep_session_name('osCsid');
tep_session_save_path(SESSION_WRITE_DIRECTORY);
// set the session cookie parameters
if (function_exists('session_set_cookie_params')) {
    session_set_cookie_params(0, $cookie_path, $cookie_domain);
} elseif (function_exists('ini_set')) {
    ini_set('session.cookie_lifetime', '0');
    ini_set('session.cookie_path', $cookie_path);
    ini_set('session.cookie_domain', $cookie_domain);
}
@ini_set('session.use_only_cookies', SESSION_FORCE_COOKIE_USE == 'True' ? 1 : 0);
// set the session ID if it exists
if (isset($HTTP_POST_VARS[tep_session_name()])) {
    tep_session_id($HTTP_POST_VARS[tep_session_name()]);
} elseif ($request_type == 'SSL' && isset($HTTP_GET_VARS[tep_session_name()])) {
    tep_session_id($HTTP_GET_VARS[tep_session_name()]);
}
// start the session
$session_started = false;
if (SESSION_FORCE_COOKIE_USE == 'True') {
    tep_setcookie('cookie_test', 'please_accept_for_session', time() + 60 * 60 * 24 * 30, $cookie_path, $cookie_domain);
    if (isset($HTTP_COOKIE_VARS['cookie_test'])) {
        tep_session_start();
        $session_started = true;
    }
} elseif (SESSION_BLOCK_SPIDERS == 'True') {
    $user_agent = strtolower(getenv('HTTP_USER_AGENT'));
    $spider_flag = false;
    if (tep_not_null($user_agent)) {
        $spiders = file(DIR_WS_INCLUDES . 'spiders.txt');
        for ($i = 0, $n = sizeof($spiders); $i < $n; $i++) {
Ejemplo n.º 24
0
    function process_button($transactionID = 0, $key = "")  {
      // Change made by using PlugnPay API Connection
      $card_cvv=$_POST['cvv'];
	  
	  $process_button_string = tep_draw_hidden_field('credit_card_type', $_POST['credit_card_type']) . 
      						   tep_draw_hidden_field('card_owner', $_POST['plugnpay_cc_owner']) .  
      						   tep_draw_hidden_field('card_cvv', $_POST['cvv']) .  
      						   tep_draw_hidden_field('transactionID', $transactionID) .  
      						   tep_draw_hidden_field('key', $key) .   
      						   tep_draw_hidden_field('sess_id', tep_session_id()) . 
                               tep_draw_hidden_field('card_number', $this->cc_card_number) .
                               tep_draw_hidden_field('card_exp', $this->cc_expiry_month . substr($this->cc_expiry_year, -2));

      $process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id());
      return $process_button_string;
    }
 function process_button()
 {
     global $customer_id, $order, $sendto, $currency;
     $tstamp = time();
     $sequence = rand(1, 1000);
     $params = array('x_login' => substr(MODULE_PAYMENT_AUTHORIZENET_CC_SIM_LOGIN_ID, 0, 20), 'x_version' => $this->api_version, 'x_show_form' => 'PAYMENT_FORM', 'x_delim_data' => 'FALSE', 'x_relay_response' => 'TRUE', 'x_relay_url' => tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false), 'x_first_name' => substr($order->billing['firstname'], 0, 50), 'x_last_name' => substr($order->billing['lastname'], 0, 50), 'x_company' => substr($order->billing['company'], 0, 50), 'x_address' => substr($order->billing['street_address'], 0, 60), 'x_city' => substr($order->billing['city'], 0, 40), 'x_state' => substr($order->billing['state'], 0, 40), 'x_zip' => substr($order->billing['postcode'], 0, 20), 'x_country' => substr($order->billing['country']['title'], 0, 60), 'x_phone' => substr(preg_replace('/[^0-9]/', '', $order->customer['telephone']), 0, 25), 'x_cust_id' => substr($customer_id, 0, 20), 'x_customer_ip' => tep_get_ip_address(), 'x_email' => substr($order->customer['email_address'], 0, 255), 'x_description' => substr(STORE_NAME, 0, 255), 'x_amount' => $this->format_raw($order->info['total']), 'x_currency_code' => substr($currency, 0, 3), 'x_method' => 'CC', 'x_type' => MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_METHOD == 'Capture' ? 'AUTH_CAPTURE' : 'AUTH_ONLY', 'x_freight' => $this->format_raw($order->info['shipping_cost']), 'x_fp_sequence' => $sequence, 'x_fp_timestamp' => $tstamp, 'x_fp_hash' => $this->_hmac(MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_KEY, MODULE_PAYMENT_AUTHORIZENET_CC_SIM_LOGIN_ID . '^' . $sequence . '^' . $tstamp . '^' . $this->format_raw($order->info['total']) . '^' . $currency), 'x_cancel_url' => tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL'), 'x_cancel_url_text' => MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TEXT_RETURN_BUTTON);
     if (is_numeric($sendto) && $sendto > 0) {
         $params['x_ship_to_first_name'] = substr($order->delivery['firstname'], 0, 50);
         $params['x_ship_to_last_name'] = substr($order->delivery['lastname'], 0, 50);
         $params['x_ship_to_company'] = substr($order->delivery['company'], 0, 50);
         $params['x_ship_to_address'] = substr($order->delivery['street_address'], 0, 60);
         $params['x_ship_to_city'] = substr($order->delivery['city'], 0, 40);
         $params['x_ship_to_state'] = substr($order->delivery['state'], 0, 40);
         $params['x_ship_to_zip'] = substr($order->delivery['postcode'], 0, 20);
         $params['x_ship_to_country'] = substr($order->delivery['country']['title'], 0, 60);
     }
     if (MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_MODE == 'Test') {
         $params['x_test_request'] = 'TRUE';
     }
     $tax_value = 0;
     foreach ($order->info['tax_groups'] as $value) {
         if ($value > 0) {
             $tax_value += $this->format_raw($value);
         }
     }
     if ($tax_value > 0) {
         $params['x_tax'] = $this->format_raw($tax_value);
     }
     $process_button_string = '';
     foreach ($params as $key => $value) {
         $process_button_string .= tep_draw_hidden_field($key, $value);
     }
     for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
         $process_button_string .= tep_draw_hidden_field('x_line_item', $i + 1 . '<|>' . substr($order->products[$i]['name'], 0, 31) . '<|><|>' . $order->products[$i]['qty'] . '<|>' . $this->format_raw($order->products[$i]['final_price']) . '<|>' . ($order->products[$i]['tax'] > 0 ? 'YES' : 'NO'));
     }
     $process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id());
     return $process_button_string;
 }
Ejemplo n.º 26
0
// include shopping cart class
require DIR_WS_CLASSES . 'shopping_cart.php';
// define how the session functions will be used
require DIR_WS_FUNCTIONS . 'sessions.php';
// set the session name and save path
tep_session_name('osCAdminID');
tep_session_save_path(SESSION_WRITE_DIRECTORY);
// set the session cookie parameters
if (function_exists('session_set_cookie_params')) {
    session_set_cookie_params(0, DIR_WS_ADMIN);
} elseif (function_exists('ini_set')) {
    ini_set('session.cookie_lifetime', '0');
    ini_set('session.cookie_path', DIR_WS_ADMIN);
}
if (isset($_POST) && array_key_exists(tep_session_name(), $_POST)) {
    tep_session_id($_POST[tep_session_name()]);
}
// lets start our session
tep_session_start();
if (!tep_session_is_registered('login_id')) {
    if (empty($_POST) && empty($_GET)) {
        tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
    } else {
        echo '
<script>
document.location=\'' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '\';
</script>';
        die;
    }
}
chdir('includes/javascript/ckeditor/filemanager/');
Ejemplo n.º 27
0
 function process_button()
 {
     global $order, $currencies, $currency;
     switch (MODULE_PAYMENT_SECPAY_CURRENCY) {
         case 'Default Currency':
             $sec_currency = DEFAULT_CURRENCY;
             break;
         case 'Any Currency':
         default:
             $sec_currency = $currency;
             break;
     }
     switch (MODULE_PAYMENT_SECPAY_TEST_STATUS) {
         case 'Always Fail':
             $test_status = 'false';
             break;
         case 'Production':
             $test_status = 'live';
             break;
         case 'Always Successful':
         default:
             $test_status = 'true';
             break;
     }
     $process_button_string = tep_draw_hidden_field('merchant', MODULE_PAYMENT_SECPAY_MERCHANT_ID) . tep_draw_hidden_field('trans_id', STORE_NAME . date('Ymdhis')) . tep_draw_hidden_field('amount', number_format($order->info['total'] * $currencies->get_value($sec_currency), $currencies->currencies[$sec_currency]['decimal_places'], '.', '')) . tep_draw_hidden_field('bill_name', $order->billing['firstname'] . ' ' . $order->billing['lastname']) . tep_draw_hidden_field('bill_addr_1', $order->billing['street_address']) . tep_draw_hidden_field('bill_addr_2', $order->billing['suburb']) . tep_draw_hidden_field('bill_city', $order->billing['city']) . tep_draw_hidden_field('bill_state', $order->billing['state']) . tep_draw_hidden_field('bill_post_code', $order->billing['postcode']) . tep_draw_hidden_field('bill_country', $order->billing['country']['title']) . tep_draw_hidden_field('bill_tel', $order->customer['telephone']) . tep_draw_hidden_field('bill_email', $order->customer['email_address']) . tep_draw_hidden_field('ship_name', $order->delivery['firstname'] . ' ' . $order->delivery['lastname']) . tep_draw_hidden_field('ship_addr_1', $order->delivery['street_address']) . tep_draw_hidden_field('ship_addr_2', $order->delivery['suburb']) . tep_draw_hidden_field('ship_city', $order->delivery['city']) . tep_draw_hidden_field('ship_state', $order->delivery['state']) . tep_draw_hidden_field('ship_post_code', $order->delivery['postcode']) . tep_draw_hidden_field('ship_country', $order->delivery['country']['title']) . tep_draw_hidden_field('currency', $sec_currency) . tep_draw_hidden_field('callback', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false) . ';' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code, 'SSL', false)) . tep_draw_hidden_field(tep_session_name(), tep_session_id()) . tep_draw_hidden_field('options', 'test_status=' . $test_status . ',dups=false,cb_post=true,cb_flds=' . tep_session_name());
     return $process_button_string;
 }
 function sendTransactionToGateway($url, $parameters)
 {
     global $cartID, $order;
     $server = parse_url($url);
     if (!isset($server['port'])) {
         $server['port'] = $server['scheme'] == 'https' ? 443 : 80;
     }
     if (!isset($server['path'])) {
         $server['path'] = '/';
     }
     $request_id = isset($order) && is_object($order) ? md5($cartID . tep_session_id() . $this->format_raw($order->info['total'])) : 'oscom_conn_test';
     $headers = array('X-VPS-REQUEST-ID: ' . $request_id, 'X-VPS-CLIENT-TIMEOUT: 45', 'X-VPS-VIT-INTEGRATION-PRODUCT: OSCOM', 'X-VPS-VIT-INTEGRATION-VERSION: 2.3');
     $curl = curl_init($server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : ''));
     curl_setopt($curl, CURLOPT_PORT, $server['port']);
     curl_setopt($curl, CURLOPT_HEADER, false);
     curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($curl, CURLOPT_FORBID_REUSE, true);
     curl_setopt($curl, CURLOPT_FRESH_CONNECT, true);
     curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
     curl_setopt($curl, CURLOPT_POST, true);
     curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters);
     if (MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_VERIFY_SSL == 'True') {
         curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
         curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
         if (file_exists(DIR_FS_CATALOG . 'ext/modules/payment/paypal/paypal.com.crt')) {
             curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'ext/modules/payment/paypal/paypal.com.crt');
         } elseif (file_exists(DIR_FS_CATALOG . 'includes/cacert.pem')) {
             curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'includes/cacert.pem');
         }
     } else {
         curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
     }
     if (tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PROXY)) {
         curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, true);
         curl_setopt($curl, CURLOPT_PROXY, MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PROXY);
     }
     $result = curl_exec($curl);
     curl_close($curl);
     return $result;
 }
Ejemplo n.º 29
0
 public function before_confirm()
 {
     global $temp_orders_id, $customer_id, $currency;
     if (!isset($_GET['SHASIGN'])) {
         //only process if we don't come back from ogone
         $temp_data = Checkout::get_all_data_from_temp_db($temp_orders_id);
         foreach ($temp_data[$temp_orders_id]['orders_total'] as $key => $data) {
             if ($data['class'] == 'order_total') {
                 $order_total = $data['value'];
             }
         }
         $ogone_amount = number_format($order_total * 100, 0, '', '');
         if (!empty($customer_id)) {
             $com_data = STORE_NAME . ' ' . Translate('bestelling. Klant #:') . ' ' . $customer_id;
         } else {
             $com_data = STORE_NAME . ' ' . Translate('bestelling. Onbekende Klant');
         }
         $data = array('ACCEPTURL' => tep_href_link(FILENAME_CHECKOUT, '', 'SSL'), 'AMOUNT' => $ogone_amount, 'BGCOLOR' => 'white', 'BUTTONBGCOLOR' => 'white', 'BUTTONTXTCOLOR' => 'black', 'CANCELURL' => tep_href_link(FILENAME_CHECKOUT), 'CATALOGURL' => tep_href_link(FILENAME_DEFAULT), 'CN' => trim($temp_data[$temp_orders_id]['orders']['customers_name']), 'COM' => $com_data, 'CURRENCY' => $currency, 'DECLINEURL' => tep_href_link(FILENAME_CHECKOUT), 'EMAIL' => $temp_data[$temp_orders_id]['orders']['customers_email_address'], 'EXCEPTIONURL' => tep_href_link(FILENAME_CHECKOUT), 'FONTTYPE' => 'Verdana', 'LANGUAGE' => 'en_US', 'ORDERID' => $temp_orders_id . '||' . date("Y-m-d H:i:s"), 'OWNERADDRESS' => $temp_data[$temp_orders_id]['orders']['delivery_street_address'], 'OWNERZIP' => $temp_data[$temp_orders_id]['orders']['delivery_postcode'], 'PARAMPLUS' => 'osCsid=' . tep_session_id() . '&customer_id=' . $customer_id, 'PMLISTTYPE' => '2', 'PSPID' => $this->instances[$temp_data[$temp_orders_id]['orders']['payment_method']]['pspid'], 'TBLBGCOLOR' => 'white', 'TBLTXTCOLOR' => 'black', 'TITLE' => STORE_NAME, 'TP' => tep_href_link('includes/modules/checkout/modules/Ogone/ogone_template.php'), 'LOGO' => tep_href_link('images/mail/logo.jpg'), 'TXTCOLOR' => 'black');
         $sha_data = '';
         ksort($data);
         foreach ($data as $key => $value) {
             if (!empty($value)) {
                 $process_button_string .= tep_draw_hidden_field($key, $value);
                 $sha_data .= strtoupper($key) . '=' . $value . $this->instances[$temp_data[$temp_orders_id]['orders']['payment_method']]['sha_string'];
             }
         }
         $process_button_string .= tep_draw_hidden_field('SHASIGN', strtoupper(sha1($sha_data)));
         $html = '</div><div class="span12">';
         $html .= '<div class="step active"><div class="step_title">' . Translate('Betaling via beveiligde Ogone server') . '</div></div>';
         $html .= '<form name="redirectForm" action="https://secure.ogone.com/ncol/' . $this->instances[$temp_data[$temp_orders_id]['orders']['payment_method']]['mode'] . '/orderstandard.asp" method="POST">';
         $html .= $process_button_string;
         $html .= '</form>';
         $html .= '<div style="text-align:center;"><img src="' . DIR_WS_IMAGES . 'ajax-loader.gif"><br>' . Translate('Bestelgegevens worden doorgestuurd naar de beveiligde betaal server, even geduld...') . '</div>';
         $html .= '</div><div>';
         $html .= '<script>document.forms["redirectForm"].submit();</script>';
         echo $html;
         die;
     }
 }
Ejemplo n.º 30
0
 function process_button()
 {
     global $order, $currency, $languages_id, $language, $customer_id, $cart_RBS_Worldpay_Hosted_ID;
     $order_id = substr($cart_RBS_Worldpay_Hosted_ID, strpos($cart_RBS_Worldpay_Hosted_ID, '-') + 1);
     $lang_query = tep_db_query("select code from " . TABLE_LANGUAGES . " where languages_id = '" . (int) $languages_id . "'");
     $lang = tep_db_fetch_array($lang_query);
     $process_button_string = tep_draw_hidden_field('instId', MODULE_PAYMENT_RBSWORLDPAY_HOSTED_INSTALLATION_ID) . tep_draw_hidden_field('cartId', $order_id) . tep_draw_hidden_field('amount', $this->format_raw($order->info['total'])) . tep_draw_hidden_field('currency', $currency) . tep_draw_hidden_field('address', $order->billing['street_address']) . tep_draw_hidden_field('country', $order->billing['country']['iso_code_2']) . tep_draw_hidden_field('desc', STORE_NAME) . tep_draw_hidden_field('name', $order->billing['firstname'] . ' ' . $order->billing['lastname']) . tep_draw_hidden_field('postcode', $order->billing['postcode']) . tep_draw_hidden_field('tel', $order->customer['telephone']) . tep_draw_hidden_field('email', $order->customer['email_address']) . tep_draw_hidden_field('fixContact', 'Y') . tep_draw_hidden_field('hideCurrency', 'true') . tep_draw_hidden_field('lang', strtoupper($lang['code'])) . tep_draw_hidden_field('signatureFields', 'amount:currency:cartId') . tep_draw_hidden_field('signature', md5(MODULE_PAYMENT_RBSWORLDPAY_HOSTED_MD5_PASSWORD . ':' . $this->format_raw($order->info['total']) . ':' . $currency . ':' . $order_id)) . tep_draw_hidden_field('MC_callback', substr(tep_href_link('ext/modules/payment/rbsworldpay/hosted_callback.php', '', 'NONSSL', false, false), strpos(tep_href_link('ext/modules/payment/rbsworldpay/hosted_callback.php', '', 'NONSSL', false, false), '://') + 3));
     if (MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TRANSACTION_METHOD == 'Pre-Authorization') {
         $process_button_string .= tep_draw_hidden_field('authMode', 'E');
     }
     if (MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TESTMODE == 'True') {
         $process_button_string .= tep_draw_hidden_field('testMode', '100');
     }
     $process_button_string .= tep_draw_hidden_field('M_sid', tep_session_id()) . tep_draw_hidden_field('M_cid', $customer_id) . tep_draw_hidden_field('M_lang', $language) . tep_draw_hidden_field('M_hash', md5(tep_session_id() . $customer_id . $order_id . $language . number_format($order->info['total'], 2) . MODULE_PAYMENT_RBSWORLDPAY_HOSTED_MD5_PASSWORD));
     return $process_button_string;
 }