Esempio n. 1
0
 public function billAction()
 {
     $tx = $this->getTransaction();
     $tx->tti = 22;
     $tx->accountNo = $tx->userID;
     $token = new vng_zingme_payment_thrift_T_Token();
     $token->pToken = DataFormat::hex2str($this->_getParam("pToken"));
     $token->timestamp = $this->_getParam("timestamp");
     $billing = new Billing($tx, $token);
     try {
         $resCode = $billing->bill();
     } catch (Exception $e) {
         print_r($e);
     }
     $url = $this->_getParam("resURL");
     $url .= "?userID=" . $this->_getParam("userID");
     $url .= "&billNo=" . $tx->orderNo;
     $url .= "&appID=" . $this->_getParam("appID");
     $url .= "&txTime=" . $this->_getParam("txTime");
     $url .= "&itemIDs=" . $tx->itemIDs;
     $url .= "&quantities=" . $tx->itemQuantities;
     $url .= "&prices=" . $tx->amounts;
     $url .= "&amount=" . $this->_getParam("amount");
     $url .= "&state=" . $resCode->code;
     $url .= "&balance=" . $resCode->mxuBalance;
     $url .= "&refNo=" . $resCode->refNo;
     $this->_redirect($url);
 }
Esempio n. 2
0
 public function billAction()
 {
     //validate params
     if (!$this->validateParams() || $this->_getParam("pToken") == null) {
         $this->redirectError();
         return;
     }
     $token = new vng_zingme_payment_thrift_T_Token();
     $pToken = $this->_getParam("pToken");
     $token->pToken = DataFormat::hex2str($pToken);
     $this->updateTokenCached();
     $billing = new Billing($this->_getParam("appID"), $this->_getParam("data"), $token, $_SERVER['REMOTE_ADDR']);
     $resCode = $billing->bill();
     $this->view->billNo = $this->_getParam("refID");
     $this->view->title = "Ví Zing Me - Kết quả xác nhận thanh toán sản phẩm";
     $this->view->billresult = $resCode->code;
     $this->view->refID = $resCode->refNo;
     //sure that this is 3th time when server finish process user's bill
     ScriberPayment::sendLogStep3($this->userID, $this->_getParam("appID"), $this->_getParam("refID"), $resCode->code, $resCode->refNo);
     if ($resCode->code != 0) {
         $this->render('billingfail');
     } else {
         $this->view->success = 1;
         $appCache = $this->getAppCache($this->userID, $this->_getParam("appID"));
         if ($appCache && $appCache == '1') {
             $this->view->isLite = 1;
         }
         $this->render('billingresult');
     }
 }