コード例 #1
0
ファイル: onlinedengi.php プロジェクト: Nikitian/fl-ru-damp
 public function handleRequest()
 {
     switch ($this->_action) {
         case self::DO_REQUEST_PAYMENT:
             //                return $this->_processPayment();
             break;
         case self::DO_REQUEST_CHECKIN:
             //                return $this->_processCheck();
             break;
         case self::DO_REQUEST_SUCCESS:
             $pmt = $this->_getPayment($this->_request['nickname']);
             if (!$pmt) {
                 header_location_exit('/404.php');
             }
             $pskb = new pskb();
             $pskb->upLC(array('refund' => 1, 'dol_paymentid' => $this->_request['paymentid']), $pmt['lc_id']);
             header_location_exit('/' . sbr::NEW_TEMPLATE_SBR . '/?site=reserve&id=' . $pmt['sbr_id']);
             break;
         case self::DO_REQUEST_FAILURE:
             $pmt = $this->_getPayment($this->_request['nickname']);
             if (!$pmt || $pmt['state'] != 'new' && $pmt['state'] != 'err') {
                 header_location_exit('/404.php');
             }
             if ($this->_request['duplicate'] == 1) {
                 $pskb = new pskb();
                 $pskb->upLC(array('sended' => 1, 'dol_paymentid' => $this->_request['paymentid']), $pmt['lc_id']);
             } else {
                 if ($this->_request['refund'] == 1) {
                     $pskb = new pskb();
                     $pskb->upLC(array('refund' => 1, 'dol_paymentid' => $this->_request['paymentid']), $pmt['lc_id']);
                 } else {
                     $pskb = new pskb();
                     $pskb->upLC(array('dol_paymentid' => $this->_request['paymentid']), $pmt['lc_id']);
                 }
                 $pskb = new pskb();
                 $pskb_lc = $pskb->checkLC($pmt['lc_id']);
                 if ($pskb_lc->state != pskb::STATE_COVER) {
                     $reason = __paramValue('string', $this->_request['process_message']);
                     $this->_clearPayment($pmt['lc_id'], $reason);
                 }
             }
             header_location_exit('/' . sbr::NEW_TEMPLATE_SBR . '/?site=reserve&id=' . $pmt['sbr_id']);
             break;
         default:
             break;
     }
 }