我正在为我的客户端在Prestashop中集成Knet支付网关,但我找不到“失败无法打开资源”的解决方案是什么?
我还更新了“别名”参数...我从客户端获得...但仍然没有工作......
任何人都可以帮助我,并提供任何想法如何在Prestashop中集成KNET。
以下是我的代码片段:
我总是得到“失败无法打开资源”这样的错误
$total = Context::getContext()->cart->getOrderTotal(true);
//random number generation
$x = 3; // Amount of digits
$min = pow(10,$x);
$max = (pow(10,$x+1)-1);
$randomvalue = rand($min, $max);
if(Configuration::get('_Knet_TESTMODE')){
require_once "e24PaymentPipe.inc.php" ;
$Pipe = new e24PaymentPipe;
$Pipe->setAction(1);
$Pipe->setCurrency(414);
$Pipe->setLanguage("ENG"); //change it to "ARA" for arabic language
$Pipe->setResponseURL('https://www.knetpaytest.com.kw/php/response.php'); // set your respone page URL
$Pipe->setErrorURL('https://www.knetpaytest.com.kw/php/error.php'); //set your error page URL
$Pipe->setAmt($total); //set the amount for the transaction
$Pipe->setResourcePath('http://'.$_SERVER['HTTP_HOST'].$this->_path.'resource/'); //change the path where your resource file is
$Pipe->setAlias("******"); //set your alias name here
$Pipe->setTrackId($randomvalue);//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
$Pipe->performPaymentInitialization();
if (strlen($Pipe->getErrorMsg()) > 0) {
echo $Pipe->getErrorMsg();
}
答案 0 :(得分:0)
在你的wamp中安装ziparchive extesnsion然后它将开始工作。