From da44f26fc295609528d79c8a3a51ec551aef1159 Mon Sep 17 00:00:00 2001 From: Ondrej Novak Date: Sun, 30 Oct 2016 15:16:59 +0100 Subject: [PATCH] update dependencies --- composer.json | 38 ++++++++++++++++++++------------------ src/Dispatcher.php | 3 ++- src/SoapClient.php | 9 ++++++--- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/composer.json b/composer.json index 2f7fe41..458b49a 100644 --- a/composer.json +++ b/composer.json @@ -1,18 +1,20 @@ -{ - "name": "ondrejnov/eet", - "description": "EET (Electronic records of sales for Czech Ministry of Finance) Client for PHP", - "type": "library", - "license": ["MIT", "BSD-3-Clause", "GPL-2.0", "GPL-3.0"], - "require": { - "php": ">=5.6.0", - "robrichards/wse-php": "*" - }, - "require-dev": { - "nette/tester": "~1.4" - }, - "minimum-stability": "dev", - "prefer-stable": true, - "autoload": { - "classmap": ["src/"] - } -} +{ + "name": "ondrejnov/eet", + "description": "EET (Electronic records of sales for Czech Ministry of Finance) Client for PHP", + "type": "library", + "license": ["MIT", "BSD-3-Clause", "GPL-2.0", "GPL-3.0"], + "require": { + "php": ">=5.6.0", + "robrichards/xmlseclibs": "2.0.*", + "robrichards/wse-php": "2.0.*", + "ext-curl": "*" + }, + "require-dev": { + "nette/tester": "~1.4" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "autoload": { + "classmap": ["src/"] + } +} diff --git a/src/Dispatcher.php b/src/Dispatcher.php index eae4794..761619b 100644 --- a/src/Dispatcher.php +++ b/src/Dispatcher.php @@ -7,6 +7,7 @@ use Ondrejnov\EET\Exceptions\ServerException; use Ondrejnov\EET\SoapClient; use Ondrejnov\EET\Utils\Format; +use RobRichards\XMLSecLibs\XMLSecurityKey; /** * Receipt for Ministry of Finance @@ -119,7 +120,7 @@ private function throwTraceNotEnabled() { * @return array */ public function getCheckCodes(Receipt $receipt) { - $objKey = new \XMLSecurityKey(\XMLSecurityKey::RSA_SHA256, ['type' => 'private']); + $objKey = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, ['type' => 'private']); $objKey->loadKey($this->key, TRUE); $arr = [ diff --git a/src/SoapClient.php b/src/SoapClient.php index 989ef60..dcf2a50 100644 --- a/src/SoapClient.php +++ b/src/SoapClient.php @@ -3,6 +3,9 @@ namespace Ondrejnov\EET; use Ondrejnov\EET\Exceptions\ClientException; +use RobRichards\WsePhp\WSSESoap; +use RobRichards\XMLSecLibs\XMLSecurityDSig; +use RobRichards\XMLSecLibs\XMLSecurityKey; class SoapClient extends \SoapClient { @@ -61,12 +64,12 @@ public function getXML($request) { $doc = new \DOMDocument('1.0'); $doc->loadXML($request); - $objWSSE = new \WSSESoap($doc); + $objWSSE = new WSSESoap($doc); $objWSSE->addTimestamp(); - $objKey = new \XMLSecurityKey(\XMLSecurityKey::RSA_SHA256, ['type' => 'private']); + $objKey = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, ['type' => 'private']); $objKey->loadKey($this->key, TRUE); - $objWSSE->signSoapDoc($objKey, ["algorithm" => \XMLSecurityDSig::SHA256]); + $objWSSE->signSoapDoc($objKey, ["algorithm" => XMLSecurityDSig::SHA256]); $token = $objWSSE->addBinaryToken(file_get_contents($this->cert)); $objWSSE->attachTokentoSig($token);