* @copyright 2007-2019 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
include (dirname(__file__) . '/../../../../config/config.inc.php');
include (dirname(__file__) . '/../../../../init.php');
const CHARSET = 'UTF-8';
const REPLACE_FLAGS = ENT_COMPAT;
$geistoken = Tools::getValue('geistoken');
if ($geistoken == 'GeisLogistic') {
$apicode = Configuration::get('GEISLOGISTIC_CODE'); // CustomerCode
$apikey = Configuration::get('GEISLOGISTIC_API'); //Password
$geiscount = Tools::getValue('geispick');
$geispickdate = Tools::getValue('geispickdate');
$testmode = Configuration::get('GEISLOGISTIC_TEST');
$country = Configuration::get('GEISLOGISTIC_COUNTRY');
if ($testmode == '0') {
if ($country == 'PL') {
$wsdl = 'https://gclient.geis.pl/GService/GService.svc?wsdl';
}else{
$wsdl = 'https://gclient.geis.cz/GService/GService.svc?wsdl';
}
}else{
if ($country == 'PL') {
$wsdl = 'https://gclient.geis.pl/GServiceTest/GService.svc?wsdl';
}else{
$wsdl = 'https://gclient.geis.cz/GServiceTest/GService.svc?wsdl';
}
}
ini_set("soap.wsdl_cache_enabled", "0");
try
{
$client = new SoapClient($wsdl, array("trace" => 1));
$data['Request']['Header'] = array(
'CustomerCode' => $apicode,
'Language' => $country,
'Password' => $apikey,
);
$data['Request']['RequestObject'] = array(
'CountItems' => $geiscount,
'DateFrom' => $geispickdate,
'DistributionChannel' => Configuration::get('GEISLOGISTIC_CHANNEL'),
);
$data['Request']['RequestObject']['Contact'] = array(
'Email' => Configuration::get('GEISLOGISTIC_EMAILSENDER'),
'FullName' => Configuration::get('GEISLOGISTIC_NAMESENDER'),
'Phone' => Configuration::get('GEISLOGISTIC_PHONESENDER'),
);
$result = $client->CreatePickUp($data);
}
catch (exception $ex)
{
print "BLAD: .$ex->faultcode .$ex->faultstring. \n\n";
$url = htmlspecialchars($_SERVER['HTTP_REFERER']);
print "\n\n Powrót";
}
print_r($result->CreatePickUpResult->ErrorMessage);
$url = htmlspecialchars($_SERVER['HTTP_REFERER']);
print "\n\n Powrót";
}else{
die();
}