本文整理汇总了PHP中fn_strtolower函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_strtolower函数的具体用法?PHP fn_strtolower怎么用?PHP fn_strtolower使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_strtolower函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateName
/**
* Checks if file with this name is already exist and generate new name if it is so
*
* @param string $file path to file
* @return string unique file name
*/
public function generateName($file)
{
$info = fn_pathinfo($file);
while ($this->isExist($file)) {
$info['filename'] .= '_' . fn_strtolower(fn_generate_code('', $this->_file_suffix_length));
$file = $info['dirname'] . '/' . $info['filename'] . '.' . $info['extension'];
}
return $file;
}
示例2: _generateName
/**
* Checks if file with this name is already exist and generate new name if it is so
*
* @param string $file path to file
* @return string unique file name
*/
protected function _generateName($file)
{
if ($this->isExist($file)) {
$parts = explode('.', $file);
$parts[0] .= '_' . fn_strtolower(fn_generate_code('', $this->_file_suffix_length));
$file = implode('.', $parts);
}
return $file;
}
示例3: WAGetCities
public static function WAGetCities($location)
{
$city_name = $location['city'];
$url = self::$url;
if (!empty($location['country'])) {
$country_name = fn_get_country_name($location['country'], 'ru');
} else {
$country_name = '';
}
$data = <<<EOT
<root xmlns="http://spsr.ru/webapi/Info/GetCities/1.0">
<p:Params Name="WAGetCities" Ver="1.0" xmlns:p="http://spsr.ru/webapi/WA/1.0" />
<GetCities CityName="{$city_name}" CountryName="{$country_name}"/>
</root>
EOT;
$response = Http::post($url, $data, self::$extra);
$xml = simplexml_load_string($response);
$return = false;
$status_code = (string) $xml->Result['RC'];
if ($status_code != 0) {
self::$last_error = !empty(self::$_error_descriptions[$status_code]) ? self::$_error_descriptions[$status_code] : __("shippings.spsr.error_city");
} else {
if (isset($xml->City->Cities) && !empty($xml->City)) {
$return = array();
$city_name = fn_strtolower($city_name);
foreach ($xml->City->Cities as $city) {
$spsr_city = fn_strtolower((string) $city['CityName']);
if ($spsr_city == $city_name) {
$return = self::attributesToArray($city);
}
}
}
}
if (empty($return)) {
self::$last_error = __("shipping.sdek.not_city");
}
return $return;
}
示例4: md5
$post['transactionAmount'] = $order_info['total'];
// Payment Params
$post['paymentCardName'] = $order_info['payment_info']['cardholder_name'];
$post['paymentCardNumber'] = $order_info['payment_info']['card_number'];
$post['paymentCardExpiry'] = $order_info['payment_info']['expiry_month'] . $order_info['payment_info']['expiry_year'];
$post['paymentCardCSC'] = $order_info['payment_info']['cvv2'];
// Customer Params
$post['customerName'] = $order_info['b_firstname'] . ' ' . $order_info['b_lastname'];
$post['customerCountry'] = $order_info['b_country'];
$post['customerState'] = $order_info['b_state_descr'];
$post['customerCity'] = $order_info['b_city'];
$post['customerAddress'] = $order_info['b_address'] . (!empty($order_info['b_address_2']) ? ' ; ' . $order_info['b_address_2'] : '');
$post['customerPostCode'] = $order_info['b_zipcode'];
$post['customerIP'] = $_SERVER['REMOTE_ADDR'];
//Transaction Hash
$post['hash'] = md5(fn_strtolower($passPhrase . $processor_data['processor_params']['merchant_id'] . $order_info['total'] . $processor_data['processor_params']['currency']));
// Post a request and analyse the response
Registry::set('log_cut_data', array('paymentCardName', 'paymentCardNumber', 'paymentCardExpiry', 'paymentCardCSC'));
$response_data = Http::post($post_address, $post);
if (!empty($response_data)) {
// Parse the XML
$xml = simplexml_load_string($response_data);
// Convert the result from a SimpleXMLObject into an array
$xml = (array) $xml;
// Validate the response - the only successful code is 0
$status = (int) $xml['responseCode'] === 0 ? 'P' : 'F';
// Pass TRN Status, Id and Response
$pp_response = array('order_status' => $status, 'transaction_id' => isset($xml['transactionID']) ? $xml['transactionID'] : null, 'reason_text' => ($pos = strpos($xml['responseMessage'], ':')) === false ? $xml['responseMessage'] : substr($xml['responseMessage'], $pos + 1));
} else {
// Invalid response
$pp_response = array('order_status' => 'F', 'transaction_id' => null, 'reason_text' => 'API response invalid.');
示例5: array
}
$width = !empty($_REQUEST['width']) ? $_REQUEST['width'] : BCD_DEFAULT_WIDTH;
$height = !empty($_REQUEST['height']) ? $_REQUEST['height'] : BCD_DEFAULT_HEIGHT;
$id = !empty($_REQUEST['id']) ? $_REQUEST['id'] : '';
$type = !empty($_REQUEST['type']) ? $_REQUEST['type'] : '';
$xres = 1;
$font = 3;
$prefix = 'spsr';
$objects = array('I25' => 'I25Object', 'C39' => 'C39Object', 'C128A' => 'C128AObject', 'C128B' => 'C128BObject', 'C128C' => 'C128CObject');
$numeric_objects = array('I25' => true, 'C128C' => true);
if (!empty($objects[$type])) {
if (!empty($numeric_objects[$type]) && !is_numeric($prefix)) {
$prefix = '';
}
$code = $prefix . $id;
require Registry::get('config.dir.addons') . 'barcode/lib/barcodegenerator/' . fn_strtolower($objects[$type]) . '.php';
$obj = new $objects[$type]($width, $height, $style, $code);
if ($obj) {
$obj->SetFont($font);
$obj->DrawObject($xres);
$obj->FlushObject();
$obj->DestroyObject();
unset($obj);
}
} else {
__DEBUG__("Need bar code type ex. C39");
}
exit;
}
function fn_spsr_pre_check_invoice_create($order_id, $section, $spsr_shipments = array())
{
示例6: fn_set_notification
fn_set_notification('N', __('notice'), __('text_directory_created', array('[directory]' => fn_basename($folder_path))));
} else {
fn_set_notification('E', __('error'), __('text_cannot_create_directory', array('[directory]' => fn_basename($folder_path))));
}
return array(CONTROLLER_STATUS_REDIRECT, 'templates.init_view?dir=' . $_REQUEST['file_path']);
} elseif ($mode == 'get_file') {
$pname = fn_te_normalize_path($_REQUEST, $root_dir);
if (fn_te_check_path($pname)) {
if (is_file($pname) && !in_array(fn_strtolower(fn_get_file_ext($pname)), Registry::get('config.forbidden_file_extensions'))) {
fn_get_file($pname);
}
}
exit;
} elseif ($mode == 'edit') {
$fname = fn_te_normalize_path($_REQUEST, $root_dir);
if (fn_te_check_path($fname) && !in_array(fn_strtolower(fn_get_file_ext($fname)), Registry::get('config.forbidden_file_extensions'))) {
Tygh::$app['ajax']->assign('content', fn_get_contents($fname));
} else {
fn_set_notification('E', __('error'), __('you_have_no_permissions'));
}
exit;
} elseif ($mode == 'restore') {
$copied = false;
$file_path = fn_te_normalize_path($_REQUEST, $root_dir);
if (fn_te_check_path($file_path)) {
$repo_path = str_replace($root_dir, fn_te_get_root('repo'), $file_path);
if (!file_exists($repo_path) && fn_get_theme_path('[theme]') != Registry::get('config.base_theme') && is_dir(fn_get_theme_path('[repo]/[theme]'))) {
$repo_path = preg_replace("/\\/themes_repository\\/(\\w+)\\//", "/themes_repository/" . Registry::get('config.base_theme') . "/", $repo_path);
}
$object_base = is_file($repo_path) ? 'file' : (is_dir($repo_path) ? 'directory' : '');
if (!empty($object_base) && fn_copy($repo_path, $file_path)) {
示例7: _generateAdditionalCacheLevel
/**
* Generates additional cache levels by storage
*
* @param array $cache_scheme Block cache scheme
* @param string $handler_name Name of handlers frocm block scheme
* @param array $storage Storage to find params
* @return string Additional chache level
*/
private static function _generateAdditionalCacheLevel($cache_scheme, $handler_name, $storage)
{
$additional_level = '';
if (!empty($cache_scheme[$handler_name]) && is_array($cache_scheme[$handler_name])) {
foreach ($cache_scheme[$handler_name] as $param) {
$param = fn_strtolower(str_replace('%', '', $param));
if (isset($storage[$param])) {
$additional_level .= '|' . $param . '=' . md5(serialize($storage[$param]));
}
}
}
return $additional_level;
}
示例8: fn_get_theme_path
$full_path = fn_get_theme_path('[themes]/[theme]', 'C') . '/templates/' . $_REQUEST['file'];
if (fn_check_path($full_path)) {
$c_name = fn_normalize_path($full_path);
$r_name = fn_normalize_path(Registry::get('config.dir.themes_repository') . Registry::get('config.base_theme') . '/templates/' . $_REQUEST['file']);
if (is_file($r_name)) {
$copied = fn_copy($r_name, $c_name);
}
if ($copied) {
fn_set_notification('N', __('notice'), __('text_file_restored', array('[file]' => fn_basename($_REQUEST['file']))));
} else {
fn_set_notification('E', __('error'), __('text_cannot_restore_file', array('[file]' => fn_basename($_REQUEST['file']))));
}
if ($copied) {
if (defined('AJAX_REQUEST')) {
Registry::get('ajax')->assign('force_redirection', fn_url($_REQUEST['current_url']));
Registry::get('ajax')->assign('non_ajax_notifications', true);
}
return array(CONTROLLER_STATUS_OK, $_REQUEST['current_url']);
}
}
exit;
}
}
if ($mode == 'get_content') {
$ext = fn_strtolower(fn_get_file_ext($_REQUEST['file']));
if ($ext == 'tpl') {
$theme_path = fn_get_theme_path('[themes]/[theme]/templates/', 'C');
Registry::get('ajax')->assign('content', fn_get_contents($_REQUEST['file'], $theme_path));
}
exit;
}
示例9: fn_filter_uploaded_data
/**
* Filter data from file uploader
*
* @param string $name
* @return array $filtered
*/
function fn_filter_uploaded_data($name, $filter_by_ext = array())
{
$udata_local = fn_rebuild_files('file_' . $name);
$udata_other = !empty($_REQUEST['file_' . $name]) ? $_REQUEST['file_' . $name] : array();
$utype = !empty($_REQUEST['type_' . $name]) ? $_REQUEST['type_' . $name] : array();
//var_dump($name);echo"<br/>";
// if($name=='p_feature_var_extra_image_detailed'){
// var_dump($utype);die();
// }
if (empty($utype)) {
return array();
}
$filtered = array();
foreach ($utype as $id => $type) {
if ($type == 'local' && !fn_is_empty(@$udata_local[$id])) {
$filtered[$id] = fn_get_local_data(Bootstrap::stripSlashes($udata_local[$id]));
} elseif ($type == 'server' && !fn_is_empty(@$udata_other[$id]) && AREA == 'A') {
fn_get_last_key($udata_other[$id], 'fn_get_server_data', true);
$filtered[$id] = $udata_other[$id];
} elseif ($type == 'url' && !fn_is_empty(@$udata_other[$id])) {
fn_get_last_key($udata_other[$id], 'fn_get_url_data', true);
$filtered[$id] = $udata_other[$id];
}
if (isset($filtered[$id]) && $filtered[$id] === false) {
unset($filtered[$id]);
fn_set_notification('E', __('error'), __('cant_upload_file'));
}
if (!empty($filtered[$id]) && is_array($filtered[$id]) && !empty($filtered[$id]['name'])) {
$filtered[$id]['name'] = str_replace(' ', '_', urldecode($filtered[$id]['name']));
// replace spaces with underscores
$ext = fn_get_file_ext($filtered[$id]['name']);
if (!empty($filter_by_ext) && !in_array(fn_strtolower($ext), $filter_by_ext)) {
unset($filtered[$id]);
fn_set_notification('E', __('error'), __('text_not_allowed_to_upload_file_extension', array('[ext]' => $ext)));
} elseif (in_array(fn_strtolower($ext), Registry::get('config.forbidden_file_extensions'))) {
unset($filtered[$id]);
fn_set_notification('E', __('error'), __('text_forbidden_file_extension', array('[ext]' => $ext)));
}
}
if (!empty($filtered[$id]['path']) && in_array(fn_get_mime_content_type($filtered[$id]['path'], true, 'text/plain'), Registry::get('config.forbidden_mime_types'))) {
fn_set_notification('E', __('error'), __('text_forbidden_file_mime', array('[mime]' => fn_get_mime_content_type($filtered[$id]['path'], true, 'text/plain'))));
unset($filtered[$id]);
}
}
static $shutdown_inited;
if (!$shutdown_inited) {
$shutdown_inited = true;
register_shutdown_function('fn_remove_temp_data');
}
return $filtered;
}
示例10: fn_set_notification
fn_set_notification('N', __('notice'), __('text_permissions_changed'));
} else {
fn_set_notification('E', __('error'), __('error_permissions_not_changed'));
}
return array(CONTROLLER_STATUS_REDIRECT, 'file_editor.init_view?dir=' . $_REQUEST['file_path']);
} elseif ($mode == 'get_file') {
$pname = fn_te_normalize_path($_REQUEST, $section_root_dir);
if (fn_te_check_path($pname, $_SESSION['active_section'])) {
if (is_file($pname) && !in_array(fn_strtolower(fn_get_file_ext($pname)), Registry::get('config.forbidden_file_extensions'))) {
fn_get_file($pname);
}
}
exit;
} elseif ($mode == 'edit') {
$fname = fn_te_normalize_path($_REQUEST, $section_root_dir);
if (fn_te_check_path($fname, $_SESSION['active_section']) && !in_array(fn_strtolower(fn_get_file_ext($fname)), Registry::get('config.forbidden_file_extensions'))) {
Registry::get('ajax')->assign('content', fn_get_contents($fname));
} else {
fn_set_notification('E', __('error'), __('you_have_no_permissions'));
}
exit;
} elseif ($mode == 'restore') {
$copied = false;
$file_path = fn_te_normalize_path($_REQUEST, $section_root_dir);
if (fn_te_check_path($file_path, $_SESSION['active_section'])) {
$repo_path = str_replace($section_root_dir, fn_te_get_root('repo'), $file_path);
if (!file_exists($repo_path) && fn_get_theme_path('[theme]') != Registry::get('config.base_theme') && is_dir(fn_get_theme_path('[repo]/[theme]'))) {
$repo_path = preg_replace("/\\/themes_repository\\/(\\w+)\\//", "/themes_repository/" . Registry::get('config.base_theme') . "/", $repo_path);
}
$object_base = is_file($repo_path) ? 'file' : (is_dir($repo_path) ? 'directory' : '');
if (!empty($object_base) && fn_copy($repo_path, $file_path)) {
示例11: db_get_field
* PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. *
****************************************************************************/
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
require './init_payment.php';
$order_id = (int) $_REQUEST['order_id'];
if (!empty($_REQUEST['payer_merchant_reference_id']) || !empty($_REQUEST['payer_callback_type']) && $_REQUEST['payer_callback_type'] == 'settle') {
// Settle data is received
$payment_id = db_get_field("SELECT payment_id FROM ?:orders WHERE order_id = ?i", $order_id);
$processor_data = fn_get_payment_method_data($payment_id);
$order_info = fn_get_order_info($order_id);
if ($order_info['status'] == 'N' || $order_info['status'] == 'O') {
$pp_response = array();
$req_url = ($_SERVER['SERVER_PORT'] == '80' ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$ok1 = fn_strtolower($_REQUEST['md5sum']) == fn_strtolower(md5($processor_data['processor_params']['key_1'] . substr($req_url, 0, strpos($req_url, '&md5sum')) . $processor_data['processor_params']['key_2']));
$valid_ips = array('217.151.207.84', '79.136.103.5', '79.136.103.9', '94.140.57.180', '94.140.57.184', '192.168.100.1');
$ok2 = in_array($_SERVER['REMOTE_ADDR'], $valid_ips);
$pp_response['order_status'] = $ok1 && $ok2 ? 'P' : 'F';
$pp_response['reason_text'] = __('order_id') . '-' . $order_id;
$pp_response['transaction_id'] = !empty($_REQUEST['payread_payment_id']) ? $_REQUEST['payread_payment_id'] : 'BANK';
fn_finish_payment($order_id, $pp_response);
}
echo "TRUE";
exit;
} else {
// Customer is redirected from the Pay&Read server
// Check if the settle data was recieved and order status was upsated otherwise transaction is failed
$order_info = fn_get_order_info($order_id);
if ($order_info['status'] == 'N' || $order_info['status'] == 'O') {
$pp_response = array();
示例12: fn_init_ua
/**
* Detect user agent
*
* @return boolean true always
*/
function fn_init_ua()
{
static $crawlers = array('google', 'bot', 'yahoo', 'spider', 'archiver', 'curl', 'python', 'nambu', 'Twitterbot', 'perl', 'sphere', 'PEAR', 'java', 'wordpress', 'radian', 'crawl', 'yandex', 'eventbox', 'monitor', 'mechanize', 'facebookexternal');
$http_ua = fn_strtolower($_SERVER['HTTP_USER_AGENT']);
if (strpos($http_ua, 'shiretoko') !== false || strpos($http_ua, 'firefox') !== false) {
$ua = 'firefox';
} elseif (strpos($http_ua, 'chrome') !== false) {
$ua = 'chrome';
} elseif (strpos($http_ua, 'safari') !== false) {
$ua = 'safari';
} elseif (strpos($http_ua, 'opera') !== false) {
$ua = 'opera';
} elseif (strpos($http_ua, 'msie') !== false || strpos($http_ua, 'trident/7.0; rv:11.0') !== false) {
// IE11 does not send normal headers and seems like Mozilla:
// Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko
$ua = 'ie';
if (preg_match("/msie (6|7|8)/i", $http_ua)) {
Registry::set('runtime.unsupported_browser', true);
}
} elseif (preg_match('/(' . implode('|', $crawlers) . ')/', $http_ua, $m)) {
$ua = 'crawler';
fn_define('CRAWLER', $m[1]);
fn_define('NO_SESSION', true);
// do not start session for crawler
} else {
$ua = 'unknown';
}
fn_define('USER_AGENT', $ua);
return array(INIT_STATUS_OK);
}
示例13: fn_clone_table_data
function fn_clone_table_data($table_data, $clone_data, $start, $from, $to, $extra = array())
{
static $schema;
static $cloned_ids = array();
$clone_id = $table_data['name'];
if (!isset($cloned_ids[$clone_id])) {
$cloned_ids[$clone_id] = array();
}
if (empty($schema)) {
$schema = fn_init_clone_schemas();
}
$limit = 50;
// Clone 50 lines per one iteration
$return = array();
$condition = '';
if (!empty($table_data['condition'])) {
$condition = ' AND ' . implode(' AND ', $table_data['condition']);
preg_match_all('/%(.*?)%/', $condition, $variables);
foreach ($variables[1] as $variable) {
$variable = fn_strtolower($variable);
$var = ${$variable};
if (is_array($var)) {
$var = implode(', ', $var);
}
$condition = preg_replace('/%(.*?)%/', $var, $condition, 1);
}
}
if (!empty($table_data['dependence_tree'])) {
$ids = fn_build_dependence_tree($table_data['name'], $table_data['key'], $parent = 'parent_id', $from);
$data = $_data = array();
if (!empty($ids)) {
$_data = db_get_hash_array('SELECT * FROM ?:' . $table_data['name'] . ' WHERE company_id = ?i ' . $condition . 'AND ' . $table_data['key'] . ' IN (?a)', $table_data['key'], $from, $ids);
}
foreach ($ids as $id) {
if (isset($_data[$id])) {
$data[] = $_data[$id];
}
}
unset($_data, $ids);
$start = db_get_field('SELECT COUNT(*) FROM ?:' . $table_data['name'] . ' WHERE company_id = ?i', $from);
} elseif (empty($clone_data)) {
$data = db_get_array('SELECT * FROM ?:' . $table_data['name'] . ' WHERE company_id = ?i ' . $condition . ' LIMIT ?i, ?i', $from, $start, $limit);
} else {
$data = db_get_array('SELECT * FROM ?:' . $table_data['name'] . ' WHERE ' . $table_data['key'] . ' IN (?a)' . $condition, array_keys($clone_data));
}
if (!empty($data)) {
// We using sharing. So do not use "quick" insert schema...
if (false && empty($table_data['children']) && empty($table_data['pre_process']) && empty($table_data['post_process']) && empty($table_data['return_clone_data'])) {
$exclude = array(empty($clone_data) ? $table_data['key'] : '');
if (!empty($table_data['exclude'])) {
$exclude = array_merge($exclude, $table_data['exclude']);
}
$fields = fn_get_table_fields($table_data['name'], $exclude, true);
$query = 'REPLACE INTO ?:' . $table_data['name'] . ' (' . implode(',', $fields) . ') VALUES ';
$rows = array();
foreach ($data as $row) {
if (empty($clone_data)) {
unset($row[$table_data['key']]);
} else {
$row[$table_data['key']] = $clone_data[$row[$table_data['key']]];
}
if (!empty($extra)) {
foreach ($extra as $field => $field_data) {
if (isset($field_data[$row[$field]])) {
$row[$field] = $field_data[$row[$field]];
}
}
}
if (isset($row['company_id'])) {
$row['company_id'] = $to;
}
if (!empty($table_data['exclude'])) {
foreach ($table_data['exclude'] as $exclude_field) {
unset($row[$exclude_field]);
}
}
$row = explode('(###)', addslashes(implode('(###)', $row)));
$rows[] = "('" . implode("', '", $row) . "')";
}
$query .= implode(', ', $rows);
db_query($query);
} else {
foreach ($data as $id => $row) {
if (!empty($table_data['key'])) {
$key = $row[$table_data['key']];
if (empty($clone_data)) {
unset($row[$table_data['key']]);
} else {
$row[$table_data['key']] = $clone_data[$row[$table_data['key']]];
}
}
if (isset($row['company_id'])) {
$row['company_id'] = $to;
}
if (!empty($extra)) {
foreach ($extra as $field => $field_data) {
if (isset($field_data[$row[$field]])) {
$row[$field] = $field_data[$row[$field]];
}
}
//.........这里部分代码省略.........
示例14: fn_finish_payment
$pp_response["reason_text"] = "CpiResultsCode: " . $_REQUEST['CpiResultsCode'];
} else {
$pp_response["order_status"] = "F";
$pp_response["reason_text"] = $hsbc_errors[$_REQUEST['CpiResultsCode']];
}
$order_id = $_REQUEST['OrderId'];
if (fn_check_payment_script('hsbc.php', $order_id)) {
fn_finish_payment($order_id, $pp_response, false);
fn_order_placement_routines('route', $order_id);
}
exit;
}
} else {
$hashkey = $processor_data['processor_params']['cpihashkey'];
$post_data = array("CpiDirectResultUrl" => fn_url("payment_notification.notify?payment=hsbc&order_id={$order_id}", AREA, 'https'), "CpiReturnUrl" => fn_url("payment_notification.invoice?payment=hsbc&order_id={$order_id}", AREA, 'https'), "MerchantData" => "ORDER " . $order_id, "Mode" => $processor_data['processor_params']['mode'], "OrderDesc" => "ORDER " . $order_id . ($order_info['repaid'] ? '_' . $order_info['repaid'] : ''), "OrderId" => $order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id, "PurchaseAmount" => $order_info['total'] * ($processor_data['processor_params']['currency'] != '392' ? 100 : 1), "PurchaseCurrency" => $processor_data['processor_params']['currency'], "StorefrontId" => $processor_data['processor_params']['store_id'], "TimeStamp" => time() . "000", "TransactionType" => "Capture", "UserId" => $order_info['firstname'] . " " . $order_info['lastname'], "BillingAddress1" => str_replace('\\n', '', $order_info['b_address']), "BillingCity" => $order_info['b_city'], "BillingCountry" => db_get_field("SELECT code_N3 FROM ?:countries WHERE code = ?s", $order_info['b_country']), "BillingCounty" => $order_info['b_state'] ? $order_info['b_state'] : 'n/a', "BillingFirstName" => $order_info['b_firstname'], "BillingLastName" => $order_info['b_lastname'], "BillingPostal" => $order_info['b_zipcode'], "ShopperEmail" => $order_info['email'], "ShippingAddress1" => str_replace('\\n', '', $order_info['s_address']), "ShippingCity" => $order_info['s_city'], "ShippingCountry" => db_get_field("SELECT code_N3 FROM ?:countries WHERE code = ?s", $order_info['s_country']), "ShippingCounty" => $order_info['s_state'] ? $order_info['s_state'] : 'n/a', "ShippingFirstName" => $order_info['s_firstname'], "ShippingLastName" => $order_info['s_lastname'], "ShippingPostal" => $order_info['s_zipcode']);
$_current_os = fn_strtolower(substr(PHP_OS, 0, 3));
$post_data_line = escapeshellarg(implode("\" \"", $post_data));
// Generate Hash
if ($_current_os == 'win') {
@exec('PATH ' . Registry::get('config.dir.payments') . 'hsbc_files/lib/' . $_current_os);
@exec(Registry::get('config.dir.payments') . 'hsbc_files/modules/' . $_current_os . '/TestHash.exe ' . $hashkey . " \"" . $post_data_line . "\"", $data);
} elseif ($_current_os == 'sun') {
putenv("LD_LIBRARY_PATH=" . Registry::get('config.dir.payments') . "hsbc_files/lib/{$_current_os}");
@exec(Registry::get('config.dir.payments') . "hsbc_files/modules/{$_current_os}/TestHash.e " . $hashkey . " \"" . $post_data_line . "\"", $data);
} elseif ($_current_os == 'lin') {
putenv("LD_LIBRARY_PATH=" . Registry::get('config.dir.payments') . "hsbc_files/lib/{$_current_os}");
@exec(Registry::get('config.dir.payments') . "hsbc_files/modules/{$_current_os}/TestHash.e " . $hashkey . " \"" . $post_data_line . "\"", $data);
}
if (!preg_match("/^Hash value: (.*)\$/", @$data[0], $a)) {
//Set notification
fn_set_notification('E', __('error'), __('error_hash_generation'));
示例15: fn_payjunction_response_val
function fn_payjunction_response_val($key, $response)
{
$processor_response = array("avs" => array("AWZ" => "Match Address OR Zip", "XY" => "Match Address AND Zip", "WZ" => "Match Zip", "AW" => "Match Address OR 9 Digit Zip", "AZ" => "Match Address OR 5 Digit Zip", "A" => "Match Address", "X" => "Match Address AND 9 Digit Zip", "Y" => "Match Address AND 5 Digit Zip", "W" => "Match 9 Digit Zip", "Z" => "Match 5 Digit Zip"), "cvv" => array("M" => "CVV On", "I" => "CVV Off"), "preauth" => array("true" => "Pre-auth On", "false" => "Pre-auth Off"), "avsforce" => array("true" => "AVS Force On", "false" => "AVS Force Off"), "cvvforce" => array("true" => "CVV Force On", "false" => "CVV Force Off"));
$key_ = strtr(fn_strtolower($key), array(" " => "_"));
return $processor_response[$key_][$response[$key_]] ? $processor_response[$key_][$response[$key_]] : $key . " Code: " . $response[$key_];
}