Когда я использую 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;
}
За два дня до его работы нормально, но теперь я получаю эту ошибку:
менять
$this->request->redirect(URL_BASE."ordertransaction/commission_error");
$this->redirect(URL_BASE."ordertransaction/commission_error");
Других решений пока нет …