public function setConfig($username, $password, $mid, $mode)
 {
     Obj2xml::$config->user = $username;
     Obj2xml::$config->password = $password;
     Obj2xml::$config->merchantId = $mid;
     Obj2xml::$config->url = UrlMapper::getUrl($mode);
 }
Exemple #2
0
function initialize()
{
    $line = array();
    $merchantArray = array();
    $handle = @fopen('./litle_SDK_config.ini', "w");
    if ($handle) {
        print "Welcome to Litle PHP_SDK" . PHP_EOL;
        print "Please input your user name: ";
        $line['user'] = trim(fgets(STDIN));
        print "Please input your password: "******"Please input your merchantId: ";
        $line['currency_merchant_map ']['DEFAULT'] = trim(fgets(STDIN));
        print "Please choose Litle url from the following list (example: 'sandbox') or directly input another URL: \nsandbox => https://www.testlitle.com/sandbox/communicator/online \npostlive => https://postlive.litle.com/vap/communicator/online \ntransact-postlive => https://transact-postlive.litle.com/vap/communicator/online \nproduction => https://payments.litle.com/vap/communicator/online \nproduction-transact => https://transact.litle.com/vap/communicator/online \nprelive => https://prelive.litle.com/vap/communicator/online \ntransact-prelive => https://transact-prelive.litle.com/vap/communicator/online" . PHP_EOL;
        $url = UrlMapper::getUrl(trim(fgets(STDIN)));
        $line['url'] = $url;
        print "Please input the proxy, if no proxy hit enter key: ";
        $line['proxy'] = trim(fgets(STDIN));
        print "Batch processing saves files to disk. \n";
        print "Please input a directory to save these files. If you are not using batch processing, you may hit enter. ";
        $dir = trim(fgets(STDIN));
        $line['batch_requests_path'] = $dir;
        $line['litle_requests_path'] = $dir;
        print "Please input your SFTP username. If you are not using SFTP, you may hit enter. ";
        $line['sftp_username'] = trim(fgets(STDIN));
        print "Please input your SFTP password. If you are not using SFTP, you may hit enter. ";
        $line['sftp_password'] = trim(fgets(STDIN));
        print "Please input the URL for batch processing. If you are not using batch processing, you may hit enter. ";
        $line['batch_url'] = trim(fgets(STDIN));
        print "Please input the port for stream batch delivery. If you are not using stream batch delivery, you may hit enter. ";
        $line['tcp_port'] = trim(fgets(STDIN));
        print "Please input the timeout (in seconds) for stream batch delivery. If you are not using stream batch delivery, you may hit enter. ";
        $line['tcp_timeout'] = trim(fgets(STDIN));
        # ssl should be usd by default
        $line['tcp_ssl'] = '1';
        $line['print_xml'] = '0';
        writeConfig($line, $handle);
        fwrite($handle, "timeout =  65" . PHP_EOL);
        fwrite($handle, "reportGroup = Default Report Group" . PHP_EOL);
    }
    fclose($handle);
    print "The Litle configuration file has been generated, the file is located in the lib directory" . PHP_EOL;
}
Exemple #3
0
<?php

require_once "includes/FrameworkUtility.php";
require_once "includes/UrlMapper.php";
ControllerLoader::loadControllers();
$requestUri = $_SERVER['REQUEST_URI'];
$queryString = $_SERVER['QUERY_STRING'];
$action = FrameworkUtility::getAction($requestUri);
$queryStringArray = FrameworkUtility::parseQueryString($queryString);
$controller = "";
if (isset($action)) {
    $urlMapper = new UrlMapper();
    $controller = $urlMapper->getController($action, $queryStringArray);
} else {
    //Page not found
}
$objName = lcfirst($controller);
$objName = new $controller();
$objName->begin();
Exemple #4
0
 protected function _resolve()
 {
     $module = self::$_request->getParameter(MODULE_PARAM);
     $controller = self::$_request->getParameter(CONTROLLER_PARAM);
     // resolve url map if module and controller don't exist
     if (empty($module) && empty($controller)) {
         UrlMapper::getInfo(self::$_request->getRequest());
     }
 }
 public function merchantDataFromOC()
 {
     $hash = array('user' => $this->config->get('litle_merchant_user_name'), 'password' => $this->config->get('litle_merchant_password'), 'merchantId' => $this->config->get('litle_merchant_id'), 'reportGroup' => $this->config->get('litle_default_report_group'), 'url' => UrlMapper::getUrl(trim($this->config->get('litle_url'))), 'proxy' => $this->config->get('litle_proxy_value'), 'print_xml' => false, 'timeout' => $this->config->get('litle_timeout_value'));
     return $hash;
 }
Exemple #6
0
        mb_language(AppConfig::DEFAULT_LANGUAGE);
    } else {
        mb_language('uni');
    }
}
#Undo magic quotes (From http://www.php.net/manual/en/security.magicquotes.disabling.php#91653)
if (get_magic_quotes_gpc()) {
    function undo_magic_quotes(&$value, $key)
    {
        $value = stripslashes($value);
    }
    $gpc = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
    array_walk_recursive($gpc, 'undo_magic_quotes');
}
$plugin_manager = PluginManager::getInstance();
$url_mapper = new UrlMapper();
$context = $url_mapper->map($_SERVER['REQUEST_URI']);
if (!$context) {
    header("HTTP/1.1 400 Bad Request");
    @(include PHAXSI_ERROR_400);
    exit;
}
if (AppConfig::$language_redirect && !Lang::wasSet()) {
    $lang = Lang::autoDetect();
    RedirectHelper::to(UrlHelper::current($lang));
}
if (AppConfig::CUSTOM_ROUTER) {
    $router_name = Loader::includeApplicationClass(new Context('router', AppConfig::CUSTOM_ROUTER));
    if ($router_name) {
        $router = new $router_name();
    } else {