Ejemplo n.º 1
0
 public function run()
 {
     $model = SettingsPay::model()->find();
     if (isset($model->mrh_login)) {
         $out_summ = NULL;
         $inv_id = "0";
         $billing_name = Yii::app()->user->name;
         $crc = md5("{$model->mrh_login}:{$out_summ}:{$inv_id}:{$model->mrh_pass1}:Shp_account={$billing_name}");
         $this->render('widgetRobo', array('model' => $model, 'crc' => $crc));
     }
 }
Ejemplo n.º 2
0
 public function actionIndex()
 {
     if (Yii::app()->user->isGuest or Yii::app()->user->access_level < Config::get('access_level_admin')) {
         $this->redirect(Yii::app()->homeUrl);
     }
     $this->pageTitle = Yii::t('title', 'Payment configuration');
     $model = SettingsPay::model()->find();
     if (isset($_POST['SettingsPay'])) {
         $model->attributes = $_POST['SettingsPay'];
         if ($model->save()) {
             Yii::app()->user->setFlash('message', '<div class="flash_success">' . Yii::t('settings', 'Payment configuration saved!') . '</div>');
             $this->refresh();
         }
     }
     $this->render('/admin/pay', array('model' => $model));
 }
Ejemplo n.º 3
0
 public function actionIkStatus()
 {
     if (!$_POST) {
         exit;
     }
     $model = SettingsPay::model()->find();
     $secret_key = $model->secret_key;
     $ik_shop_id = $model->ik_shop_id;
     $ik_payment_amount = $_POST['ik_payment_amount'];
     $ik_payment_id = $_POST['ik_payment_id'];
     $ik_paysystem_alias = $_POST['ik_paysystem_alias'];
     $ik_baggage_fields = $_POST['ik_baggage_fields'];
     $ik_payment_state = $_POST['ik_payment_state'];
     $ik_trans_id = $_POST['ik_trans_id'];
     $ik_currency_exch = $_POST['ik_currency_exch'];
     $ik_fees_payer = $_POST['ik_fees_payer'];
     $sign_hash = strtoupper(md5($ik_shop_id . ':' . $ik_payment_amount . ':' . $ik_payment_id . ':' . $ik_paysystem_alias . ':' . $ik_baggage_fields . ':' . $ik_payment_state . ':' . $ik_trans_id . ':' . $ik_currency_exch . ':' . $ik_fees_payer . ':' . $secret_key));
     if ($_POST['ik_sign_hash'] === $sign_hash) {
         $log = new LogBilling();
         $log->pay_id = $ik_trans_id;
         $log->sum = $ik_payment_amount;
         $log->account = $ik_payment_id;
         $log->status = 'unpaid';
         $log->system = 'Interkassa';
         $log->save(false);
         $status = LogBilling::model()->findByPK($ik_trans_id);
         if ($status->status == 'unpaid') {
             $criteria = new CDbCriteria();
             $criteria->condition = 'name = "' . $ik_payment_id . '"';
             $money = AccountData::model()->find($criteria);
             $money[Yii::app()->params->money] = $money[Yii::app()->params->money] + $ik_payment_amount;
             $money->save();
             $log = LogBilling::model()->findByPK($ik_trans_id);
             $log->status = 'complete';
             $log->save(false);
             echo 'status - success';
         } else {
             echo 'fail';
             exit;
         }
     } else {
         echo 'Hash check failed.';
     }
 }