Knet不在PHP中使用Kohana

时间:2017-11-24 10:15:39

标签: php kohana kohana-3 magicknet

当我使用Kohana和Knet付款方式时,我收到404错误:

public function action_restaurant_commission()
{
    $commission_id='';
    if(isset($_GET['com'])){
        $commission_id=base64_decode($_GET['com']);
    }
    $commission=$this->CCP_Model->get_commission_log_by_id($commission_id);
    $commission=$commission[0];
    $commission_amount=isset($commission['commission_amount'])?$commission['commission_amount']:'0';
    $commission_amount=isset($commission['commission_amount'])?$commission['commission_amount']:0;
    $track_id_old=isset($commission['track_id'])?$commission['track_id']:'';
    if($track_id_old==''){ 
        $track_id= "1111".strtotime($this->getCurrentTimeStamp);}else{$track_id=$track_id_old;
    }
    if(count($commission)){         
        if($track_id!=$track_id_old){
            $this->CCP_Model->get_commission_log_update_track_id($commission_id,$track_id);
        }
        require_once "e24PaymentPipe.inc.php" ;
        $Pipe = new e24PaymentPipe;
        $Pipe->setAction(5);
        $Pipe->setCurrency(444);
        $Pipe->setLanguage("ENG"); //change it to "ARA" for arabic language
        //$Pipe->setResponseURL("https://www.knetpaytest.com.kw/php/response.php");
        $Pipe->setResponseURL("https://www.test.com/knetpaypal/knet_commission_response"); // set your respone page URL
        $Pipe->setErrorURL("https://www.test.com/knet/error.php"); //set your error page URL
        $Pipe->setAmt($commission_amount); //set the amount for the transaction
        //$Pipe->setResourcePath("/Applications/MAMP/htdocs/php-toolkit/resource/");
        $Pipe->setResourcePath("resource/"); //change the path where your resource file is
        $Pipe->setAlias("goe"); //set your alias name here
        $Pipe->setTrackId($track_id);//generate the random number here

        $Pipe->setUdf1("UDF 1"); //set User defined value
        $Pipe->setUdf2("UDF 2"); //set User defined value
        $Pipe->setUdf3("UDF 3"); //set User defined value
        $Pipe->setUdf4("UDF 4"); //set User defined value
        $Pipe->setUdf5("UDF 5"); //set User defined value
        if($Pipe->performPaymentInitialization()!=$Pipe->SUCCESS){
            echo "Result=".$Pipe->SUCCESS;
            echo "<br>".$Pipe->getErrorMsg();
            echo "<br>".$Pipe->getDebugMsg();
            $this->request->redirect(URL_BASE."ordertransaction/commission_error"); 
        }else {
            $payID = $Pipe->getPaymentId();
            $payURL = $Pipe->getPaymentPage();            
            $this->request->redirect($payURL."?PaymentID=".$payID); //Redirect Knet

        }
    }else{
        Message::error('no_data');  
    }
    exit;
}

工作正常前两天,但现在我收到了这个错误:

enter image description here

1 个答案:

答案 0 :(得分:0)

更改

$this->request->redirect(URL_BASE."ordertransaction/commission_error"); 

to

$this->redirect(URL_BASE."ordertransaction/commission_error");