Example #1
0
 public static function setConfig()
 {
     $module = new PayqrModule();
     PayqrConfig::$merchantID = $module->getOption("merchantID");
     PayqrConfig::$secretKeyIn = $module->getOption("secretKeyIn");
     PayqrConfig::$secretKeyOut = $module->getOption("secretKeyOut");
 }
Example #2
0
 /**
  * Задаём настройки
  */
 private function setModuleConfig()
 {
     $user_id = isset($_GET["user_id"]) ? $_GET["user_id"] : 1;
     $auth = new PayqrModuleAuth($user_id);
     $module = new PayqrModule();
     PayqrConfig::$merchantID = $module->getOption("merchantID");
     PayqrConfig::$secretKeyIn = $module->getOption("secretKeyIn");
     PayqrConfig::$secretKeyOut = $module->getOption("secretKeyOut");
 }
Example #3
0
 public static function init()
 {
     //получаем информацию о настройках кнопки
     $marketObj = new Market();
     $market = $marketObj->getUserMarkets(DEFAULT_USER_ID)->one();
     if (!isset($market->settings)) {
         PayqrLog::log("Не смогли получить настройки кнопки, прекращаем работу!");
         return false;
     }
     $settings = json_decode($market->getSettings(), true);
     if (!isset($settings['merchant_id'], $settings['secret_key_in'], $settings['secret_key_out'], $settings['insales_url']) && (empty($settings['merchant_id']) || empty($settings['secret_key_in']) || empty($settings['secret_key_out']) || empty($settings['insales_url']))) {
         return false;
     }
     self::$merchantID = $settings['merchant_id'];
     self::$secretKeyIn = $settings['secret_key_in'];
     self::$secretKeyOut = $settings['secret_key_out'];
     self::$insalesURL = $settings['insales_url'];
 }