public function createGateway($name, array $config = array())
    {
        if (!isset($this->gateways[$name])) {
            throw new CException(sprintf('Failed to create payment gateway "%s".', $name));
        }
        $config = CMap::mergeArray($this->gateways[$name], $config);
        $gateway = Yii::createComponent($config);
        $gateway->manager = $this;
        $gateway->init();
        return $gateway;
    }