Skip to content

Commit

Permalink
changed version number
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendrik Obermayer authored and martinseener committed May 4, 2017
1 parent fb3adf1 commit 37565e4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Cash Payment Solutions GmbH
Copyright (c) 2016-2017 Cash Payment Solutions GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Client
/**
* @var string
*/
private $userAgent = 'PHP SDK v2.0.2';
private $userAgent = 'PHP SDK v2.0.3';


/**
Expand Down Expand Up @@ -79,7 +79,7 @@ public function handle($request)
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);

$response = curl_exec($curl);

$error = curl_error($curl);
if ($error || false === $response) {
throw new Exception\CurlException('Error during cURL: ' . $error . ' [' . curl_errno($curl) . ']');
Expand Down
10 changes: 7 additions & 3 deletions tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ class ClientTest extends \PHPUnit_Framework_TestCase
*/
private $client;

/**
* @var string
*/
private $userAgent = 'PHP SDK v2.0.3';

public function setUp()
{
Expand All @@ -21,7 +25,7 @@ public function setUp()

public function testDefaultUserAgent()
{
$this->assertAttributeEquals('PHP SDK v2.0.2', 'userAgent', $this->client);
$this->assertAttributeEquals($this->userAgent, 'userAgent', $this->client);
}

public function testSetUserAgent()
Expand All @@ -41,7 +45,7 @@ public function testBuildHeaderWithIdempotency()
$header = $this->client->buildHeader($request);
$this->assertEquals('Host: api.barzahlen.de', $header[0]);
$this->assertContains('Date: ', $header[1]);
$this->assertEquals('User-Agent: PHP SDK v2.0.2', $header[2]);
$this->assertEquals('User-Agent: '.$this->userAgent, $header[2]);
$this->assertRegExp('/^Authorization: BZ1-HMAC-SHA256 DivisionId=12345, Signature=[a-f0-9]{64}$/', $header[3]);
$this->assertRegExp('/^Idempotency-Key: [a-f0-9]{32}$/', $header[4]);
}
Expand All @@ -54,7 +58,7 @@ public function testBuildHeaderWithoutIdempotencyForSandbox()
$header = $client->buildHeader($request);
$this->assertEquals('Host: api-sandbox.barzahlen.de', $header[0]);
$this->assertContains('Date: ', $header[1]);
$this->assertEquals('User-Agent: PHP SDK v2.0.2', $header[2]);
$this->assertEquals('User-Agent: '.$this->userAgent, $header[2]);
$this->assertRegExp('/^Authorization: BZ1-HMAC-SHA256 DivisionId=12345, Signature=[a-f0-9]{64}$/', $header[3]);
$this->assertArrayNotHasKey(4, $header);
}
Expand Down

0 comments on commit 37565e4

Please sign in to comment.