Пример #1
0
 public function init()
 {
     PaytureConfiguration::setEnvironment($this->paytureEnv);
     PaytureConfiguration::setMerchantKey($this->paytureMerchantKey);
     PaytureConfiguration::setApiPrefix($this->paytureAPIPrefix);
     parent::init();
     /*if (Yii::$app instanceof \yii\console\Application) {
           $this->controllerNamespace = 'bfday\yii2_payture_module\commands';
       }*/
     //$this->params['foo'] = 'bar';
     //\Yii::configure($this, require(__DIR__ . '/config.php'));
 }
Пример #2
0
 /**
  * Return domain, depending of environment
  *
  * @return string
  *
  * @throws \Exception
  */
 private static function _getDomain()
 {
     if (PaytureConfiguration::getEnvironment() == PaytureConfiguration::ENV_PRODUCTION) {
         return "secure.payture.com";
     } elseif (PaytureConfiguration::getEnvironment() == PaytureConfiguration::ENV_DEVELOPMENT) {
         return "sandbox.payture.com";
     } elseif (PaytureConfiguration::getEnvironment() == PaytureConfiguration::ENV_DEVELOPMENT2) {
         return "sandbox2.payture.com";
     } else {
         throw new \Exception("Environment is not set!");
     }
 }