Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejnov committed Oct 30, 2016
1 parent cc652e4 commit da44f26
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 22 deletions.
38 changes: 20 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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/"]
}
}
3 changes: 2 additions & 1 deletion src/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = [
Expand Down
9 changes: 6 additions & 3 deletions src/SoapClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit da44f26

Please sign in to comment.