diff --git a/src/SoCommunicator.php b/src/SoCommunicator.php index 4bf5584..1547226 100644 --- a/src/SoCommunicator.php +++ b/src/SoCommunicator.php @@ -291,7 +291,7 @@ private function AppendHash($string) if (empty($this->ObscuritySeed)) throw new \UnexpectedValueException('No security seed set when using security suffix.'); - $hash = crypt($string, $this->ObscuritySeed); + $hash = base64_encode(crypt($string, $this->ObscuritySeed)); return $string . substr($hash, 0, $this->ObscuritySuffixLength); } diff --git a/tests/unit/at/externet/eps_bank_transfer/SoCommunicatorTest.php b/tests/unit/at/externet/eps_bank_transfer/SoCommunicatorTest.php index 680882f..ff5dc86 100644 --- a/tests/unit/at/externet/eps_bank_transfer/SoCommunicatorTest.php +++ b/tests/unit/at/externet/eps_bank_transfer/SoCommunicatorTest.php @@ -147,7 +147,7 @@ public function testSendTransferInitiatorDetailsWithSecurityAppendsHash() $this->target->SendTransferInitiatorDetails($transferInitiatorDetails, $url); $this->assertEquals('string', gettype($this->mTransport->lastPostBody)); - $this->assertContains('>'. 'Order1SoxmdwbL' . '<', $this->mTransport->lastPostBody); + $this->assertContains('>'. 'Order1U294bWR3' . '<', $this->mTransport->lastPostBody); } public function testHandleConfirmationUrlThrowsExceptionOnMissingCallback() @@ -403,7 +403,7 @@ public function testHandleConfirmationUrlStripsSecurityHashFromRemittanceIdentif { $original = $this->GetEpsData('BankConfirmationDetailsWithoutSignature.xml'); $expected = 'AT1234567890XYZ'; - $data = str_replace($expected, $expected . 'Fo7', $original); + $data = str_replace($expected, $expected . 'Rm8', $original); $dataPath = tempnam(sys_get_temp_dir(), 'SoCommunicatorTest_'); file_put_contents($dataPath, $data);