public function finishTransactionAction()
 {
     //      Load cac model can thiet
     Zend_Loader::loadClass('UserModel');
     Zend_Loader::loadClass('TransactionModel');
     Zend_Loader::loadClass('PromotionEventModel');
     $user_model = new UserModel();
     $transaction_model = new TransactionModel();
     $promotion_model = new PromotionEventModel();
     $params = $this->_arrParam;
     if ($this->_request->isPost()) {
         if (!empty($params['transaction_id']) && isset($params['code']) && !empty($params['message'])) {
             try {
                 if (!empty($this->_user)) {
                     $transaction = $transaction_model->getTransaction($params);
                     if ($transaction) {
                         if ($params['code'] == 1) {
                             $tran_array = explode("|", $params['message']);
                             $transaction_id = $tran_array[0];
                             $money = $tran_array[1];
                             $currency = $tran_array[2];
                             $promotion = $this->__getPromotion($this->_user->user_id);
                             if (!empty($promotion) && count($promotion)) {
                                 $money = $money * (100 + $promotion['promotion']) / 100;
                             }
                             $where = "transaction_id = '" . $params['transaction_id'] . "'";
                             $transaction_model->update(array("status" => 0, "updated_time" => date("Y-m-d H:i:s")), $where);
                             $user_model->update(array("user_gome" => new Zend_Db_Expr("user_gome + " . $money)), "user_id = " . $transaction['user_id']);
                         }
                         $this->__updateSession();
                         $user = $user_model->getUserById($this->_user->user_id);
                         $data = array("code" => 1, "content" => array("user_gome" => $user['user_gome']));
                     } else {
                         $data = array("code" => 0, "content" => "Transaction error");
                     }
                 } else {
                     $data = array("code" => 0, "content" => "Authentication failed");
                 }
             } catch (exception $e) {
                 $data = array("code" => 0, "content" => "Error in server");
             }
         } else {
             $data = array("code" => 0, "content" => "Invalid parameters");
         }
         echo json_encode($data);
     }
     exit;
 }