Skip to content

Commit 0cb2f1a

Browse files
Backporting changes merged to v4, also in v3
1 parent f3380c5 commit 0cb2f1a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/Hyperwallet/Hyperwallet.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ class Hyperwallet {
6868
*
6969
* @throws HyperwalletArgumentException
7070
*/
71-
public function __construct($username, $password, $programToken = null, $server = 'https://api.sandbox.hyperwallet.com', $encryptionData = array()) {
71+
public function __construct($username, $password, $programToken = null, $server = 'https://api.sandbox.hyperwallet.com', $encryptionData = array(), $clientOptions = array()) {
7272
if (empty($username) || empty($password)) {
7373
throw new HyperwalletArgumentException('You need to specify your API username and password!');
7474
}
7575

7676
$this->programToken = $programToken;
77-
$this->client = new ApiClient($username, $password, $server, array(), $encryptionData);
77+
$this->client = new ApiClient($username, $password, $server, $clientOptions, $encryptionData);
7878
}
7979

8080
//--------------------------------------

tests/Hyperwallet/Tests/Util/HyperwalletEncryptionTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
namespace Hyperwallet\Tests;
2+
namespace Hyperwallet\Tests\Util;
33

44
use Hyperwallet\Util\HyperwalletEncryption;
55
use Hyperwallet\Exception\HyperwalletException;
@@ -37,8 +37,10 @@ public function testShouldFailDecryptionWhenWrongPrivateKeyIsUsed() {
3737
$encryption2->decrypt($encryptedMessage);
3838
$this->fail('Exception expected');
3939
} catch (\Exception $e) {
40-
$this->assertEquals('Decryption error', $e->getMessage());
41-
}
40+
$this->assertThat($e->getMessage(), $this->logicalOr(
41+
$this->equalTo('Decryption error'),
42+
$this->equalTo('Ciphertext representative out of range')
43+
)); }
4244
}
4345

4446
public function testShouldFailSignatureVerificationWhenWrongPublicKeyIsUsed() {

0 commit comments

Comments
 (0)