function OSCOM_PayPal_HS_Cfg_prepare_order_status_id() { global $OSCOM_PayPal; $this->title = $OSCOM_PayPal->getDef('cfg_hs_prepare_order_status_id_title'); $this->description = $OSCOM_PayPal->getDef('cfg_hs_prepare_order_status_id_desc'); if (!defined('OSCOM_APP_PAYPAL_HS_PREPARE_ORDER_STATUS_ID')) { $check_query = tep_db_query("select orders_status_id from orders_status where orders_status_name = 'Preparing [PayPal Pro HS]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from orders_status"); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into orders_status (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Preparing [PayPal Pro HS]')"); } $flags_query = tep_db_query("describe orders_status public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update orders_status set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } } else { $status_id = OSCOM_APP_PAYPAL_HS_PREPARE_ORDER_STATUS_ID; } $this->default = $status_id; }
function languageTextFields() { $return = ' <table>'; $languages = tep_get_languages(); foreach ($languages as $amLanguage) { $return .= ' <tr> <td align="right">' . tep_image(DIR_WS_CATALOG_LANGUAGES . $amLanguage['directory'] . '/images/' . $amLanguage['image'], $amLanguage['name']) . '</td> <td>' . tep_draw_input_field('text_field_' . $amLanguage['id'], '', 'id="' . $amLanguage['id'] . '"') . '</td> </tr>'; } $return .= ' </table>'; return $return; }
function walk($item1) { global $filelayout, $filelayout_count, $modelsize; global $active, $inactive, $langcode, $default_these, $deleteit, $zero_qty_inactive; global $epdlanguage_id, $price_with_tax, $replace_quotes; global $default_images, $default_image_manufacturer, $default_image_product, $default_image_category; global $separator, $max_categories; // first we clean up the row of data // chop blanks from each end $item1 = ltrim(rtrim($item1)); // blow it into an array, splitting on the tabs $items = explode($separator, $item1); // make sure all non-set things are set to ''; // and strip the quotes from the start and end of the stings. // escape any special chars for the database. foreach ($filelayout as $key => $value) { $i = $filelayout[$key]; if (isset($items[$i]) == false) { $items[$i] = ''; } else { // Check to see if either of the magic_quotes are turned on or off; // And apply filtering accordingly. if (function_exists('ini_get')) { //echo "Getting ready to check magic quotes<br>"; if (ini_get('magic_quotes_runtime') == 1) { // The magic_quotes_runtime are on, so lets account for them // check if the last character is a quote; // if it is, chop off the quotes. if (substr($items[$i], -1) == '"') { $items[$i] = substr($items[$i], 2, strlen($items[$i]) - 4); } // now any remaining doubled double quotes should be converted to one doublequote $items[$i] = str_replace('\\"\\"', """, $items[$i]); if ($replace_quotes) { $items[$i] = str_replace('\\"', """, $items[$i]); $items[$i] = str_replace("\\'", "'", $items[$i]); } } else { // no magic_quotes are on // check if the last character is a quote; // if it is, chop off the 1st and last character of the string. if (substr($items[$i], -1) == '"') { $items[$i] = substr($items[$i], 1, strlen($items[$i]) - 2); } // now any remaining doubled double quotes should be converted to one doublequote $items[$i] = str_replace('""', """, $items[$i]); if ($replace_quotes) { $items[$i] = str_replace('"', """, $items[$i]); $items[$i] = str_replace("'", "'", $items[$i]); } } } } } /* if ( $items['v_status'] == $deleteit ){ // they want to delete this product. echo "Deleting product " . $items['v_products_model'] . " from the database<br>"; // Get the ID // kill in the products_to_categories // Kill in the products table return; // we're done deleteing! } */ // now do a query to get the record's current contents $sql = "SELECT\n\t\tp.products_id as v_products_id,\n\t\tp.products_model as v_products_model,\n\t\tp.products_image as v_products_image,\n\t\tp.products_price as v_products_price,\n\t\tp.products_weight as v_products_weight,\n\t\tp.products_date_added as v_date_avail,\n\t\tp.products_tax_class_id as v_tax_class_id,\n\t\tp.products_quantity as v_products_quantity,\n\t\tp.manufacturers_id as v_manufacturers_id,\n\t\tsubc.categories_id as v_categories_id\n\t\tFROM\n\t\t" . TABLE_PRODUCTS . " as p,\n\t\t" . TABLE_CATEGORIES . " as subc,\n\t\t" . TABLE_PRODUCTS_TO_CATEGORIES . " as ptoc\n\t\tWHERE\n\t\tp.products_id = ptoc.products_id AND\n\t\tp.products_model = '" . $items[$filelayout['v_products_model']] . "' AND\n\t\tptoc.categories_id = subc.categories_id\n\t\t"; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); while ($row) { // OK, since we got a row, the item already exists. // Let's get all the data we need and fill in all the fields that need to be defaulted to the current values // for each language, get the description and set the vals foreach ($langcode as $key => $lang) { //echo "Inside defaulting loop"; //echo "key is $key<br>"; //echo "langid is " . $lang['id'] . "<br>"; // $sql2 = "SELECT products_name, products_description // FROM ".TABLE_PRODUCTS_DESCRIPTION." // WHERE // products_id = " . $row['v_products_id'] . " AND // language_id = '" . $lang['id'] . "' // "; $sql2 = "SELECT *\n\t\t\t\tFROM " . TABLE_PRODUCTS_DESCRIPTION . "\n\t\t\t\tWHERE\n\t\t\t\t\tproducts_id = " . $row['v_products_id'] . " AND\n\t\t\t\t\tlanguage_id = '" . $lang['id'] . "'\n\t\t\t\t"; $result2 = tep_db_query($sql2); $row2 = tep_db_fetch_array($result2); // Need to report from ......_name_1 not ..._name_0 $row['v_products_name_' . $lang['id']] = $row2['products_name']; $row['v_products_description_' . $lang['id']] = $row2['products_description']; $row['v_products_url_' . $lang['id']] = $row2['products_url']; // support for Linda's Header Controller 2.0 here if (isset($filelayout['v_products_head_title_tag_' . $lang['id']])) { $row['v_products_head_title_tag_' . $lang['id']] = $row2['products_head_title_tag']; $row['v_products_head_desc_tag_' . $lang['id']] = $row2['products_head_desc_tag']; $row['v_products_head_keywords_tag_' . $lang['id']] = $row2['products_head_keywords_tag']; } // end support for Header Controller 2.0 } // start with v_categories_id // Get the category description // set the appropriate variable name // if parent_id is not null, then follow it up. $thecategory_id = $row['v_categories_id']; for ($categorylevel = 1; $categorylevel < $max_categories + 1; $categorylevel++) { if ($thecategory_id) { $sql2 = "SELECT categories_name\n\t\t\t\t\tFROM " . TABLE_CATEGORIES_DESCRIPTION . "\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tcategories_id = " . $thecategory_id . " AND\n\t\t\t\t\t\tlanguage_id = " . $epdlanguage_id; $result2 = tep_db_query($sql2); $row2 = tep_db_fetch_array($result2); // only set it if we found something $temprow['v_categories_name_' . $categorylevel] = $row2['categories_name']; // now get the parent ID if there was one $sql3 = "SELECT parent_id\n\t\t\t\t\tFROM " . TABLE_CATEGORIES . "\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tcategories_id = " . $thecategory_id; $result3 = tep_db_query($sql3); $row3 = tep_db_fetch_array($result3); $theparent_id = $row3['parent_id']; if ($theparent_id != '') { // there was a parent ID, lets set thecategoryid to get the next level $thecategory_id = $theparent_id; } else { // we have found the top level category for this item, $thecategory_id = false; } } else { $temprow['v_categories_name_' . $categorylevel] = ''; } } // temprow has the old style low to high level categories. $newlevel = 1; // let's turn them into high to low level categories for ($categorylevel = $max_categories + 1; $categorylevel > 0; $categorylevel--) { if ($temprow['v_categories_name_' . $categorylevel] != '') { $row['v_categories_name_' . $newlevel++] = $temprow['v_categories_name_' . $categorylevel]; } } if ($row['v_manufacturers_id'] != '') { $sql2 = "SELECT manufacturers_name\n\t\t\t\tFROM " . TABLE_MANUFACTURERS . "\n\t\t\t\tWHERE\n\t\t\t\tmanufacturers_id = " . $row['v_manufacturers_id']; $result2 = tep_db_query($sql2); $row2 = tep_db_fetch_array($result2); $row['v_manufacturers_name'] = $row2['manufacturers_name']; } //elari - //We check the value of tax class and title instead of the id //Then we add the tax to price if $price_with_tax is set to true $row_tax_multiplier = tep_get_tax_class_rate($row['v_tax_class_id']); $row['v_tax_class_title'] = tep_get_tax_class_title($row['v_tax_class_id']); if ($price_with_tax) { $row['v_products_price'] = round($row['v_products_price'] + $row['v_products_price'] * $row_tax_multiplier / 100, 2); } // now create the internal variables that will be used // the $$thisvar is on purpose: it creates a variable named what ever was in $thisvar and sets the value foreach ($default_these as $thisvar) { ${$thisvar} = $row[$thisvar]; } $row = tep_db_fetch_array($result); } // this is an important loop. What it does is go thru all the fields in the incoming file and set the internal vars. // Internal vars not set here are either set in the loop above for existing records, or not set at all (null values) // the array values are handled separatly, although they will set variables in this loop, we won't use them. foreach ($filelayout as $key => $value) { ${$key} = $items[$value]; } // so how to handle these? we shouldn't built the array unless it's been giving to us. // The assumption is that if you give us names and descriptions, then you give us name and description for all applicable languages foreach ($langcode as $lang) { //echo "Langid is " . $lang['id'] . "<br>"; $l_id = $lang['id']; if (isset($filelayout['v_products_name_' . $l_id])) { //we set dynamically the language values $v_products_name[$l_id] = $items[$filelayout['v_products_name_' . $l_id]]; $v_products_description[$l_id] = $items[$filelayout['v_products_description_' . $l_id]]; $v_products_url[$l_id] = $items[$filelayout['v_products_url_' . $l_id]]; // support for Linda's Header Controller 2.0 here if (isset($filelayout['v_products_head_title_tag_' . $l_id])) { $v_products_head_title_tag[$l_id] = $items[$filelayout['v_products_head_title_tag_' . $l_id]]; $v_products_head_desc_tag[$l_id] = $items[$filelayout['v_products_head_desc_tag_' . $l_id]]; $v_products_head_keywords_tag[$l_id] = $items[$filelayout['v_products_head_keywords_tag_' . $l_id]]; } // end support for Header Controller 2.0 } } //elari... we get the tax_clas_id from the tax_title //on screen will still be displayed the tax_class_title instead of the id.... if (isset($v_tax_class_title)) { $v_tax_class_id = tep_get_tax_title_class_id($v_tax_class_title); } //we check the tax rate of this tax_class_id $row_tax_multiplier = tep_get_tax_class_rate($v_tax_class_id); //And we recalculate price without the included tax... //Since it seems display is made before, the displayed price will still include tax //This is same problem for the tax_clas_id that display tax_class_title if ($price_with_tax) { $v_products_price = round($v_products_price / (1 + $row_tax_multiplier * $price_with_tax / 100), 4); } // if they give us one category, they give us all 6 categories unset($v_categories_name); // default to not set. if (isset($filelayout['v_categories_name_1'])) { $newlevel = 1; for ($categorylevel = 6; $categorylevel > 0; $categorylevel--) { if ($items[$filelayout['v_categories_name_' . $categorylevel]] != '') { $v_categories_name[$newlevel++] = $items[$filelayout['v_categories_name_' . $categorylevel]]; } } while ($newlevel < $max_categories + 1) { $v_categories_name[$newlevel++] = ''; // default the remaining items to nothing } } if (ltrim(rtrim($v_products_quantity)) == '') { $v_products_quantity = 1; } if ($v_date_avail == '') { // $v_date_avail = "CURRENT_TIMESTAMP"; $v_date_avail = "NULL"; } else { // we put the quotes around it here because we can't put them into the query, because sometimes // we will use the "current_timestamp", which can't have quotes around it. $v_date_avail = '"' . $v_date_avail . '"'; } if ($v_date_added == '') { $v_date_added = "CURRENT_TIMESTAMP"; } else { // we put the quotes around it here because we can't put them into the query, because sometimes // we will use the "current_timestamp", which can't have quotes around it. $v_date_added = '"' . $v_date_added . '"'; } // default the stock if they spec'd it or if it's blank $v_db_status = '1'; // default to active if ($v_status == $inactive) { // they told us to deactivate this item $v_db_status = '0'; } if ($zero_qty_inactive && $v_products_quantity == 0) { // if they said that zero qty products should be deactivated, let's deactivate if the qty is zero $v_db_status = '0'; } if ($v_manufacturer_id == '') { $v_manufacturer_id = "NULL"; } if (trim($v_products_image) == '') { $v_products_image = $default_image_product; } if (strlen($v_products_model) > $modelsize) { echo "<font color='red'>" . strlen($v_products_model) . $v_products_model . "... ERROR! - Too many characters in the model number.<br>\n\t\t\t12 is the maximum on a standard OSC install.<br>\n\t\t\tYour maximum product_model length is set to {$modelsize}<br>\n\t\t\tYou can either shorten your model numbers or increase the size of the field in the database.</font>"; die; } // OK, we need to convert the manufacturer's name into id's for the database if (isset($v_manufacturers_name) && $v_manufacturers_name != '') { $sql = "SELECT man.manufacturers_id\n\t\t\tFROM " . TABLE_MANUFACTURERS . " as man\n\t\t\tWHERE\n\t\t\t\tman.manufacturers_name = '" . $v_manufacturers_name . "'"; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); if ($row != '') { foreach ($row as $item) { $v_manufacturer_id = $item; } } else { // to add, we need to put stuff in categories and categories_description $sql = "SELECT MAX( manufacturers_id) max FROM " . TABLE_MANUFACTURERS; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); $max_mfg_id = $row['max'] + 1; // default the id if there are no manufacturers yet if (!is_numeric($max_mfg_id)) { $max_mfg_id = 1; } // Uncomment this query if you have an older 2.2 codebase /* $sql = "INSERT INTO ".TABLE_MANUFACTURERS."( manufacturers_id, manufacturers_name, manufacturers_image ) VALUES ( $max_mfg_id, '$v_manufacturers_name', '$default_image_manufacturer' )"; */ // Comment this query out if you have an older 2.2 codebase $sql = "INSERT INTO " . TABLE_MANUFACTURERS . "(\n\t\t\t\tmanufacturers_id,\n\t\t\t\tmanufacturers_name,\n\t\t\t\tmanufacturers_image,\n\t\t\t\tdate_added,\n\t\t\t\tlast_modified\n\t\t\t\t) VALUES (\n\t\t\t\t{$max_mfg_id},\n\t\t\t\t'{$v_manufacturers_name}',\n\t\t\t\t'{$default_image_manufacturer}',\n\t\t\t\tCURRENT_TIMESTAMP,\n\t\t\t\tCURRENT_TIMESTAMP\n\t\t\t\t)"; $result = tep_db_query($sql); $v_manufacturer_id = $max_mfg_id; } } // if the categories names are set then try to update them if (isset($v_categories_name_1)) { // start from the highest possible category and work our way down from the parent $v_categories_id = 0; $theparent_id = 0; for ($categorylevel = $max_categories + 1; $categorylevel > 0; $categorylevel--) { $thiscategoryname = $v_categories_name[$categorylevel]; if ($thiscategoryname != '') { // we found a category name in this field // now the subcategory $sql = "SELECT cat.categories_id\n\t\t\t\t\tFROM " . TABLE_CATEGORIES . " as cat, \n\t\t\t\t\t " . TABLE_CATEGORIES_DESCRIPTION . " as des\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tcat.categories_id = des.categories_id AND\n\t\t\t\t\t\tdes.language_id = {$epdlanguage_id} AND\n\t\t\t\t\t\tcat.parent_id = " . $theparent_id . " AND\n\t\t\t\t\t\tdes.categories_name = '" . $thiscategoryname . "'"; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); if ($row != '') { foreach ($row as $item) { $thiscategoryid = $item; } } else { // to add, we need to put stuff in categories and categories_description $sql = "SELECT MAX( categories_id) max FROM " . TABLE_CATEGORIES; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); $max_category_id = $row['max'] + 1; if (!is_numeric($max_category_id)) { $max_category_id = 1; } $sql = "INSERT INTO " . TABLE_CATEGORIES . "(\n\t\t\t\t\t\tcategories_id,\n\t\t\t\t\t\tcategories_image,\n\t\t\t\t\t\tparent_id,\n\t\t\t\t\t\tsort_order,\n\t\t\t\t\t\tdate_added,\n\t\t\t\t\t\tlast_modified\n\t\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t{$max_category_id},\n\t\t\t\t\t\t'{$default_image_category}',\n\t\t\t\t\t\t{$theparent_id},\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tCURRENT_TIMESTAMP\n\t\t\t\t\t\t,CURRENT_TIMESTAMP\n\t\t\t\t\t\t)"; $result = tep_db_query($sql); $sql = "INSERT INTO " . TABLE_CATEGORIES_DESCRIPTION . "(\n\t\t\t\t\t\t\tcategories_id,\n\t\t\t\t\t\t\tlanguage_id,\n\t\t\t\t\t\t\tcategories_name\n\t\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t\t{$max_category_id},\n\t\t\t\t\t\t\t'{$epdlanguage_id}',\n\t\t\t\t\t\t\t'{$thiscategoryname}'\n\t\t\t\t\t\t)"; $result = tep_db_query($sql); $thiscategoryid = $max_category_id; } // the current catid is the next level's parent $theparent_id = $thiscategoryid; $v_categories_id = $thiscategoryid; // keep setting this, we need the lowest level category ID later } } } if ($v_products_model != "") { // products_model exists! array_walk($items, 'print_el'); // First we check to see if this is a product in the current db. $result = tep_db_query("SELECT products_id FROM " . TABLE_PRODUCTS . " WHERE (products_model = '" . $v_products_model . "')"); if (tep_db_num_rows($result) == 0) { // insert into products $sql = "SHOW TABLE STATUS LIKE '" . TABLE_PRODUCTS . "'"; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); $max_product_id = $row['Auto_increment']; if (!is_numeric($max_product_id)) { $max_product_id = 1; } $v_products_id = $max_product_id; echo "<font color='green'> !New Product!</font><br>"; $query = "INSERT INTO " . TABLE_PRODUCTS . " (\n\t\t\t\t\tproducts_image,\n\t\t\t\t\tproducts_model,\n\t\t\t\t\tproducts_price,\n\t\t\t\t\tproducts_status,\n\t\t\t\t\tproducts_last_modified,\n\t\t\t\t\tproducts_date_added,\n\t\t\t\t\tproducts_date_available,\n\t\t\t\t\tproducts_tax_class_id,\n\t\t\t\t\tproducts_weight,\n\t\t\t\t\tproducts_quantity,\n\t\t\t\t\tmanufacturers_id)\n\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\t\t'{$v_products_image}',"; // unmcomment these lines if you are running the image mods /* $query .= . $v_products_mimage . '", "' . $v_products_bimage . '", "' . $v_products_subimage1 . '", "' . $v_products_bsubimage1 . '", "' . $v_products_subimage2 . '", "' . $v_products_bsubimage2 . '", "' . $v_products_subimage3 . '", "' . $v_products_bsubimage3 . '", "' */ $query .= "\t\t\t\t'{$v_products_model}',\n\t\t\t\t\t\t\t\t'{$v_products_price}',\n\t\t\t\t\t\t\t\t'{$v_db_status}',\n\t\t\t\t\t\t\t\tCURRENT_TIMESTAMP,\n\t\t\t\t\t\t\t\t{$v_date_added},\n\t\t\t\t\t\t\t\t{$v_date_avail},\n\t\t\t\t\t\t\t\t'{$v_tax_class_id}',\n\t\t\t\t\t\t\t\t'{$v_products_weight}',\n\t\t\t\t\t\t\t\t'{$v_products_quantity}',\n\t\t\t\t\t\t\t\t'{$v_manufacturer_id}')\n\t\t\t\t\t\t\t"; $result = tep_db_query($query); } else { // existing product, get the id from the query // and update the product data $row = tep_db_fetch_array($result); $v_products_id = $row['products_id']; echo "<font color='black'> Updated</font><br>"; $row = tep_db_fetch_array($result); $query = 'UPDATE ' . TABLE_PRODUCTS . ' SET products_price="' . $v_products_price . '" ,products_image="' . $v_products_image; // uncomment these lines if you are running the image mods /* $query .= '" ,products_mimage="'.$v_products_mimage. '" ,products_bimage="'.$v_products_bimage. '" ,products_subimage1="'.$v_products_subimage1. '" ,products_bsubimage1="'.$v_products_bsubimage1. '" ,products_subimage2="'.$v_products_subimage2. '" ,products_bsubimage2="'.$v_products_bsubimage2. '" ,products_subimage3="'.$v_products_subimage3. '" ,products_bsubimage3="'.$v_products_bsubimage3; */ $query .= '", products_weight="' . $v_products_weight . '", products_tax_class_id="' . $v_tax_class_id . '", products_date_available= ' . $v_date_avail . ', products_date_added= ' . $v_date_added . ', products_last_modified=CURRENT_TIMESTAMP , products_quantity="' . $v_products_quantity . '" ,manufacturers_id=' . $v_manufacturer_id . ' , products_status=' . $v_db_status . ' WHERE (products_id = "' . $v_products_id . '")'; $result = tep_db_query($query); } // the following is common in both the updating an existing product and creating a new product if (isset($v_products_name)) { foreach ($v_products_name as $key => $name) { if ($name != '') { $sql = "SELECT * FROM " . TABLE_PRODUCTS_DESCRIPTION . " WHERE\n\t\t\t\t\t\t\tproducts_id = {$v_products_id} AND\n\t\t\t\t\t\t\tlanguage_id = " . $key; $result = tep_db_query($sql); if (tep_db_num_rows($result) == 0) { // nope, this is a new product description $result = tep_db_query($sql); $sql = "INSERT INTO " . TABLE_PRODUCTS_DESCRIPTION . "\n\t\t\t\t\t\t\t\t(products_id,\n\t\t\t\t\t\t\t\tlanguage_id,\n\t\t\t\t\t\t\t\tproducts_name,\n\t\t\t\t\t\t\t\tproducts_description,\n\t\t\t\t\t\t\t\tproducts_url)\n\t\t\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\t\t\t\t'" . $v_products_id . "',\n\t\t\t\t\t\t\t\t\t" . $key . ",\n\t\t\t\t\t\t\t\t\t'" . $name . "',\n\t\t\t\t\t\t\t\t\t'" . $v_products_description[$key] . "',\n\t\t\t\t\t\t\t\t\t'" . $v_products_url[$key] . "'\n\t\t\t\t\t\t\t\t\t)"; // support for Linda's Header Controller 2.0 if (isset($v_products_head_title_tag)) { // override the sql if we're using Linda's contrib $sql = "INSERT INTO " . TABLE_PRODUCTS_DESCRIPTION . "\n\t\t\t\t\t\t\t\t\t(products_id,\n\t\t\t\t\t\t\t\t\tlanguage_id,\n\t\t\t\t\t\t\t\t\tproducts_name,\n\t\t\t\t\t\t\t\t\tproducts_description,\n\t\t\t\t\t\t\t\t\tproducts_url,\n\t\t\t\t\t\t\t\t\tproducts_head_title_tag,\n\t\t\t\t\t\t\t\t\tproducts_head_desc_tag,\n\t\t\t\t\t\t\t\t\tproducts_head_keywords_tag)\n\t\t\t\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\t\t\t\t\t'" . $v_products_id . "',\n\t\t\t\t\t\t\t\t\t\t" . $key . ",\n\t\t\t\t\t\t\t\t\t\t'" . $name . "',\n\t\t\t\t\t\t\t\t\t\t'" . $v_products_description[$key] . "',\n\t\t\t\t\t\t\t\t\t\t'" . $v_products_url[$key] . "',\n\t\t\t\t\t\t\t\t\t\t'" . $v_products_head_title_tag[$key] . "',\n\t\t\t\t\t\t\t\t\t\t'" . $v_products_head_desc_tag[$key] . "',\n\t\t\t\t\t\t\t\t\t\t'" . $v_products_head_keywords_tag[$key] . "')"; } // end support for Linda's Header Controller 2.0 $result = tep_db_query($sql); } else { // already in the description, let's just update it $sql = "UPDATE " . TABLE_PRODUCTS_DESCRIPTION . " SET\n\t\t\t\t\t\t\t\tproducts_name='{$name}',\n\t\t\t\t\t\t\t\tproducts_description='" . $v_products_description[$key] . "',\n\t\t\t\t\t\t\t\tproducts_url='" . $v_products_url[$key] . "'\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\tproducts_id = '{$v_products_id}' AND\n\t\t\t\t\t\t\t\tlanguage_id = '{$key}'"; // support for Lindas Header Controller 2.0 if (isset($v_products_head_title_tag)) { // override the sql if we're using Linda's contrib $sql = "UPDATE " . TABLE_PRODUCTS_DESCRIPTION . " SET\n\t\t\t\t\t\t\t\t\tproducts_name = '{$name}',\n\t\t\t\t\t\t\t\t\tproducts_description = '" . $v_products_description[$key] . "',\n\t\t\t\t\t\t\t\t\tproducts_url = '" . $v_products_url[$key] . "',\n\t\t\t\t\t\t\t\t\tproducts_head_title_tag = '" . $v_products_head_title_tag[$key] . "',\n\t\t\t\t\t\t\t\t\tproducts_head_desc_tag = '" . $v_products_head_desc_tag[$key] . "',\n\t\t\t\t\t\t\t\t\tproducts_head_keywords_tag = '" . $v_products_head_keywords_tag[$key] . "'\n\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\tproducts_id = '{$v_products_id}' AND\n\t\t\t\t\t\t\t\t\tlanguage_id = '{$key}'"; } // end support for Linda's Header Controller 2.0 $result = tep_db_query($sql); } } } } if (isset($v_categories_id)) { //find out if this product is listed in the category given $result_incategory = tep_db_query('SELECT ' . TABLE_PRODUCTS_TO_CATEGORIES . '.products_id, ' . TABLE_PRODUCTS_TO_CATEGORIES . '.categories_id FROM ' . TABLE_PRODUCTS_TO_CATEGORIES . ' WHERE ' . TABLE_PRODUCTS_TO_CATEGORIES . '.products_id=' . $v_products_id . ' AND ' . TABLE_PRODUCTS_TO_CATEGORIES . '.categories_id=' . $v_categories_id); if (tep_db_num_rows($result_incategory) == 0) { // nope, this is a new category for this product $res1 = tep_db_query('INSERT INTO ' . TABLE_PRODUCTS_TO_CATEGORIES . ' (products_id, categories_id) VALUES ("' . $v_products_id . '", "' . $v_categories_id . '")'); } else { // already in this category, nothing to do! } } // for the separate prices per customer module $ll = 1; if (isset($v_customer_price_1)) { if ($v_customer_group_id_1 == '' and $v_customer_price_1 != '') { echo "<font color=red>ERROR - v_customer_group_id and v_customer_price must occur in pairs</font>"; die; } // they spec'd some prices, so clear all existing entries $result = tep_db_query(' DELETE FROM ' . TABLE_PRODUCTS_GROUPS . ' WHERE products_id = ' . $v_products_id); // and insert the new record if ($v_customer_price_1 != '') { $result = tep_db_query(' INSERT INTO ' . TABLE_PRODUCTS_GROUPS . ' VALUES ( ' . $v_customer_group_id_1 . ', ' . $v_customer_price_1 . ', ' . $v_products_id . ', ' . $v_products_price . ' )'); } if ($v_customer_price_2 != '') { $result = tep_db_query(' INSERT INTO ' . TABLE_PRODUCTS_GROUPS . ' VALUES ( ' . $v_customer_group_id_2 . ', ' . $v_customer_price_2 . ', ' . $v_products_id . ', ' . $v_products_price . ' )'); } if ($v_customer_price_3 != '') { $result = tep_db_query(' INSERT INTO ' . TABLE_PRODUCTS_GROUPS . ' VALUES ( ' . $v_customer_group_id_3 . ', ' . $v_customer_price_3 . ', ' . $v_products_id . ', ' . $v_products_price . ' )'); } if ($v_customer_price_4 != '') { $result = tep_db_query(' INSERT INTO ' . TABLE_PRODUCTS_GROUPS . ' VALUES ( ' . $v_customer_group_id_4 . ', ' . $v_customer_price_4 . ', ' . $v_products_id . ', ' . $v_products_price . ' )'); } } // VJ product attribs begin if (isset($v_attribute_options_id_1)) { $attribute_rows = 1; // master row count $languages = tep_get_languages(); // product options count $attribute_options_count = 1; $v_attribute_options_id_var = 'v_attribute_options_id_' . $attribute_options_count; while (isset(${$v_attribute_options_id_var}) && !empty(${$v_attribute_options_id_var})) { // remove product attribute options linked to this product before proceeding further // this is useful for removing attributes linked to a product $attributes_clean_query = "delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int) $v_products_id . "' and options_id = '" . (int) ${$v_attribute_options_id_var} . "'"; tep_db_query($attributes_clean_query); $attribute_options_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int) ${$v_attribute_options_id_var} . "'"; $attribute_options_values = tep_db_query($attribute_options_query); // option table update begin if ($attribute_rows == 1) { // insert into options table if no option exists if (tep_db_num_rows($attribute_options_values) <= 0) { for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { $lid = $languages[$i]['id']; $v_attribute_options_name_var = 'v_attribute_options_name_' . $attribute_options_count . '_' . $lid; if (isset(${$v_attribute_options_name_var})) { $attribute_options_insert_query = "insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, language_id, products_options_name) values ('" . (int) ${$v_attribute_options_id_var} . "', '" . (int) $lid . "', '" . ${$v_attribute_options_name_var} . "')"; $attribute_options_insert = tep_db_query($attribute_options_insert_query); } } } else { // update options table, if options already exists for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { $lid = $languages[$i]['id']; $v_attribute_options_name_var = 'v_attribute_options_name_' . $attribute_options_count . '_' . $lid; if (isset(${$v_attribute_options_name_var})) { $attribute_options_update_lang_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int) ${$v_attribute_options_id_var} . "' and language_id ='" . (int) $lid . "'"; $attribute_options_update_lang_values = tep_db_query($attribute_options_update_lang_query); // if option name doesn't exist for particular language, insert value if (tep_db_num_rows($attribute_options_update_lang_values) <= 0) { $attribute_options_lang_insert_query = "insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, language_id, products_options_name) values ('" . (int) ${$v_attribute_options_id_var} . "', '" . (int) $lid . "', '" . ${$v_attribute_options_name_var} . "')"; $attribute_options_lang_insert = tep_db_query($attribute_options_lang_insert_query); } else { // if option name exists for particular language, update table $attribute_options_update_query = "update " . TABLE_PRODUCTS_OPTIONS . " set products_options_name = '" . ${$v_attribute_options_name_var} . "' where products_options_id ='" . (int) ${$v_attribute_options_id_var} . "' and language_id = '" . (int) $lid . "'"; $attribute_options_update = tep_db_query($attribute_options_update_query); } } } } } // option table update end // product option values count $attribute_values_count = 1; $v_attribute_values_id_var = 'v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count; while (isset(${$v_attribute_values_id_var}) && !empty(${$v_attribute_values_id_var})) { $attribute_values_query = "select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int) ${$v_attribute_values_id_var} . "'"; $attribute_values_values = tep_db_query($attribute_values_query); // options_values table update begin if ($attribute_rows == 1) { // insert into options_values table if no option exists if (tep_db_num_rows($attribute_values_values) <= 0) { for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { $lid = $languages[$i]['id']; $v_attribute_values_name_var = 'v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $lid; if (isset(${$v_attribute_values_name_var})) { $attribute_values_insert_query = "insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) values ('" . (int) ${$v_attribute_values_id_var} . "', '" . (int) $lid . "', '" . ${$v_attribute_values_name_var} . "')"; $attribute_values_insert = tep_db_query($attribute_values_insert_query); } } // insert values to pov2po table $attribute_values_pov2po_query = "insert into " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " (products_options_id, products_options_values_id) values ('" . (int) ${$v_attribute_options_id_var} . "', '" . (int) ${$v_attribute_values_id_var} . "')"; $attribute_values_pov2po = tep_db_query($attribute_values_pov2po_query); } else { // update options table, if options already exists for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { $lid = $languages[$i]['id']; $v_attribute_values_name_var = 'v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $lid; if (isset(${$v_attribute_values_name_var})) { $attribute_values_update_lang_query = "select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int) ${$v_attribute_values_id_var} . "' and language_id ='" . (int) $lid . "'"; $attribute_values_update_lang_values = tep_db_query($attribute_values_update_lang_query); // if options_values name doesn't exist for particular language, insert value if (tep_db_num_rows($attribute_values_update_lang_values) <= 0) { $attribute_values_lang_insert_query = "insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) values ('" . (int) ${$v_attribute_values_id_var} . "', '" . (int) $lid . "', '" . ${$v_attribute_values_name_var} . "')"; $attribute_values_lang_insert = tep_db_query($attribute_values_lang_insert_query); } else { // if options_values name exists for particular language, update table $attribute_values_update_query = "update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_name = '" . ${$v_attribute_values_name_var} . "' where products_options_values_id ='" . (int) ${$v_attribute_values_id_var} . "' and language_id = '" . (int) $lid . "'"; $attribute_values_update = tep_db_query($attribute_values_update_query); } } } } } // options_values table update end // options_values price update begin $v_attribute_values_price_var = 'v_attribute_values_price_' . $attribute_options_count . '_' . $attribute_values_count; if (isset(${$v_attribute_values_price_var}) && ${$v_attribute_values_price_var} != '') { $attribute_prices_query = "select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int) $v_products_id . "' and options_id ='" . (int) ${$v_attribute_options_id_var} . "' and options_values_id = '" . (int) ${$v_attribute_values_id_var} . "'"; $attribute_prices_values = tep_db_query($attribute_prices_query); $attribute_values_price_prefix = ${$v_attribute_values_price_var} < 0 ? '-' : '+'; // options_values_prices table update begin // insert into options_values_prices table if no price exists if (tep_db_num_rows($attribute_prices_values) <= 0) { $attribute_prices_insert_query = "insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_id, options_id, options_values_id, options_values_price, price_prefix) values ('" . (int) $v_products_id . "', '" . (int) ${$v_attribute_options_id_var} . "', '" . (int) ${$v_attribute_values_id_var} . "', '" . (double) ${$v_attribute_values_price_var} . "', '" . $attribute_values_price_prefix . "')"; $attribute_prices_insert = tep_db_query($attribute_prices_insert_query); } else { // update options table, if options already exists $attribute_prices_update_query = "update " . TABLE_PRODUCTS_ATTRIBUTES . " set options_values_price = '" . ${$v_attribute_values_price_var} . "', price_prefix = '" . $attribute_values_price_prefix . "' where products_id = '" . (int) $v_products_id . "' and options_id = '" . (int) ${$v_attribute_options_id_var} . "' and options_values_id ='" . (int) ${$v_attribute_values_id_var} . "'"; $attribute_prices_update = tep_db_query($attribute_prices_update_query); } } // options_values price update end //////// attributes stock add start $v_attribute_values_stock_var = 'v_attribute_values_stock_' . $attribute_options_count . '_' . $attribute_values_count; if (isset(${$v_attribute_values_stock_var}) && ${$v_attribute_values_stock_var} != '') { $stock_attributes = ${$v_attribute_options_id_var} . '-' . ${$v_attribute_values_id_var}; $attribute_stock_query = tep_db_query("select products_stock_quantity from " . TABLE_PRODUCTS_STOCK . " where products_id = '" . (int) $v_products_id . "' and products_stock_attributes ='" . $stock_attributes . "'"); // insert into products_stock_quantity table if no stock exists if (tep_db_num_rows($attribute_stock_query) <= 0) { $attribute_stock_insert_query = tep_db_query("insert into " . TABLE_PRODUCTS_STOCK . " (products_id, products_stock_attributes, products_stock_quantity) values ('" . (int) $v_products_id . "', '" . $stock_attributes . "', '" . (int) ${$v_attribute_values_stock_var} . "')"); } else { // update options table, if options already exists $attribute_stock_insert_query = tep_db_query("update " . TABLE_PRODUCTS_STOCK . " set products_stock_quantity = '" . (int) ${$v_attribute_values_stock_var} . "' where products_id = '" . (int) $v_products_id . "' and products_stock_attributes = '" . $stock_attributes . "'"); // turn on stock tracking on products_options table $stock_tracking_query = tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_track_stock = '1' where products_options_id = '" . (int) ${$v_attribute_options_id_var} . "'"); } } //////// attributes stock add end $attribute_values_count++; $v_attribute_values_id_var = 'v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count; } $attribute_options_count++; $v_attribute_options_id_var = 'v_attribute_options_id_' . $attribute_options_count; } $attribute_rows++; } // VJ product attribs end } else { // this record was missing the product_model array_walk($items, 'print_el'); echo "<p class=smallText>No products_model field in record. This line was not imported <br>"; echo "<br>"; } // end of row insertion code }
function getParams() { if (tep_db_num_rows(tep_db_query("show tables like 'customers_braintree_tokens'")) != 1) { $sql = <<<EOD CREATE TABLE customers_braintree_tokens ( id int NOT NULL auto_increment, customers_id int NOT NULL, braintree_token varchar(255) NOT NULL, card_type varchar(32) NOT NULL, number_filtered varchar(20) NOT NULL, expiry_date char(6) NOT NULL, date_added datetime NOT NULL, PRIMARY KEY (id), KEY idx_cbraintreet_customers_id (customers_id), KEY idx_cbraintreet_token (braintree_token) ); EOD; tep_db_query($sql); } if (!defined('MODULE_PAYMENT_BRAINTREE_CC_TRANSACTION_ORDER_STATUS_ID')) { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Braintree [Transactions]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Braintree [Transactions]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } } else { $status_id = MODULE_PAYMENT_BRAINTREE_CC_TRANSACTION_ORDER_STATUS_ID; } $params = array('MODULE_PAYMENT_BRAINTREE_CC_STATUS' => array('title' => 'Enable Braintree Module', 'desc' => 'Do you want to accept Braintree payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_BRAINTREE_CC_MERCHANT_ID' => array('title' => 'Merchant ID', 'desc' => 'The Braintree account Merchant ID to use.'), 'MODULE_PAYMENT_BRAINTREE_CC_PUBLIC_KEY' => array('title' => 'Public Key', 'desc' => 'The Braintree account public key to use.'), 'MODULE_PAYMENT_BRAINTREE_CC_PRIVATE_KEY' => array('title' => 'Private Key', 'desc' => 'The Braintree account private key to use.'), 'MODULE_PAYMENT_BRAINTREE_CC_CLIENT_KEY' => array('title' => 'Client Side Encryption Key', 'desc' => 'The client side encryption key to use.', 'set_func' => 'tep_cfg_braintree_cc_set_client_key(', 'use_func' => 'tep_cfg_braintree_cc_show_client_key'), 'MODULE_PAYMENT_BRAINTREE_CC_MERCHANT_ACCOUNTS' => array('title' => 'Merchant Accounts', 'desc' => 'Merchant accounts and defined currencies.', 'set_func' => 'tep_cfg_braintree_cc_set_merchant_accounts(', 'use_func' => 'tep_cfg_braintree_cc_show_merchant_accounts'), 'MODULE_PAYMENT_BRAINTREE_CC_TOKENS' => array('title' => 'Create Tokens', 'desc' => 'Create and store tokens for card payments customers can use on their next purchase?', 'value' => 'False', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_BRAINTREE_CC_VERIFY_WITH_CVV' => array('title' => 'Verify With CVV', 'desc' => 'Verify the credit card with the billing address with the Card Verification Value (CVV)?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_BRAINTREE_CC_TRANSACTION_METHOD' => array('title' => 'Transaction Method', 'desc' => 'The processing method to use for each transaction.', 'value' => 'Authorize', 'set_func' => 'tep_cfg_select_option(array(\'Authorize\', \'Payment\'), '), 'MODULE_PAYMENT_BRAINTREE_CC_ORDER_STATUS_ID' => array('title' => 'Set Order Status', 'desc' => 'Set the status of orders made with this payment module to this value', 'value' => '0', 'use_func' => 'tep_get_order_status_name', 'set_func' => 'tep_cfg_pull_down_order_statuses('), 'MODULE_PAYMENT_BRAINTREE_CC_TRANSACTION_ORDER_STATUS_ID' => array('title' => 'Transaction Order Status', 'desc' => 'Include transaction information in this order status level', 'value' => $status_id, 'set_func' => 'tep_cfg_pull_down_order_statuses(', 'use_func' => 'tep_get_order_status_name'), 'MODULE_PAYMENT_BRAINTREE_CC_TRANSACTION_SERVER' => array('title' => 'Transaction Server', 'desc' => 'Perform transactions on the production server or on the testing server.', 'value' => 'Live', 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Sandbox\'), '), 'MODULE_PAYMENT_BRAINTREE_CC_ZONE' => array('title' => 'Payment Zone', 'desc' => 'If a zone is selected, only enable this payment method for that zone.', 'value' => '0', 'use_func' => 'tep_get_zone_class_title', 'set_func' => 'tep_cfg_pull_down_zone_classes('), 'MODULE_PAYMENT_BRAINTREE_CC_SORT_ORDER' => array('title' => 'Sort order of display.', 'desc' => 'Sort order of display. Lowest is displayed first.', 'value' => '0')); return $params; }
function set_order_status($order_status, $set_to_public) { $status_id = 0; $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = '" . $order_status . "' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name, public_flag) values ('" . $status_id . "', '" . $lang['id'] . "', " . "'" . $order_status . "', 1)"); } } else { foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', " . "'" . $order_status . "')"); } } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } return $status_id; }
function install() { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'PayPal [Transactions]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'PayPal [Transactions]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable PayPal Express Checkout', 'MODULE_PAYMENT_PAYPAL_EXPRESS_STATUS', 'False', 'Do you want to accept PayPal Express Checkout payments?', '6', '1', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('API Username', 'MODULE_PAYMENT_PAYPAL_EXPRESS_API_USERNAME', '', 'The username to use for the PayPal API service', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('API Password', 'MODULE_PAYMENT_PAYPAL_EXPRESS_API_PASSWORD', '', 'The password to use for the PayPal API service', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('API Signature', 'MODULE_PAYMENT_PAYPAL_EXPRESS_API_SIGNATURE', '', 'The signature to use for the PayPal API service', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Server', 'MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER', 'Live', 'Use the live or testing (sandbox) gateway server to process transactions?', '6', '0', 'tep_cfg_select_option(array(\\'Live\\', \\'Sandbox\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Method', 'MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_METHOD', 'Sale', 'The processing method to use for each transaction.', '6', '0', 'tep_cfg_select_option(array(\\'Authorization\\', \\'Sale\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('PayPal Account Optional', 'MODULE_PAYMENT_PAYPAL_EXPRESS_ACCOUNT_OPTIONAL', 'False', 'This must also be enabled in your PayPal account, in Profile > Website Payment Preferences.', '6', '0', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('PayPal Instant Update', 'MODULE_PAYMENT_PAYPAL_EXPRESS_INSTANT_UPDATE', 'True', 'Support PayPal shipping and tax calculations on the PayPal.com site during Express Checkout.', '6', '0', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_PAYPAL_EXPRESS_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYPAL_EXPRESS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_PAYPAL_EXPRESS_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('PayPal Transactions Order Status Level', 'MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTIONS_ORDER_STATUS_ID', '" . $status_id . "', 'Include PayPal transaction information in this order status level', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('cURL Program Location', 'MODULE_PAYMENT_PAYPAL_EXPRESS_CURL', '/usr/bin/curl', 'The location to the cURL program application.', '6', '0' , now())"); }
<?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2008 osCommerce Released under the GNU General Public License */ require 'includes/application_top.php'; $languages = tep_get_languages(); $action = isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''; $option_page = isset($HTTP_GET_VARS['option_page']) && is_numeric($HTTP_GET_VARS['option_page']) ? $HTTP_GET_VARS['option_page'] : 1; $value_page = isset($HTTP_GET_VARS['value_page']) && is_numeric($HTTP_GET_VARS['value_page']) ? $HTTP_GET_VARS['value_page'] : 1; $attribute_page = isset($HTTP_GET_VARS['attribute_page']) && is_numeric($HTTP_GET_VARS['attribute_page']) ? $HTTP_GET_VARS['attribute_page'] : 1; $page_info = 'option_page=' . $option_page . '&value_page=' . $value_page . '&attribute_page=' . $attribute_page; if (tep_not_null($action)) { switch ($action) { case 'add_product_options': $products_options_id = tep_db_prepare_input($HTTP_POST_VARS['products_options_id']); $option_name_array = $HTTP_POST_VARS['option_name']; for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { $option_name = tep_db_prepare_input($option_name_array[$languages[$i]['id']]); tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, products_options_name, language_id) values ('" . (int) $products_options_id . "', '" . tep_db_input($option_name) . "', '" . (int) $languages[$i]['id'] . "')"); } tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'add_product_option_values':
function getParams() { if (tep_db_num_rows(tep_db_query("show tables like 'customers_sagepay_tokens'")) != 1) { $sql = <<<EOD CREATE TABLE customers_sagepay_tokens ( id int NOT NULL auto_increment, customers_id int NOT NULL, sagepay_token char(38) NOT NULL, card_type varchar(15) NOT NULL, number_filtered varchar(20) NOT NULL, expiry_date char(4) NOT NULL, date_added datetime NOT NULL, PRIMARY KEY (id), KEY idx_csagepayt_customers_id (customers_id), KEY idx_csagepayt_token (sagepay_token) ); EOD; tep_db_query($sql); } if (!defined('MODULE_PAYMENT_SAGE_PAY_DIRECT_TRANSACTION_ORDER_STATUS_ID')) { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Sage Pay [Transactions]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Sage Pay [Transactions]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } } else { $status_id = MODULE_PAYMENT_SAGE_PAY_DIRECT_TRANSACTION_ORDER_STATUS_ID; } $params = array('MODULE_PAYMENT_SAGE_PAY_DIRECT_STATUS' => array('title' => 'Enable Sage Pay Direct Module', 'desc' => 'Do you want to accept Sage Pay Direct payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_VENDOR_LOGIN_NAME' => array('title' => 'Vendor Login Name', 'desc' => 'The vendor login name to connect to the gateway with.', 'value' => ''), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_VERIFY_WITH_CVC' => array('title' => 'Verify With CVC', 'desc' => 'Verify the credit card with the billing address with the Credit Card Verification Checknumber (CVC)?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_TOKENS' => array('title' => 'Create Tokens', 'desc' => 'Create and store tokens for card payments customer can use on their next purchase?', 'value' => 'False', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_TRANSACTION_METHOD' => array('title' => 'Transaction Method', 'desc' => 'The processing method to use for each transaction.', 'value' => 'Authenticate', 'set_func' => 'tep_cfg_select_option(array(\'Authenticate\', \'Deferred\', \'Payment\'), '), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_ORDER_STATUS_ID' => array('title' => 'Set Order Status', 'desc' => 'Set the status of orders made with this payment module to this value', 'value' => '0', 'use_func' => 'tep_get_order_status_name', 'set_func' => 'tep_cfg_pull_down_order_statuses('), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_TRANSACTION_ORDER_STATUS_ID' => array('title' => 'Transaction Order Status', 'desc' => 'Include transaction information in this order status level', 'value' => $status_id, 'set_func' => 'tep_cfg_pull_down_order_statuses(', 'use_func' => 'tep_get_order_status_name'), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_ZONE' => array('title' => 'Payment Zone', 'desc' => 'If a zone is selected, only enable this payment method for that zone.', 'value' => '0', 'use_func' => 'tep_get_zone_class_title', 'set_func' => 'tep_cfg_pull_down_zone_classes('), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_TRANSACTION_SERVER' => array('title' => 'Transaction Server', 'desc' => 'Perform transactions on the production server or on the testing server.', 'value' => 'Live', 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Test\'), '), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', 'desc' => 'Verify transaction server SSL certificate on connection?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_PROXY' => array('title' => 'Proxy Server', 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_SORT_ORDER' => array('title' => 'Sort order of display.', 'desc' => 'Sort order of display. Lowest is displayed first.', 'value' => '0'), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_VISA' => array('title' => 'Accept Visa', 'desc' => 'Do you want to accept Visa payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_MC' => array('title' => 'Accept Mastercard', 'desc' => 'Do you want to accept Mastercard payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_MCDEBIT' => array('title' => 'Accept Mastercard Debit', 'desc' => 'Do you want to accept Mastercard Debit payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_DELTA' => array('title' => 'Accept Visa Delta/Debit', 'desc' => 'Do you want to accept Visa Delta/Debit payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_MAESTRO' => array('title' => 'Accept Maestro', 'desc' => 'Do you want to accept Maestro payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_UKE' => array('title' => 'Accept Visa Electron UK Debit', 'desc' => 'Do you want to accept Visa Electron UK Debit payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_AMEX' => array('title' => 'Accept American Express', 'desc' => 'Do you want to accept American Express payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_DC' => array('title' => 'Accept Diners Club', 'desc' => 'Do you want to accept Diners Club payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_JCB' => array('title' => 'Accept Japan Credit Bureau', 'desc' => 'Do you want to accept Japan Credit Bureau payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_LASER' => array('title' => 'Accept Laser Card', 'desc' => 'Do you want to accept Laser Card payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_PAYPAL' => array('title' => 'Accept PayPal', 'desc' => 'Do you want to accept PayPal payments?', 'value' => 'False', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), ')); return $params; }
function getParams() { if (!defined('MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID')) { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Preparing [PayPal Standard]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Preparing [PayPal Standard]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } } else { $status_id = MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID; } if (!defined('MODULE_PAYMENT_PAYPAL_STANDARD_TRANSACTIONS_ORDER_STATUS_ID')) { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'PayPal [Transactions]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $tx_status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $tx_status_id . "', '" . $lang['id'] . "', 'PayPal [Transactions]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $tx_status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $tx_status_id = $check['orders_status_id']; } } else { $tx_status_id = MODULE_PAYMENT_PAYPAL_STANDARD_TRANSACTIONS_ORDER_STATUS_ID; } $params = array('MODULE_PAYMENT_PAYPAL_STANDARD_STATUS' => array('title' => 'Enable PayPal Payments Standard', 'desc' => 'Do you want to accept PayPal Payments Standard payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_PAYPAL_STANDARD_ID' => array('title' => 'Seller E-Mail Address', 'desc' => 'The PayPal seller e-mail address to accept payments for'), 'MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID' => array('title' => 'Primary E-Mail Address', 'desc' => 'The primary PayPal seller e-mail address to validate IPN with (leave empty if it is the same as the Seller E-Mail Address)'), 'MODULE_PAYMENT_PAYPAL_STANDARD_PAGE_STYLE' => array('title' => 'Page Style', 'desc' => 'The page style to use for the transaction procedure (defined at your PayPal Profile page)'), 'MODULE_PAYMENT_PAYPAL_STANDARD_TRANSACTION_METHOD' => array('title' => 'Transaction Method', 'desc' => 'The processing method to use for each transaction.', 'value' => 'Sale', 'set_func' => 'tep_cfg_select_option(array(\'Authorization\', \'Sale\'), '), 'MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID' => array('title' => 'Set Preparing Order Status', 'desc' => 'Set the status of prepared orders made with this payment module to this value', 'value' => $status_id, 'set_func' => 'tep_cfg_pull_down_order_statuses(', 'use_func' => 'tep_get_order_status_name'), 'MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID' => array('title' => 'Set PayPal Acknowledged Order Status', 'desc' => 'Set the status of orders made with this payment module to this value', 'value' => '0', 'set_func' => 'tep_cfg_pull_down_order_statuses(', 'use_func' => 'tep_get_order_status_name'), 'MODULE_PAYMENT_PAYPAL_STANDARD_TRANSACTIONS_ORDER_STATUS_ID' => array('title' => 'PayPal Transactions Order Status Level', 'desc' => 'Include PayPal transaction information in this order status level.', 'value' => $tx_status_id, 'use_func' => 'tep_get_order_status_name', 'set_func' => 'tep_cfg_pull_down_order_statuses('), 'MODULE_PAYMENT_PAYPAL_STANDARD_ZONE' => array('title' => 'Payment Zone', 'desc' => 'If a zone is selected, only enable this payment method for that zone.', 'value' => '0', 'use_func' => 'tep_get_zone_class_title', 'set_func' => 'tep_cfg_pull_down_zone_classes('), 'MODULE_PAYMENT_PAYPAL_STANDARD_GATEWAY_SERVER' => array('title' => 'Gateway Server', 'desc' => 'Use the testing (sandbox) or live gateway server for transactions?', 'value' => 'Live', 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Sandbox\'), '), 'MODULE_PAYMENT_PAYPAL_STANDARD_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', 'desc' => 'Verify gateway server SSL certificate on connection?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_PAYPAL_STANDARD_PROXY' => array('title' => 'Proxy Server', 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), 'MODULE_PAYMENT_PAYPAL_STANDARD_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', 'desc' => 'All parameters of an Invalid IPN notification will be sent to this email address if one is entered.'), 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_STATUS' => array('title' => 'Enable Encrypted Website Payments', 'desc' => 'Do you want to enable Encrypted Website Payments?', 'value' => 'False', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_PRIVATE_KEY' => array('title' => 'Your Private Key', 'desc' => 'The location of your Private Key to use for signing the data. (*.pem)'), 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_PUBLIC_KEY' => array('title' => 'Your Public Certificate', 'desc' => 'The location of your Public Certificate to use for signing the data. (*.pem)'), 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_PAYPAL_KEY' => array('title' => 'PayPals Public Certificate', 'desc' => 'The location of the PayPal Public Certificate for encrypting the data.'), 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_CERT_ID' => array('title' => 'Your PayPal Public Certificate ID', 'desc' => 'The Certificate ID to use from your PayPal Encrypted Payment Settings Profile.'), 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY' => array('title' => 'Working Directory', 'desc' => 'The working directory to use for temporary files. (trailing slash needed)'), 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_OPENSSL' => array('title' => 'OpenSSL Location', 'desc' => 'The location of the openssl binary file.', 'value' => '/usr/bin/openssl'), 'MODULE_PAYMENT_PAYPAL_STANDARD_SORT_ORDER' => array('title' => 'Sort order of display.', 'desc' => 'Sort order of display. Lowest is displayed first.', 'value' => '0')); return $params; }
function install() { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Preparing [PayPal IPN]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Preparing [PayPal IPN]')"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable PayPal IPN Module', 'MODULE_PAYMENT_PAYPAL_IPN_STATUS', 'False', 'Do you want to accept PayPal IPN payments?', '6', '1', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Gateway Server', 'MODULE_PAYMENT_PAYPAL_IPN_GATEWAY_SERVER', 'Testing', 'Use the testing (sandbox) or live gateway server for transactions?', '6', '2', 'tep_cfg_select_option(array(\\'Testing\\',\\'Live\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYPAL_IPN_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '3', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('E-Mail Address', 'MODULE_PAYMENT_PAYPAL_IPN_ID', '', 'The e-mail address to use for the PayPal IPN service', '6', '5', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Currency', 'MODULE_PAYMENT_PAYPAL_IPN_CURRENCY', 'Selected Currency', 'The currency to use for transactions', '6', '10', 'tep_cfg_select_option(array(\\'Selected Currency\\',\\'Only USD\\',\\'Only GBP\\',\\'Only AUD\\',\\'Only CAD\\',\\'Only CHF\\',\\'Only CZK\\',\\'Only DKK\\',\\'Only EUR\\',\\'Only HKD\\',\\'Only HUF\\',\\'Only JPY\\',\\'Only NOK\\',\\'Only NZD\\',\\'Only PLN\\',\\'Only SEK\\',\\'Only SGD\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_PAYPAL_IPN_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '11', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Preparing Order Status', 'MODULE_PAYMENT_PAYPAL_IPN_PREPARE_ORDER_STATUS_ID', '" . $status_id . "', 'Set the status of prepared orders made with this payment module to this value', '6', '12', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set PayPal Acknowledged Order Status', 'MODULE_PAYMENT_PAYPAL_IPN_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '13', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set PayPal Completed Order Status', 'MODULE_PAYMENT_PAYPAL_IPN_COMP_ORDER_STATUS_ID', '0', 'Set the status of orders which are confirmed as paid (completed) to this value', '6', '13', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Type', 'MODULE_PAYMENT_PAYPAL_IPN_TRANSACTION_TYPE', 'Aggregate', 'Send individual items to PayPal or aggregate all as one total item?', '6', '14', 'tep_cfg_select_option(array(\\'Per Item\\',\\'Aggregate\\'), ', now())"); // bof PandA.nl move tax to total amount tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Move tax to total amount', 'MOVE_TAX_TO_TOTAL_AMOUNT', 'True', 'Do you want to move the tax to the total amount? If true PayPal will allways show the total amount including tax. (needs Aggregate instead of Per Item to function)', '6', '15', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); // eof PandA.nl move tax to total amount tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Page Style', 'MODULE_PAYMENT_PAYPAL_IPN_PAGE_STYLE', '', 'The page style to use for the transaction procedure (defined at your PayPal Profile page)', '6', '20', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Debug E-Mail Address', 'MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL', '', 'All parameters of an Invalid IPN notification will be sent to this email address if one is entered.', '6', '21', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('cURL Proxy server', 'MODULE_PAYMENT_PAYPAL_IPN_PROXY_SERVER', '', 'If curl transactions need to go through a proxy, type the address here starting with http://. Otherwise, leave it blank. The current GoDaddy proxy address is http://proxy.shr.secureserver.net:3128', '6', '22', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Encrypted Web Payments', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_STATUS', 'False', 'Do you want to enable Encrypted Web Payments?', '6', '30', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Your Private Key', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PRIVATE_KEY', '', 'The location of your Private Key to use for signing the data. (*.pem)', '6', '31', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Your Public Certificate', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PUBLIC_KEY', '', 'The location of your Public Certificate to use for signing the data. (*.pem)', '6', '32', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayPals Public Certificate', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_PAYPAL_KEY', '', 'The location of the PayPal Public Certificate for encrypting the data.', '6', '33', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Your PayPal Public Certificate ID', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_CERT_ID', '', 'The Certificate ID to use from your PayPal Encrypted Payment Settings Profile.', '6', '34', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Working Directory', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_WORKING_DIRECTORY', '', 'The working directory to use for temporary files. (trailing slash needed)', '6', '35', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('OpenSSL Location', 'MODULE_PAYMENT_PAYPAL_IPN_EWP_OPENSSL', '/usr/bin/openssl', 'The location of the openssl binary file.', '6', '36', now())"); }
function addStatus($descStatus) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', '" . $descStatus . "')"); } return $status_id; }
function getParams() { if (!defined('MODULE_PAYMENT_RBSWORLDPAY_HOSTED_PREPARE_ORDER_STATUS_ID')) { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Preparing [WorldPay]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Preparing [WorldPay]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } } else { $status_id = MODULE_PAYMENT_RBSWORLDPAY_HOSTED_PREPARE_ORDER_STATUS_ID; } if (!defined('MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TRANSACTIONS_ORDER_STATUS_ID')) { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'WorldPay [Transactions]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $tx_status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $tx_status_id . "', '" . $lang['id'] . "', 'WorldPay [Transactions]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $tx_status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $tx_status_id = $check['orders_status_id']; } } else { $tx_status_id = MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TRANSACTIONS_ORDER_STATUS_ID; } $params = array('MODULE_PAYMENT_RBSWORLDPAY_HOSTED_STATUS' => array('title' => 'Enable WorldPay Hosted Payment Pages', 'desc' => 'Do you want to accept WorldPay Hosted Payment Pages payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_INSTALLATION_ID' => array('title' => 'Installation ID', 'desc' => 'The WorldPay Account Installation ID to accept payments for'), 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_CALLBACK_PASSWORD' => array('title' => 'Callback Password', 'desc' => 'The password sent to the callback processing script. This must be the same value defined in the WorldPay Merchant Interface.'), 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_MD5_PASSWORD' => array('title' => 'MD5 Password', 'desc' => 'The MD5 password to verify transactions with. This must be the same value defined in the WorldPay Merchant Interface.'), 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TRANSACTION_METHOD' => array('title' => 'Transaction Method', 'desc' => 'The processing method to use for each transaction.', 'value' => 'Capture', 'set_func' => 'tep_cfg_select_option(array(\'Pre-Authorization\', \'Capture\'), '), 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_PREPARE_ORDER_STATUS_ID' => array('title' => 'Set Preparing Order Status', 'desc' => 'Set the status of prepared orders made with this payment module to this value', 'value' => $status_id, 'set_func' => 'tep_cfg_pull_down_order_statuses(', 'use_func' => 'tep_get_order_status_name'), 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_ORDER_STATUS_ID' => array('title' => 'Set Order Status', 'desc' => 'Set the status of orders made with this payment module to this value', 'value' => '0', 'set_func' => 'tep_cfg_pull_down_order_statuses(', 'use_func' => 'tep_get_order_status_name'), 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TRANSACTIONS_ORDER_STATUS_ID' => array('title' => 'Transactions Order Status Level', 'desc' => 'Include WorldPay transaction information in this order status level.', 'value' => $tx_status_id, 'use_func' => 'tep_get_order_status_name', 'set_func' => 'tep_cfg_pull_down_order_statuses('), 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_ZONE' => array('title' => 'Payment Zone', 'desc' => 'If a zone is selected, only enable this payment method for that zone.', 'value' => '0', 'use_func' => 'tep_get_zone_class_title', 'set_func' => 'tep_cfg_pull_down_zone_classes('), 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TESTMODE' => array('title' => 'Test Mode', 'desc' => 'Should transactions be processed in test mode?', 'value' => 'False', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', 'desc' => 'All parameters of an invalid transaction will be sent to this email address if one is entered.'), 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_SORT_ORDER' => array('title' => 'Sort order of display.', 'desc' => 'Sort order of display. Lowest is displayed first.', 'value' => '0')); return $params; }
function tep_reset_cache_block($cache_block) { global $cache_blocks; for ($i = 0, $n = sizeof($cache_blocks); $i < $n; $i++) { if ($cache_blocks[$i]['code'] == $cache_block) { if ($cache_blocks[$i]['multiple']) { if ($dir = @opendir(DIR_FS_CACHE)) { while ($cache_file = readdir($dir)) { $cached_file = $cache_blocks[$i]['file']; $languages = tep_get_languages(); for ($j = 0, $k = sizeof($languages); $j < $k; $j++) { $cached_file_unlink = preg_replace('/-language/', '-' . $languages[$j]['directory'], $cached_file); // if the file name starts with one of those we are looking for and is a cache file (by // checking if it contains the string ".cache" we delete the cache file if (preg_match('/^' . $cached_file_unlink . '/', $cache_file)) { @unlink(DIR_FS_CACHE . $cache_file); } } } closedir($dir); } } else { // not used using hide products or regular osC, but if so, it assumes the $cache_blocks[$i]['file'] does // contain the .cache on the end for example whatever_box-language.cache $cached_file = $cache_blocks[$i]['file']; $languages = tep_get_languages(); for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { $cached_file = preg_replace('/-language/', '-' . $languages[$i]['directory'], $cached_file); @unlink(DIR_FS_CACHE . $cached_file); } } break; } } }
function install() { global $language; require_once DIR_FS_CATALOG . 'includes/languages/' . $language . '/googlecheckout.php'; tep_db_query("ALTER TABLE " . TABLE_CONFIGURATION . " CHANGE `configuration_value` `configuration_value` TEXT NOT NULL"); // Options will appear in the same order as we insert them in the code // if we increment this variable each time. $sort_order = 0; // NOTE(eddavisson): The configuration titles and descriptions are stored // in 255-character fields, so we need to be careful not to exceed that limit. // This is especially easy to do when you embed html in the title/description, // as we do in many places below. // Dummy dashboard link. $this->insertConfiguration("For more options, see the " . $this->getOscLink("Advanced Configuration Dashboard", "gc_dashboard.php"), 'MODULE_PAYMENT_GOOGLECHECKOUT_LINK', '', '', $sort_order++, 'tep_cfg_select_option(array(),'); // Version #. $this->insertConfiguration('Google Checkout Module Version', 'MODULE_PAYMENT_GOOGLECHECKOUT_VERSION', GOOGLECHECKOUT_FILES_VERSION, 'Version of the installed Module', $sort_order++, 'tep_cfg_select_option(array(\\\'' . GOOGLECHECKOUT_FILES_VERSION . '\\\'),'); // Enable/Disable. $this->insertConfiguration('Enable the Google Checkout Module', 'MODULE_PAYMENT_GOOGLECHECKOUT_STATUS', 'True', 'Select "True" to accept payments through Google Checkout on your site.', $sort_order++, 'tep_cfg_select_option(array(\\\'True\\\', \\\'False\\\'),'); // Mode. $this->insertConfiguration('Mode of Operation', 'MODULE_PAYMENT_GOOGLECHECKOUT_MODE', 'https://sandbox.google.com/checkout/', 'Select <b>sandbox.google.com</b> (for testing) or <b>checkout.google.com</b> (live).' . ' Make sure you have entered the corresponding ID/Key pair below.' . ' When you are done testing, switch this option to <b>checkout.google.com</b>.', $sort_order++, 'tep_cfg_select_option(array(\\\'https://sandbox.google.com/checkout/\\\', \\\'https://checkout.google.com/\\\'),'); // Production Merchant ID. // TODO(eddavisson): Add link to Google Checkout Merchant Console. $this->insertConfiguration('Google Checkout Production Merchant ID', 'MODULE_PAYMENT_GOOGLECHECKOUT_MERCHANTID', '', 'Your Merchant ID can be found in the Google Checkout Merchant Console' . ' under ' . $this->getLink('"Integration->Settings"', 'https://checkout.google.com/sell/settings?section=Integration', true) . '.', $sort_order++); // Production Merchant Key. // TODO(eddavisson): Add link to Google Checkout Merchant Console. $this->insertConfiguration('Google Checkout Production Merchant Key' . '<br/>' . $this->getWarning('Note: We strongly recommend that you do not share your Merchant Key with anyone.'), 'MODULE_PAYMENT_GOOGLECHECKOUT_MERCHANTKEY', '', 'Your Merchant Key can also be found in the Google Checkout Merchant Console' . ' under ' . $this->getLink('"Integration->Settings"', 'https://checkout.google.com/sell/settings?section=Integration', true) . '.', $sort_order++); // Sandbox Merchant ID. // TODO(eddavisson): Add link to Google Checkout Merchant Console. $this->insertConfiguration('Google Checkout Sandbox Merchant ID', 'MODULE_PAYMENT_GOOGLECHECKOUT_MERCHANTID_SNDBOX', '', 'Your Merchant ID can be found in the Google Checkout Merchant Console' . ' under ' . $this->getLink('"Integration->Settings"', 'https://sandbox.google.com/checkout/sell/settings?section=Integration', true) . '.', $sort_order++); // Sandbox Merchant Key. // TODO(eddavisson): Add link to Google Checkout Merchant Console. $this->insertConfiguration('Google Checkout Sandbox Merchant Key' . '<br/>' . $this->getWarning('Note: We strongly recommend that you do not share your Merchant Key with anyone.'), 'MODULE_PAYMENT_GOOGLECHECKOUT_MERCHANTKEY_SNDBOX', '', 'Your Merchant ID can be found in the Google Checkout Merchant Console' . ' under ' . $this->getLink('"Integration->Settings"', 'https://sandbox.google.com/checkout/sell/settings?section=Integration', true) . '.', $sort_order++); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_GOOGLE_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); tep_db_query("create table if not exists " . $this->table_name . " (customers_id int(11), buyer_id bigint(20))"); tep_db_query("create table if not exists " . $this->table_order . " (orders_id int(11), google_order_number bigint(20), order_amount decimal(15,4))"); // Add Google Checkout custom order states. $languages = tep_get_languages(); foreach ($this->gc_order_states as $orders_status_id => $orders_status_name) { for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { $language_id = $languages[$i]['id']; $order_status_id = tep_db_fetch_array(tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . (int) $orders_status_id . "' and language_id = '" . (int) $language_id . "'")); $sql_data_array = array('orders_status_name' => tep_db_prepare_input($orders_status_name), 'orders_status_id' => $orders_status_id, 'language_id' => $language_id); if ($order_status_id['orders_status_id'] == '') { tep_db_perform(TABLE_ORDERS_STATUS, $sql_data_array); } else { tep_db_perform(TABLE_ORDERS_STATUS, $sql_data_array, 'update', "orders_status_id = '" . (int) $orders_status_id . "' and language_id = '" . (int) $language_id . "'"); } } } // Custom Google configuration. $google_configuration = new GoogleConfiguration(); $google_configuration->install(); // Set defaults. // TODO(eddavisson): It's awkward to have to construct one of these // in addition to the GoogleConfiguration above. $google_options = new GoogleOptions(); }
function install() { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Pago pendiente [PagaMasTarde]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Pago pendiente [PagaMasTarde]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Paga Más Tarde', 'MODULE_PAYMENT_PAGAMASTARDE_STATUS', 'False', 'Do you want to accept Paga Mas Tarde payments?', '6', '3', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('TEST Public Key', 'MODULE_PAYMENT_PAGAMASTARDE_TEST_ACCOUNT_ID', '', 'Codigo de tu cuenta de TEST de Paga Mas Tarde', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('TEST Secret Key', 'MODULE_PAYMENT_PAGAMASTARDE_TEST_SECRET', '', 'Clave de firma de tu cuenta de TEST de Paga Mas Tarde.', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('REAL Public Key', 'MODULE_PAYMENT_PAGAMASTARDE_ACCOUNT_ID', '', 'Codigo de tu cuenta REAL de Paga Mas Tarde', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('REAL Secret Key', 'MODULE_PAYMENT_PAGAMASTARDE_SECRET', '', 'Clave de firma de tu cuenta REAL de Paga Mas Tarde.', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Modo de pago', 'MODULE_PAYMENT_PAGAMASTARDE_MODE', 'Test', 'Change payment mode?', '6', '3', 'tep_cfg_select_option(array(\\'Test\\', \\'Real\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Descuento - asumir comisiones', 'MODULE_PAYMENT_PAGAMASTARDE_DISCOUNT', 'False', 'Do you want to asume comissions?', '6', '3', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Iframe - abrir en pop-up', 'MODULE_PAYMENT_PAGAMASTARDE_IFRAME', 'False', 'Do you want to open form in a pop-up?', '6', '3', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAGAMASTARDE_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Zona en la que está operativo', 'MODULE_PAYMENT_PAGAMASTARDE_ZONE', '0', 'Si selecciona una zona, esta forma de pago solo estara disponible para dicha zona.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Estado del pedido antes de confirmar', 'MODULE_PAYMENT_PAGAMASTARDE_PREPARE_ORDER_STATUS_ID', '" . $status_id . "', 'El pedido se guarda inicialmente en este estado antes de que PagaMasTarde confirme el pago', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Estado del pedido confirmado', 'MODULE_PAYMENT_PAGAMASTARDE_ORDER_STATUS_ID', '0', 'Cuando PagaMasTarde confirma el pago, el pedido pasara a este estado', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); }
function getParams() { if (!defined('MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTIONS_ORDER_STATUS_ID')) { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'PayPal [Transactions]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'PayPal [Transactions]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } } else { $status_id = MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTIONS_ORDER_STATUS_ID; } $params = array('MODULE_PAYMENT_PAYPAL_EXPRESS_STATUS' => array('title' => 'Enable PayPal Express Checkout', 'desc' => 'Do you want to accept PayPal Express Checkout payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_PAYPAL_EXPRESS_SELLER_ACCOUNT' => array('title' => 'Seller Account', 'desc' => 'The email address of the seller account if no API credentials has been setup.', 'value' => STORE_OWNER_EMAIL_ADDRESS), 'MODULE_PAYMENT_PAYPAL_EXPRESS_API_USERNAME' => array('title' => 'API Username', 'desc' => 'The username to use for the PayPal API service.'), 'MODULE_PAYMENT_PAYPAL_EXPRESS_API_PASSWORD' => array('title' => 'API Password', 'desc' => 'The password to use for the PayPal API service.'), 'MODULE_PAYMENT_PAYPAL_EXPRESS_API_SIGNATURE' => array('title' => 'API Signature', 'desc' => 'The signature to use for the PayPal API service.'), 'MODULE_PAYMENT_PAYPAL_EXPRESS_ACCOUNT_OPTIONAL' => array('title' => 'PayPal Account Optional', 'desc' => 'This must also be enabled in your PayPal account, in Profile > Website Payment Preferences.', 'value' => 'False', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_PAYPAL_EXPRESS_INSTANT_UPDATE' => array('title' => 'PayPal Instant Update', 'desc' => 'Allow PayPal to retrieve shipping rates and taxes for the order.', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_IMAGE' => array('title' => 'PayPal Checkout Image', 'desc' => 'Use static or dynamic Express Checkout image buttons. Dynamic images are used with PayPal campaigns.', 'value' => 'Static', 'set_func' => 'tep_cfg_select_option(array(\'Static\', \'Dynamic\'), '), 'MODULE_PAYMENT_PAYPAL_EXPRESS_PAGE_STYLE' => array('title' => 'Page Style', 'desc' => 'The page style to use for the checkout flow (defined at your PayPal Profile page)'), 'MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_METHOD' => array('title' => 'Transaction Method', 'desc' => 'The processing method to use for each transaction.', 'value' => 'Sale', 'set_func' => 'tep_cfg_select_option(array(\'Authorization\', \'Sale\'), '), 'MODULE_PAYMENT_PAYPAL_EXPRESS_ORDER_STATUS_ID' => array('title' => 'Set Order Status', 'desc' => 'Set the status of orders made with this payment module to this value', 'value' => '0', 'use_func' => 'tep_get_order_status_name', 'set_func' => 'tep_cfg_pull_down_order_statuses('), 'MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTIONS_ORDER_STATUS_ID' => array('title' => 'PayPal Transactions Order Status Level', 'desc' => 'Include PayPal transaction information in this order status level.', 'value' => $status_id, 'use_func' => 'tep_get_order_status_name', 'set_func' => 'tep_cfg_pull_down_order_statuses('), 'MODULE_PAYMENT_PAYPAL_EXPRESS_ZONE' => array('title' => 'Payment Zone', 'desc' => 'If a zone is selected, only enable this payment method for that zone.', 'value' => '0', 'use_func' => 'tep_get_zone_class_title', 'set_func' => 'tep_cfg_pull_down_zone_classes('), 'MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER' => array('title' => 'Transaction Server', 'desc' => 'Use the live or testing (sandbox) gateway server to process transactions?', 'value' => 'Live', 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Sandbox\'), '), 'MODULE_PAYMENT_PAYPAL_EXPRESS_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', 'desc' => 'Verify gateway server SSL certificate on connection?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_PAYPAL_EXPRESS_PROXY' => array('title' => 'Proxy Server', 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), 'MODULE_PAYMENT_PAYPAL_EXPRESS_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), 'MODULE_PAYMENT_PAYPAL_EXPRESS_SORT_ORDER' => array('title' => 'Sort order of display', 'desc' => 'Sort order of display. Lowest is displayed first.', 'value' => '0')); return $params; }
function getParams() { if (!defined('MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTIONS_ORDER_STATUS_ID')) { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'PayPal [Transactions]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'PayPal [Transactions]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } } else { $status_id = MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTIONS_ORDER_STATUS_ID; } $params = array('MODULE_PAYMENT_PAYPAL_PRO_DP_STATUS' => array('title' => 'Enable PayPal Payments Pro (Direct Payment)', 'desc' => 'Do you want to accept PayPal Payments Pro (Direct Payment) payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_PAYPAL_PRO_DP_API_USERNAME' => array('title' => 'API Username', 'desc' => 'The username to use for the PayPal API service.'), 'MODULE_PAYMENT_PAYPAL_PRO_DP_API_PASSWORD' => array('title' => 'API Password', 'desc' => 'The password to use for the PayPal API service.'), 'MODULE_PAYMENT_PAYPAL_PRO_DP_API_SIGNATURE' => array('title' => 'API Signature', 'desc' => 'The signature to use for the PayPal API service.'), 'MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTION_METHOD' => array('title' => 'Transaction Method', 'desc' => 'The processing method to use for each transaction.', 'value' => 'Sale', 'set_func' => 'tep_cfg_select_option(array(\'Authorization\', \'Sale\'), '), 'MODULE_PAYMENT_PAYPAL_PRO_DP_ORDER_STATUS_ID' => array('title' => 'Set Order Status', 'desc' => 'Set the status of orders made with this payment module to this value.', 'value' => '0', 'set_func' => 'tep_cfg_pull_down_order_statuses(', 'use_func' => 'tep_get_order_status_name'), 'MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTIONS_ORDER_STATUS_ID' => array('title' => 'PayPal Transactions Order Status Level', 'desc' => 'Include PayPal transaction information in this order status level.', 'value' => $status_id, 'use_func' => 'tep_get_order_status_name', 'set_func' => 'tep_cfg_pull_down_order_statuses('), 'MODULE_PAYMENT_PAYPAL_PRO_DP_ZONE' => array('title' => 'Payment Zone', 'desc' => 'If a zone is selected, only enable this payment method for that zone.', 'value' => '0', 'set_func' => 'tep_cfg_pull_down_zone_classes(', 'use_func' => 'tep_get_zone_class_title'), 'MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTION_SERVER' => array('title' => 'Transaction Server', 'desc' => 'Use the live or testing (sandbox) gateway server to process transactions?', 'value' => 'Live', 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Sandbox\'), '), 'MODULE_PAYMENT_PAYPAL_PRO_DP_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', 'desc' => 'Verify gateway server SSL certificate on connection?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_PAYPAL_PRO_DP_PROXY' => array('title' => 'Proxy Server', 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), 'MODULE_PAYMENT_PAYPAL_PRO_DP_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), 'MODULE_PAYMENT_PAYPAL_PRO_DP_SORT_ORDER' => array('title' => 'Sort order of display.', 'desc' => 'Sort order of display. Lowest is displayed first.', 'value' => '0'), 'MODULE_PAYMENT_PAYPAL_PRO_DP_CARDTYPE_VISA' => array('title' => 'Accept Visa', 'desc' => 'Accept Visa card payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_PAYPAL_PRO_DP_CARDTYPE_MASTERCARD' => array('title' => 'Accept MasterCard', 'desc' => 'Accept MasterCard card payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_PAYPAL_PRO_DP_CARDTYPE_DISCOVER' => array('title' => 'Accept Discover', 'desc' => 'Accept Discover card payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_PAYPAL_PRO_DP_CARDTYPE_AMEX' => array('title' => 'Accept American Express', 'desc' => 'Accept American Express card payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_PAYPAL_PRO_DP_CARDTYPE_MAESTRO' => array('title' => 'Accept Maestro', 'desc' => 'Accept Maestro card payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), ')); return $params; }
function install() { global $HTTP_GET_VARS; $kdnr = isset($HTTP_GET_VARS['kdnr']) && !empty($HTTP_GET_VARS['kdnr']) ? tep_db_prepare_input($HTTP_GET_VARS['kdnr']) : '10000'; $projekt = isset($HTTP_GET_VARS['projekt']) && !empty($HTTP_GET_VARS['projekt']) ? tep_db_prepare_input($HTTP_GET_VARS['projekt']) : '500000'; $input_passwort = isset($HTTP_GET_VARS['input_passwort']) && !empty($HTTP_GET_VARS['input_passwort']) ? tep_db_prepare_input($HTTP_GET_VARS['input_passwort']) : ''; $bna_passwort = isset($HTTP_GET_VARS['bna_passwort']) && !empty($HTTP_GET_VARS['bna_passwort']) ? tep_db_prepare_input($HTTP_GET_VARS['bna_passwort']) : ''; $cnt_passwort = isset($HTTP_GET_VARS['cnt_passwort']) && !empty($HTTP_GET_VARS['cnt_passwort']) ? tep_db_prepare_input($HTTP_GET_VARS['cnt_passwort']) : ''; $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Sofortüberweisung Vorbereitung' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $languages[$i]['id'] . "', 'Sofortüberweisung Vorbereitung')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Sofortüberweisung direkter Modus aktivieren', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_STATUS', 'True', 'Bezahlung per Sofortüberweisung acceptieren?', '6', '1', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now());"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Kundennummer:', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_KDNR', '" . (int) $kdnr . "', 'Ihre Kundennummer bei der Sofortüberweisung', '6', '1', now());"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Projektnummer:', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_PROJEKT', '" . (int) $projekt . "', 'Die verantwortliche Projektnummer bei der Sofortüberweisung, zu der die Zahlung gehört', '6', '1', now());"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Input-Passwort:', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_INPUT_PASSWORT', '" . tep_db_input($input_passwort) . "', 'Das Input-Passwort (unter Nicht änderbare Parameter / Input-Passwort)', '6', '1', now());"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Benachrichtigung-Passwort:', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_BNA_PASSWORT', '" . tep_db_input($bna_passwort) . "', 'Das Benachrichtigung-Passwort (unter Benachrichtigungen festlegen)', '6', '1', now());"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Contentpasswort:', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_CNT_PASSWORT', '" . tep_db_input($cnt_passwort) . "', 'Das Contentpasswort (unter Content-Passwort)', '6', '1', now());"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Preparing Order Status', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_PREPARE_ORDER_STATUS_ID', '" . (int) $status_id . "', 'Order Status vor Eingang Bestellung', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_ORDER_STATUS_ID', '0', 'Order Status nach Eingang Bestellung', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Store Transactiondetails', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_STORE_TRANSACTION_DETAILS', 'False', 'Transactionsdetails bei Benachrichtigung in das Kommentarfeld speichern (zum debuggen, ist für Kunden via Konto sichtbar)', '6', '2', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now());"); }
function getParams() { if (tep_db_num_rows(tep_db_query("show tables like 'customers_stripe_tokens'")) != 1) { $sql = <<<EOD CREATE TABLE customers_stripe_tokens ( id int NOT NULL auto_increment, customers_id int NOT NULL, stripe_token varchar(255) NOT NULL, card_type varchar(32) NOT NULL, number_filtered varchar(20) NOT NULL, expiry_date char(6) NOT NULL, date_added datetime NOT NULL, PRIMARY KEY (id), KEY idx_cstripet_customers_id (customers_id), KEY idx_cstripet_token (stripe_token) ); EOD; tep_db_query($sql); } if (!defined('MODULE_PAYMENT_STRIPE_TRANSACTION_ORDER_STATUS_ID')) { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Stripe [Transactions]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Stripe [Transactions]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } } else { $status_id = MODULE_PAYMENT_STRIPE_TRANSACTION_ORDER_STATUS_ID; } $params = array('MODULE_PAYMENT_STRIPE_STATUS' => array('title' => 'Enable Stripe Module', 'desc' => 'Do you want to accept Stripe payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_STRIPE_PUBLISHABLE_KEY' => array('title' => 'Publishable API Key', 'desc' => 'The Stripe account publishable API key to use.', 'value' => ''), 'MODULE_PAYMENT_STRIPE_SECRET_KEY' => array('title' => 'Secret API Key', 'desc' => 'The Stripe account secret API key to use with the publishable key.', 'value' => ''), 'MODULE_PAYMENT_STRIPE_TOKENS' => array('title' => 'Create Tokens', 'desc' => 'Create and store tokens for card payments customers can use on their next purchase?', 'value' => 'False', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_STRIPE_VERIFY_WITH_CVC' => array('title' => 'Verify With CVC', 'desc' => 'Verify the credit card billing address with the Card Verification Code (CVC)?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_STRIPE_TRANSACTION_METHOD' => array('title' => 'Transaction Method', 'desc' => 'The processing method to use for each transaction.', 'value' => 'Authorize', 'set_func' => 'tep_cfg_select_option(array(\'Authorize\', \'Capture\'), '), 'MODULE_PAYMENT_STRIPE_ORDER_STATUS_ID' => array('title' => 'Set Order Status', 'desc' => 'Set the status of orders made with this payment module to this value', 'value' => '0', 'use_func' => 'tep_get_order_status_name', 'set_func' => 'tep_cfg_pull_down_order_statuses('), 'MODULE_PAYMENT_STRIPE_TRANSACTION_ORDER_STATUS_ID' => array('title' => 'Transaction Order Status', 'desc' => 'Include transaction information in this order status level', 'value' => $status_id, 'set_func' => 'tep_cfg_pull_down_order_statuses(', 'use_func' => 'tep_get_order_status_name'), 'MODULE_PAYMENT_STRIPE_ZONE' => array('title' => 'Payment Zone', 'desc' => 'If a zone is selected, only enable this payment method for that zone.', 'value' => '0', 'use_func' => 'tep_get_zone_class_title', 'set_func' => 'tep_cfg_pull_down_zone_classes('), 'MODULE_PAYMENT_STRIPE_TRANSACTION_SERVER' => array('title' => 'Transaction Server', 'desc' => 'Perform transactions on the production server or on the testing server.', 'value' => 'Live', 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Test\'), '), 'MODULE_PAYMENT_STRIPE_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', 'desc' => 'Verify gateway server SSL certificate on connection?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_STRIPE_PROXY' => array('title' => 'Proxy Server', 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), 'MODULE_PAYMENT_STRIPE_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), 'MODULE_PAYMENT_STRIPE_SORT_ORDER' => array('title' => 'Sort order of display.', 'desc' => 'Sort order of display. Lowest is displayed first.', 'value' => '0')); return $params; }
function install() { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Preparing [PayPal Standard]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Preparing [PayPal Standard]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable PayPal Website Payments Standard', 'MODULE_PAYMENT_PAYPAL_STANDARD_STATUS', 'False', 'Do you want to accept PayPal Website Payments Standard payments?', '6', '3', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('E-Mail Address', 'MODULE_PAYMENT_PAYPAL_STANDARD_ID', '', 'The PayPal seller e-mail address to accept payments for', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYPAL_STANDARD_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_PAYPAL_STANDARD_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Preparing Order Status', 'MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID', '" . $status_id . "', 'Set the status of prepared orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set PayPal Acknowledged Order Status', 'MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Gateway Server', 'MODULE_PAYMENT_PAYPAL_STANDARD_GATEWAY_SERVER', 'Live', 'Use the testing (sandbox) or live gateway server for transactions?', '6', '6', 'tep_cfg_select_option(array(\\'Live\\', \\'Sandbox\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Method', 'MODULE_PAYMENT_PAYPAL_STANDARD_TRANSACTION_METHOD', 'Sale', 'The processing method to use for each transaction.', '6', '0', 'tep_cfg_select_option(array(\\'Authorization\\', \\'Sale\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Page Style', 'MODULE_PAYMENT_PAYPAL_STANDARD_PAGE_STYLE', '', 'The page style to use for the transaction procedure (defined at your PayPal Profile page)', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Debug E-Mail Address', 'MODULE_PAYMENT_PAYPAL_STANDARD_DEBUG_EMAIL', '', 'All parameters of an Invalid IPN notification will be sent to this email address if one is entered.', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Encrypted Web Payments', 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_STATUS', 'False', 'Do you want to enable Encrypted Web Payments?', '6', '3', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Your Private Key', 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_PRIVATE_KEY', '', 'The location of your Private Key to use for signing the data. (*.pem)', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Your Public Certificate', 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_PUBLIC_KEY', '', 'The location of your Public Certificate to use for signing the data. (*.pem)', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayPals Public Certificate', 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_PAYPAL_KEY', '', 'The location of the PayPal Public Certificate for encrypting the data.', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Your PayPal Public Certificate ID', 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_CERT_ID', '', 'The Certificate ID to use from your PayPal Encrypted Payment Settings Profile.', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Working Directory', 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY', '', 'The working directory to use for temporary files. (trailing slash needed)', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('OpenSSL Location', 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_OPENSSL', '/usr/bin/openssl', 'The location of the openssl binary file.', '6', '4', now())"); }
function getParams() { if (!defined('MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTIONS_ORDER_STATUS_ID')) { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'PayPal [Transactions]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'PayPal [Transactions]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } } else { $status_id = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTIONS_ORDER_STATUS_ID; } $params = array('MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_STATUS' => array('title' => 'Enable PayPal Payments Pro (Payflow Edition)', 'desc' => 'Do you want to accept PayPal Payments Pro (Payflow Edition) payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_VENDOR' => array('title' => 'Vendor', 'desc' => 'Your merchant login ID that you created when you registered for the PayPal Payments Pro account.'), 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_USERNAME' => array('title' => 'User', 'desc' => 'If you set up one or more additional users on the account, this value is the ID of the user authorised to process transactions. If, however, you have not set up additional users on the account, USER has the same value as VENDOR.'), 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PASSWORD' => array('title' => 'Password', 'desc' => 'The 6- to 32-character password that you defined while registering for the account.'), 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PARTNER' => array('title' => 'Partner', 'desc' => 'The ID provided to you by the authorised PayPal Reseller who registered you for the Payflow SDK. If you purchased your account directly from PayPal, use PayPalUK.', 'value' => 'PayPalUK'), 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTION_METHOD' => array('title' => 'Transaction Method', 'desc' => 'The processing method to use for each transaction.', 'value' => 'Sale', 'set_func' => 'tep_cfg_select_option(array(\'Authorization\', \'Sale\'), '), 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ORDER_STATUS_ID' => array('title' => 'Set Order Status', 'desc' => 'Set the status of orders made with this payment module to this value.', 'value' => '0', 'set_func' => 'tep_cfg_pull_down_order_statuses(', 'use_func' => 'tep_get_order_status_name'), 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTIONS_ORDER_STATUS_ID' => array('title' => 'PayPal Transactions Order Status Level', 'desc' => 'Include PayPal transaction information in this order status level.', 'value' => $status_id, 'use_func' => 'tep_get_order_status_name', 'set_func' => 'tep_cfg_pull_down_order_statuses('), 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ZONE' => array('title' => 'Payment Zone', 'desc' => 'If a zone is selected, only enable this payment method for that zone.', 'value' => '0', 'set_func' => 'tep_cfg_pull_down_zone_classes(', 'use_func' => 'tep_get_zone_class_title'), 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTION_SERVER' => array('title' => 'Transaction Server', 'desc' => 'Use the live or testing (sandbox) gateway server to process transactions?', 'value' => 'Live', 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Sandbox\'), '), 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', 'desc' => 'Verify gateway server SSL certificate on connection?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PROXY' => array('title' => 'Proxy Server', 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_SORT_ORDER' => array('title' => 'Sort order of display.', 'desc' => 'Sort order of display. Lowest is displayed first.', 'value' => '0')); return $params; }
function getParams() { if (!defined('MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_ORDER_STATUS_ID')) { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Authorize.net [Transactions]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Authorize.net [Transactions]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } } else { $status_id = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_ORDER_STATUS_ID; } $params = array('MODULE_PAYMENT_AUTHORIZENET_CC_AIM_STATUS' => array('title' => 'Enable Authorize.net Advanced Integration Method', 'desc' => 'Do you want to accept Authorize.net Advanced Integration Method payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_LOGIN_ID' => array('title' => 'API Login ID', 'desc' => 'The API Login ID used for the Authorize.net service'), 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_KEY' => array('title' => 'API Transaction Key', 'desc' => 'The API Transaction Key used for the Authorize.net service'), 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_MD5_HASH' => array('title' => 'MD5 Hash', 'desc' => 'The MD5 Hash value to verify transactions with'), 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_METHOD' => array('title' => 'Transaction Method', 'desc' => 'The processing method to use for each transaction.', 'value' => 'Authorization', 'set_func' => 'tep_cfg_select_option(array(\'Authorization\', \'Capture\'), '), 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ORDER_STATUS_ID' => array('title' => 'Set Order Status', 'desc' => 'Set the status of orders made with this payment module to this value', 'value' => '0', 'use_func' => 'tep_get_order_status_name', 'set_func' => 'tep_cfg_pull_down_order_statuses('), 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_REVIEW_ORDER_STATUS_ID' => array('title' => 'Review Order Status', 'desc' => 'Set the status of orders flagged as being under review to this value', 'value' => '0', 'use_func' => 'tep_get_order_status_name', 'set_func' => 'tep_cfg_pull_down_order_statuses('), 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_ORDER_STATUS_ID' => array('title' => 'Transaction Order Status', 'desc' => 'Include transaction information in this order status level', 'value' => $status_id, 'use_func' => 'tep_get_order_status_name', 'set_func' => 'tep_cfg_pull_down_order_statuses('), 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ZONE' => array('title' => 'Payment Zone', 'desc' => 'If a zone is selected, only enable this payment method for that zone.', 'value' => '0', 'set_func' => 'tep_cfg_pull_down_zone_classes(', 'use_func' => 'tep_get_zone_class_title'), 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_SERVER' => array('title' => 'Transaction Server', 'desc' => 'Perform transactions on the live or test server. The test server should only be used by developers with Authorize.net test accounts.', 'value' => 'Live', 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Test\'), '), 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_MODE' => array('title' => 'Transaction Mode', 'desc' => 'Transaction mode used for processing orders', 'value' => 'Live', 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Test\'), '), 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', 'desc' => 'Verify transaction server SSL certificate on connection?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_PROXY' => array('title' => 'Proxy Server', 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_SORT_ORDER' => array('title' => 'Sort order of display.', 'desc' => 'Sort order of display. Lowest is displayed first.', 'value' => '0')); return $params; }
function install() { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Preparing [ChronoPay]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $languages[$i]['id'] . "', 'Preparing [ChronoPay]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable ChronoPay', 'MODULE_PAYMENT_CHRONOPAY_STATUS', 'False', 'Do you want to accept ChronoPay payments?', '6', '3', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('ChronoPay Product ID', 'MODULE_PAYMENT_CHRONOPAY_PRODUCT_ID', '', 'The product ID to assign transactions to.', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('MD5 Hash Signature', 'MODULE_PAYMENT_CHRONOPAY_MD5_HASH', '', 'Use this value to verify transactions with.', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_CHRONOPAY_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Preparing Order Status', 'MODULE_PAYMENT_CHRONOPAY_PREPARE_ORDER_STATUS_ID', '" . $status_id . "', 'Set the status of prepared orders made with this payment module to this value.', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set ChronoPay Acknowledged Order Status', 'MODULE_PAYMENT_CHRONOPAY_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value.', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_CHRONOPAY_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); }
function install() { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Preparing [WorldPay]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $languages[$i]['id'] . "', 'Preparing [WorldPay]')"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable WorldPay Select Junior Module', 'MODULE_PAYMENT_WORLDPAY_JUNIOR_STATUS', 'True', 'Do you want to accept WorldPay Select Junior payments?', '6', '0', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Installation ID', 'MODULE_PAYMENT_WORLDPAY_JUNIOR_INSTALLATION_ID', '', 'Your WorldPay Installation ID', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Encryption Password', 'MODULE_PAYMENT_WORLDPAY_JUNIOR_ENCRYPTION_PASSWORD', '', 'The encryption password to validate transaction responses with', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Test Mode', 'MODULE_PAYMENT_WORLDPAY_JUNIOR_TESTMODE', 'True', 'Process transactions in test mode?', '6', '0', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_WORLDPAY_JUNIOR_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_WORLDPAY_JUNIOR_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Preparing Order Status', 'MODULE_PAYMENT_WORLDPAY_JUNIOR_PREPARE_ORDER_STATUS_ID', '" . (int) $status_id . "', 'Set the status of prepared orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_WORLDPAY_JUNIOR_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); }
function install() { if (!isset($_GET['active']) || $_GET['active'] != 'true') { tep_redirect(tep_href_link('ext/modules/payment/moneybookers/activation.php', 'selected_box=modules&set=payment')); } // Preparing order status $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Preparing [Moneybookers]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $preparing_status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $preparing_status_id . "', '" . $lang['id'] . "', 'Preparing [Moneybookers]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $preparing_status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $preparing_status_id = $check['orders_status_id']; } // Transactions order status $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Transaction [Moneybookers]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $transactions_status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $transactions_status_id . "', '" . $lang['id'] . "', 'Transaction [Moneybookers]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $transactions_status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $transactions_status_id = $check['orders_status_id']; } tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Moneybookers eWallet', 'MODULE_PAYMENT_MONEYBOOKERS_STATUS', 'False', 'Do you want to accept Moneybookers eWallet payments?', '6', '3', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('E-Mail Address', 'MODULE_PAYMENT_MONEYBOOKERS_PAY_TO', '" . (isset($_GET['email']) ? $_GET['email'] : '') . "', 'The Moneybookers seller e-mail address to accept payments for', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID', 'MODULE_PAYMENT_MONEYBOOKERS_MERCHANT_ID', '" . (isset($_GET['custid']) ? $_GET['custid'] : '') . "', 'The Moneybookers merchant ID assigned to the seller e-mail address', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Secret Word', 'MODULE_PAYMENT_MONEYBOOKERS_SECRET_WORD', '', 'The secret word to verify transactions with', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Store Logo Image', 'MODULE_PAYMENT_MONEYBOOKERS_STORE_IMAGE', '" . tep_catalog_href_link('images/store_logo.png', '', 'SSL') . "', 'The URL of the store logo image to display on the gateway transaction page. This must be served through HTTPS otherwise it will not be shown.', '6', '4', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('iFrame Presentation', 'MODULE_PAYMENT_MONEYBOOKERS_IFRAME', 'True', 'Show the Moneybookers payment pages through an iFrame?', '6', '3', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Debug E-Mail Address', 'MODULE_PAYMENT_MONEYBOOKERS_DEBUG_EMAIL', '', 'All parameters of an invalid transaction will be sent to this email address.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_MONEYBOOKERS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_MONEYBOOKERS_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Preparing Order Status', 'MODULE_PAYMENT_MONEYBOOKERS_PREPARE_ORDER_STATUS_ID', '" . $preparing_status_id . "', 'Set the status of prepared orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Transactions Order Status', 'MODULE_PAYMENT_MONEYBOOKERS_TRANSACTIONS_ORDER_STATUS_ID', '" . $transactions_status_id . "', 'Set the status of callback transactions to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_MONEYBOOKERS_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('cURL Program Location', 'MODULE_PAYMENT_MONEYBOOKERS_CURL', '/usr/bin/curl', 'The location to the cURL program application.', '6', '0' , now())"); }
function install() { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Preparing [WorldPay]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $languages[$i]['id'] . "', 'Preparing [WorldPay]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable RBS WorldPay Hosted', 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_STATUS', 'False', 'Do you want to accept RBS WorldPay Hosted payments?', '6', '0', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Installation ID', 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_INSTALLATION_ID', '', 'Your WorldPay Installation ID.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Callback Password', 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_CALLBACK_PASSWORD', '', 'A password that is sent back in the callback response (specified in the WorldPay Customer Management System).', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('MD5 Password', 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_MD5_PASSWORD', '', 'The MD5 secret encryption password used to validate transaction responses with (specified in the WorldPay Customer Management System).', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Method', 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TRANSACTION_METHOD', 'Capture', 'The processing method to use for each transaction.', '6', '0', 'tep_cfg_select_option(array(\\'Pre-Authorization\\', \\'Capture\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Test Mode', 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TESTMODE', 'True', 'Process transactions in test mode?', '6', '0', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Preparing Order Status', 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_PREPARE_ORDER_STATUS_ID', '" . (int) $status_id . "', 'Set the status of prepared orders made with this payment module to this value.', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value.', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); }
function tep_load_blocks($content_id, $content_type) { global $languages_id, $HTTP_POST_VARS, $PHP_SELF, $HTTP_GET_VARS; $templates_id = ''; if ($content_type == 'page') { $templates = array(array('id' => '', 'text' => TEXT_CHOOSE)); $templates_query = tep_db_query("select templates_id, templates_name from " . TABLE_TEMPLATES . " where language_id = '" . (int) $languages_id . "' order by sort_order, default_status desc, templates_id"); while ($templates_array = tep_db_fetch_array($templates_query)) { $templates[] = array('id' => $templates_array['templates_id'], 'text' => $templates_array['templates_name']); } $template_info_query = tep_db_query("select templates_id from " . TABLE_TEMPLATES_TO_CONTENT . " where content_type = '" . tep_db_input($content_type) . "' and content_id = '" . (int) $content_id . "'"); $template_info = tep_db_fetch_array($template_info_query); $templates_id = isset($HTTP_POST_VARS['templates_id']) ? $HTTP_POST_VARS['templates_id'] : $template_info['templates_id']; } $languages = tep_get_languages(); $metatags = array('metatags_page_title' => 'Заголовок окна', 'metatags_title' => 'Заголовок страницы', 'metatags_keywords' => 'Ключевые слова (meta-keywords)', 'metatags_description' => 'Описание (meta-description)'); ?> <div id="blocks"> <table border="0" width="100%" cellspacing="0" cellpadding="1"> <?php if ($content_type == 'page') { ?> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?> </td> </tr> <tr valign="top"> <td class="main" style="width: 250px;"><?php echo TEXT_CHOOSE_TEMPLATE; ?> </td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '18', '12') . ' ' . tep_draw_pull_down_menu('templates_id', $templates, $templates_id); ?> </td> </tr> <?php } reset($metatags); while (list($metatag, $title) = each($metatags)) { ?> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?> </td> </tr> <?php for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { $value_query = tep_db_query("select " . tep_db_input($metatag) . " as value from " . TABLE_METATAGS . " where content_id = '" . (int) $content_id . "' and content_type = '" . tep_db_input($content_type) . "' and language_id = '" . (int) $languages[$i]['id'] . "'"); $value = tep_db_fetch_array($value_query); ?> <tr valign="top"> <td class="main" style="width: 250px;"><?php if ($i == 0) { echo $title . ':'; } ?> </td> <td class="main"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . $languages[$i]['image'], $languages[$i]['name'], '', '', 'style="float: left; margin: 4px 4px 0px 0px;"'); $field_name = $metatag . '[' . $languages[$i]['id'] . ']'; $field_value = isset($HTTP_POST_VARS[$metatag][$languages[$i]['id']]) ? $HTTP_POST_VARS[$metatag][$languages[$i]['id']] : $value['value']; $field_value = str_replace('\\\\"', '"', $field_value); $field_value = str_replace('\\"', '"', $field_value); $field_value = str_replace("\\\\'", "\\'", $field_value); $field_value = str_replace('src="/', 'src="' . HTTP_SERVER . '/', $field_value); if ($metatag == 'metatags_description') { echo tep_draw_textarea_field($field_name, 'soft', '55', '5', $field_value); } else { echo tep_draw_input_field($field_name, $field_value, 'size="55"'); } ?> </td> </tr> <?php } } echo '</table></div>'; }
function getParams() { $OSCOM_Db = Registry::get('Db'); $Qcheck = $OSCOM_Db->query('show tables like "sagepay_server_securitykeys"'); if ($Qcheck->fetch() === false) { $sql = <<<EOD CREATE TABLE sagepay_server_securitykeys ( id int NOT NULL auto_increment, code char(16) NOT NULL, securitykey char(10) NOT NULL, date_added datetime NOT NULL, verified char(1) DEFAULT 0, transaction_details text, PRIMARY KEY (id), KEY idx_sagepay_server_securitykeys_code (code), KEY idx_sagepay_server_securitykeys_securitykey (securitykey) ); EOD; $OSCOM_Db->exec($sql); } if (!defined('MODULE_PAYMENT_SAGE_PAY_SERVER_TRANSACTION_ORDER_STATUS_ID')) { $Qcheck = $OSCOM_Db->get('orders_status', 'orders_status_id', ['orders_status_name' => 'Sage Pay [Transactions]'], null, 1); if ($Qcheck->fetch() === false) { $Qstatus = $OSCOM_Db->get('orders_status', 'max(orders_status_id) as status_id'); $status_id = $Qstatus->valueInt('status_id') + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { $OSCOM_Db->save('orders_status', ['orders_status_id' => $status_id, 'language_id' => $lang['id'], 'orders_status_name' => 'Sage Pay [Transactions]', 'public_flag' => 0, 'downloads_flag' => 0]); } } else { $status_id = $Qcheck->valueInt('orders_status_id'); } } else { $status_id = MODULE_PAYMENT_SAGE_PAY_SERVER_TRANSACTION_ORDER_STATUS_ID; } $params = array('MODULE_PAYMENT_SAGE_PAY_SERVER_STATUS' => array('title' => 'Enable Sage Pay Server Module', 'desc' => 'Do you want to accept Sage Pay Server payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_SERVER_VENDOR_LOGIN_NAME' => array('title' => 'Vendor Login Name', 'desc' => 'The vendor login name to connect to the gateway with.'), 'MODULE_PAYMENT_SAGE_PAY_SERVER_PROFILE_PAGE' => array('title' => 'Profile Payment Page', 'desc' => 'Profile page to use for the payment page, Normal is a full redirect to Sage Pay and Low loads through an iframe.', 'value' => 'Normal', 'set_func' => 'tep_cfg_select_option(array(\'Normal\', \'Low\'), '), 'MODULE_PAYMENT_SAGE_PAY_SERVER_TRANSACTION_METHOD' => array('title' => 'Transaction Method', 'desc' => 'The processing method to use for each transaction.', 'value' => 'Authenticate', 'set_func' => 'tep_cfg_select_option(array(\'Authenticate\', \'Deferred\', \'Payment\'), '), 'MODULE_PAYMENT_SAGE_PAY_SERVER_ORDER_STATUS_ID' => array('title' => 'Set Order Status', 'desc' => 'Set the status of orders made with this payment module to this value', 'value' => '0', 'use_func' => 'tep_get_order_status_name', 'set_func' => 'tep_cfg_pull_down_order_statuses('), 'MODULE_PAYMENT_SAGE_PAY_SERVER_TRANSACTION_ORDER_STATUS_ID' => array('title' => 'Transaction Order Status', 'desc' => 'Include transaction information in this order status level', 'value' => $status_id, 'set_func' => 'tep_cfg_pull_down_order_statuses(', 'use_func' => 'tep_get_order_status_name'), 'MODULE_PAYMENT_SAGE_PAY_SERVER_ZONE' => array('title' => 'Payment Zone', 'desc' => 'If a zone is selected, only enable this payment method for that zone.', 'value' => '0', 'use_func' => 'tep_get_zone_class_title', 'set_func' => 'tep_cfg_pull_down_zone_classes('), 'MODULE_PAYMENT_SAGE_PAY_SERVER_TRANSACTION_SERVER' => array('title' => 'Transaction Server', 'desc' => 'Perform transactions on the production server or on the testing server.', 'value' => 'Live', 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Test\'), '), 'MODULE_PAYMENT_SAGE_PAY_SERVER_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', 'desc' => 'Verify transaction server SSL certificate on connection?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_SERVER_PROXY' => array('title' => 'Proxy Server', 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), 'MODULE_PAYMENT_SAGE_PAY_SERVER_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), 'MODULE_PAYMENT_SAGE_PAY_SERVER_SORT_ORDER' => array('title' => 'Sort order of display.', 'desc' => 'Sort order of display. Lowest is displayed first.', 'value' => '0')); return $params; }
function tep_reset_cache_block($cache_block) { global $cache_blocks; for ($i = 0, $n = sizeof($cache_blocks); $i < $n; $i++) { if ($cache_blocks[$i]['code'] == $cache_block) { if ($cache_blocks[$i]['multiple']) { if ($dir = @opendir(DIR_FS_CACHE)) { while ($cache_file = readdir($dir)) { $cached_file = $cache_blocks[$i]['file']; $languages = tep_get_languages(); for ($j = 0, $k = sizeof($languages); $j < $k; $j++) { $cached_file_unlink = preg_replace('/-language/', '-' . $languages[$j]['directory'], $cached_file); if (preg_match('/^' . $cached_file_unlink . '/', $cache_file)) { @unlink(DIR_FS_CACHE . $cache_file); } } } closedir($dir); } } else { $cached_file = $cache_blocks[$i]['file']; $languages = tep_get_languages(); for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { $cached_file = preg_replace('/-language/', '-' . $languages[$i]['directory'], $cached_file); @unlink(DIR_FS_CACHE . $cached_file); } } break; } } }
function getParams() { if (tep_db_num_rows(tep_db_query("show tables like 'sagepay_server_securitykeys'")) != 1) { $sql = <<<EOD CREATE TABLE sagepay_server_securitykeys ( id int NOT NULL auto_increment, code char(16) NOT NULL, securitykey char(10) NOT NULL, date_added datetime NOT NULL, verified char(1) DEFAULT 0, transaction_details text, PRIMARY KEY (id), KEY idx_sagepay_server_securitykeys_code (code), KEY idx_sagepay_server_securitykeys_securitykey (securitykey) ); EOD; tep_db_query($sql); } if (!defined('MODULE_PAYMENT_SAGE_PAY_SERVER_TRANSACTION_ORDER_STATUS_ID')) { $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Sage Pay [Transactions]' limit 1"); if (tep_db_num_rows($check_query) < 1) { $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); $status = tep_db_fetch_array($status_query); $status_id = $status['status_id'] + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Sage Pay [Transactions]')"); } $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); if (tep_db_num_rows($flags_query) == 1) { tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); } } else { $check = tep_db_fetch_array($check_query); $status_id = $check['orders_status_id']; } } else { $status_id = MODULE_PAYMENT_SAGE_PAY_SERVER_TRANSACTION_ORDER_STATUS_ID; } $params = array('MODULE_PAYMENT_SAGE_PAY_SERVER_STATUS' => array('title' => 'Enable Sage Pay Server Module', 'desc' => 'Do you want to accept Sage Pay Server payments?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_SERVER_VENDOR_LOGIN_NAME' => array('title' => 'Vendor Login Name', 'desc' => 'The vendor login name to connect to the gateway with.'), 'MODULE_PAYMENT_SAGE_PAY_SERVER_PROFILE_PAGE' => array('title' => 'Profile Payment Page', 'desc' => 'Profile page to use for the payment page, Normal is a full redirect to Sage Pay and Low loads through an iframe.', 'value' => 'Normal', 'set_func' => 'tep_cfg_select_option(array(\'Normal\', \'Low\'), '), 'MODULE_PAYMENT_SAGE_PAY_SERVER_TRANSACTION_METHOD' => array('title' => 'Transaction Method', 'desc' => 'The processing method to use for each transaction.', 'value' => 'Authenticate', 'set_func' => 'tep_cfg_select_option(array(\'Authenticate\', \'Deferred\', \'Payment\'), '), 'MODULE_PAYMENT_SAGE_PAY_SERVER_ORDER_STATUS_ID' => array('title' => 'Set Order Status', 'desc' => 'Set the status of orders made with this payment module to this value', 'value' => '0', 'use_func' => 'tep_get_order_status_name', 'set_func' => 'tep_cfg_pull_down_order_statuses('), 'MODULE_PAYMENT_SAGE_PAY_SERVER_TRANSACTION_ORDER_STATUS_ID' => array('title' => 'Transaction Order Status', 'desc' => 'Include transaction information in this order status level', 'value' => $status_id, 'set_func' => 'tep_cfg_pull_down_order_statuses(', 'use_func' => 'tep_get_order_status_name'), 'MODULE_PAYMENT_SAGE_PAY_SERVER_ZONE' => array('title' => 'Payment Zone', 'desc' => 'If a zone is selected, only enable this payment method for that zone.', 'value' => '0', 'use_func' => 'tep_get_zone_class_title', 'set_func' => 'tep_cfg_pull_down_zone_classes('), 'MODULE_PAYMENT_SAGE_PAY_SERVER_TRANSACTION_SERVER' => array('title' => 'Transaction Server', 'desc' => 'Perform transactions on the production server or on the testing server.', 'value' => 'Live', 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Test\'), '), 'MODULE_PAYMENT_SAGE_PAY_SERVER_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', 'desc' => 'Verify transaction server SSL certificate on connection?', 'value' => 'True', 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), 'MODULE_PAYMENT_SAGE_PAY_SERVER_PROXY' => array('title' => 'Proxy Server', 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), 'MODULE_PAYMENT_SAGE_PAY_SERVER_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), 'MODULE_PAYMENT_SAGE_PAY_SERVER_SORT_ORDER' => array('title' => 'Sort order of display.', 'desc' => 'Sort order of display. Lowest is displayed first.', 'value' => '0')); return $params; }