@param array  $args
@param string $key
@param string $action

@return array
492383
protected function request(array $args, $key, $action)
    {
        $client = $this->getHttpClient();

        $response = $client->post('/v2/index.php', [
            'form_params' => $this->buildFormParams($args, $key, $action),
        ]);

        $contents = $response->getBody()->getContents();

        return $this->normalize($contents);
    }
1360835
public function args($key = array())
    {
        if (is_array($key)) {
            $args = array();
            if (!empty($key)) {
                foreach ($key as $k) $args[$k] = $this->args($k);
            } else {
                $args = $this->arguments;
            }
            return $args;
        } elseif (is_string($key) && !empty($key)) {
            return $this->$key;
        } else {
            return null;
        }
    }
790959
protected static function getParams(array $arg_params)
    {
        $return = array();
        //validate params
        $data = array(
            'amount',
            'transaction_id',
            'customer_id',
            'security_token',
            'customer_ip'
        );
        foreach ($data as $key) {
            if(!empty($arg_params[$key])){
                $return[$key] = $arg_params[$key];
            }
        }

        return $return;
    }
401895
protected function buildDestination($controller, $action, array $args = array())
    {
        if (!isset($this->reverseMapping[$controller][$action])) {
            throw new Exception("Route mapping not found for controller '{$controller}', action '{$action}'");
        }

        /**
         * @var Route\Mapping $mapping
         */
        $mapping = $this->reverseMapping[$controller][$action];
        $destinationPattern = $mapping->destinationPattern();
        foreach ($args as $argName => $argValue) {
            $destinationPattern = str_replace("{{$argName}}", $argValue, $destinationPattern, $count);
            if ($count < 1) {
                throw new Exception("Provided argument '{$argName}' doesn't match any URL wildcard");
            }
        }

        return $destinationPattern;
    }
716646
public function addColumn($key,$args = null)
    {
        if ($key instanceof Column) {
            $args = $key->getColumnArray();
            $key = $key->name;
        }
        if (array_key_exists($key,$this->columns))
            trigger_error(sprintf(self::TEXT_ColumnExists,$key),E_USER_ERROR);
        $column = new Column($key, $this);
        if ($args)
            foreach ($args as $arg => $val)
                $column->{$arg} = $val;
        // skip default pkey field
        if (count($this->pkeys) == 1 && in_array($key,$this->pkeys))
            return $column;
        return $this->columns[$key] =& $column;
    }
261175
protected function getKeyArguments($arguments)
    {
        $keys = [];
        foreach ($arguments as $argument) {
            if (is_array($argument)) {
                $keys = array_merge($keys, $this->getKeyArguments($argument));
            }
            if (is_string($argument)) {
                $keys = array_merge($keys, $this->parseKeysString($argument));
            }
        }

        return $keys;
    }
38211
protected function getActionArguments($action, $vars = array()) {
        $reflectionObject = new \ReflectionObject($this);
        $method = $reflectionObject->getMethod($action);
        $parameters = $method->getParameters();
        $arguments = array();
        foreach ($parameters as $param) {
            $name = $param->getName();
            if (array_key_exists($name, $vars)) {
                $arguments[] = $this->parseParameter($vars[$name], $param);
                continue;
            }
            $value = $this->setActionArguments($name);

            if (!is_null($value)){
                $arguments[] = $this->parseParameter($value, $param);
                continue;
            }
            if ($param->isDefaultValueAvailable()) {
                $arguments[] = $param->getDefaultValue();
                continue;
            }
            throw new Exception(sprintf(
                __('%s ACTION`S %s DOES NOT HAVE VALUE!'), $action, $name));
        }
        return $arguments;
    }
837031
public function args($key = 0) {
		if (!empty($this->args[$key])) {
			return $this->args[$key];
		}
		return null;
	}
698882
public function __lang($key, ...$args)
    {
        $string = array_key_exists($key, $this->messages_dictionary) ? $this->messages_dictionary[$key] : $key;
        return (func_num_args() > 1) ? vsprintf($string, $args) : $string;
    }
257828
public function t(string $key, array $args = [], $lang = '')
    {
        return $this->translate($key, $args, $lang);
    }
621901
protected function processRegistry($action, Registry $registry, $id, array $output, array $args = array())
    {
        try {

            $output[$id] = call_user_func_array(array($registry, $action), $args);

        } catch (RegistryException $e) {

            $this->errors[$id] = $e;
        }

        return $output;
    }
920339
public function action($mode, $args = [])
    {
        if (!$this->persistence) {
            throw new Exception(['action() requires model to be associated with db']);
        }

        if (!$this->persistence->hasMethod('action')) {
            throw new Exception('Persistence does not support action()');
        }

        return $this->persistence->action($this, $mode, $args);
    }
453558
public function forward($notation, array $args = array())
    {
        $data = $this->mapManager->toCompliant($notation);

        $controller = array_keys($data);
        $controller = $controller[0];

        $action = array_values($data);
        $action = $action[0];

        return $this->call($controller, $action, $args);
    }
594477
protected function processActionArgs(array $args, $jsonArgs = [], $jsonHelper = null, $transArgs = [], $transHelper = null, $currentPath = '')
    {
        $jsonHelper = ((!is_null($jsonHelper) && method_exists($jsonHelper, 'jsonDecode')) ? $jsonHelper : Mage::helper('core'));
        $transHelper = ((!is_null($transHelper) && method_exists($transHelper, '__')) ? $transHelper : Mage::helper('core'));

        foreach ($args as $key => $arg) {
            $path = $currentPath . $key;
            if ($arg instanceof Mage_Core_Model_Layout_Element) {
                // Process depth-first
                if ($arg->hasChildren()) {
                    $children = $this->processActionArgs((array)$arg->children(), $jsonArgs, $jsonHelper, $transArgs, $transHelper, $path . '.');
                }

                // Attempt to process helpers
                if (isset($children)) {
                    $tempArg = $children;
                } else {
                    $tempArg = (string)$arg;
                }

                if (isset($arg['helper'])) {
                    $args[$key] = $this->getHelperMethodValue($arg['helper'], $tempArg);
                } else {
                    $args[$key] = $tempArg;
                }

                unset($children);
            }

            if (is_string($args[$key]) && in_array($path, $jsonArgs)) {
                $args[$key] = $jsonHelper->jsonDecode($args[$key]);
            }

            if (in_array($path, $transArgs)) {
                if (is_string($args[$key])) {
                    $args[$key] = $transHelper->__($args[$key]);
                } else {
                    $args[$key] = call_user_func_array([$transHelper, '__'], $args[$key]);
                }
            }
        }

        return $args;
    }
196001
private function getConfig($key = null, $args = null)
    {
        if($key!=null) {

            $value = null;
            if(isset($this->_config[$key])) {
                $value = $this->_config[$key];

            } elseif(isset($this->_updateConfig[$key])) {
                    $value = $this->_updateConfig[$key];

            }

            if (isset($args["returnAsArray"]) && $args["returnAsArray"]){

                /** Return the response as an array */
                if(is_array($value)){
                    return $value;
                }
                
            }elseif(is_array($value)) {
                /** @var CheckoutApi_Lib_RespondObj $to_return */
                $to_return = CheckoutApi_Lib_Factory::getInstance('CheckoutApi_Lib_RespondObj');
                $to_return->setConfig( $value);
                return $to_return;
            }

            return $value;
        }

        if($key == null) {
            return $this->_config;
        }
        return null;
    }
740368
protected function getTtlAndKey(array &$args)/*# : array */
    {
        if (is_numeric($args[0])) {
            $ttl = (int) array_shift($args);
            $key = $this->generateKey($args);
        } else {
            $key = $this->generateKey($args);
            $ttl = $this->ttl;
        }
        return [$ttl, $key];
    }
1372078
protected function getPostActionRedirectArguments(array $args, $action)
    {
        $updateSelect = ('POST' == $this->request->getMethod())
            ? $this->request->request->get('contactsource[updateSelect]', false, true)
            : $this->request->get(
                'updateSelect',
                false
            );
        if ($updateSelect) {
            switch ($action) {
                case 'new':
                case 'edit':
                    $passthrough             = $args['passthroughVars'];
                    $passthrough             = array_merge(
                        $passthrough,
                        [
                            'updateSelect' => $updateSelect,
                            'id'           => $args['entity']->getId(),
                            'name'         => $args['entity']->getName(),
                        ]
                    );
                    $args['passthroughVars'] = $passthrough;
                    break;
            }
        }

        return $args;
    }