コード例 #1
0
 public function actionOpen()
 {
     $model = $_POST['FormModel'];
     //print_r($model);die;
     $interswitch = $model['transaction_id'];
     $amount = $model['amount'];
     $customer = $model['cust_name'];
     Yii::app()->session["interswitch_redirect_url_complete"] = 'http://localhost/website/index.php/site/complete';
     if (!empty(Yii::app()->session['transaction_id'])) {
         unset(Yii::app()->session['transaction_id']);
         Yii::app()->session['transaction_id'] = $interswitch;
     } else {
         Yii::app()->session['transaction_id'] = $interswitch;
     }
     // renders the view file 'protected/views/site/index.php'
     // using the default layout 'protected/views/layouts/main.php'
     $modelPay = new PaymentInterswitch();
     if (isset(Yii::app()->session['transaction_id'])) {
         $modelPay->amount = $amount;
         $modelPay->transaction_id = $interswitch;
         $modelPay->cust_name = $customer;
         if ($modelPay->save()) {
             $this->redirect(array('/interswitch/verify'));
         }
     }
 }
コード例 #2
0
ファイル: SiteController.php プロジェクト: aremssy/interraPay
 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     // renders the view file 'protected/views/site/index.php'
     // using the default layout 'protected/views/layouts/main.php'
     $model = new PaymentDetails();
     $modelPay = new PaymentInterswitch();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['PaymentDetails'])) {
         $model->attributes = $_POST['PaymentDetails'];
         if ($model->save()) {
             $modelPay->save();
         }
         $this->redirect(array('index'));
     }
     $this->render('index', array('model' => $model, 'modelPay' => $modelPay));
     //$this->render('index');
     //echo Yii::app()->session['transaction_id'];
 }