Skip to content

Commit b12f61a

Browse files
committed
Updated PTK for EBICS 3.0
1 parent 90bb82a commit b12f61a

2 files changed

Lines changed: 33 additions & 4 deletions

File tree

src/Orders/PTK.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ public function prepareContext(): void
4747

4848
public function createRequest(): Request
4949
{
50-
if ($this->getVersion() === Keyring::VERSION_30) {
51-
throw new MethodNotImplemented('3.0');
52-
}
53-
5450
return $this->buildRequest();
5551
}
5652

tests/EbicsClientV30Test.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use EbicsApi\Ebics\Orders\HPB;
2020
use EbicsApi\Ebics\Orders\HPD;
2121
use EbicsApi\Ebics\Orders\INI;
22+
use EbicsApi\Ebics\Orders\PTK;
2223
use EbicsApi\Ebics\Orders\SPR;
2324

2425
/**
@@ -416,6 +417,36 @@ public function testHAA(int $credentialsId, array $codes): void
416417
$this->assertResponseDone($code, $reportText);
417418
}
418419

420+
/**
421+
* @dataProvider serversDataProvider
422+
*
423+
* @group PTK
424+
* @group V3
425+
* @group PTK-V3
426+
*
427+
* @param int $credentialsId
428+
* @param array $codes
429+
*
430+
* @covers
431+
*/
432+
public function testPTK(int $credentialsId, array $codes): void
433+
{
434+
$client = $this->setupClientV30($credentialsId, $codes['PTK']['fake']);
435+
436+
$this->assertExceptionCode($codes['PTK']['code']);
437+
$ptk = $client->executeDownloadOrder(new PTK());
438+
439+
$responseHandler = $client->getResponseHandler();
440+
$code = $responseHandler->retrieveH00XReturnCode($ptk->getTransaction()->getLastSegment()->getResponse());
441+
$reportText = $responseHandler->retrieveH00XReportText($ptk->getTransaction()->getLastSegment()->getResponse());
442+
$this->assertResponseOk($code, $reportText);
443+
444+
$code = $responseHandler->retrieveH00XReturnCode($ptk->getTransaction()->getReceipt());
445+
$reportText = $responseHandler->retrieveH00XReportText($ptk->getTransaction()->getReceipt());
446+
447+
$this->assertResponseDone($code, $reportText);
448+
}
449+
419450
/**
420451
* @dataProvider serversDataProvider
421452
*
@@ -562,6 +593,7 @@ public function serversDataProvider()
562593
'CSV' => ['code' => null, 'fake' => false],
563594
'HPD' => ['code' => null, 'fake' => false],
564595
'HAA' => ['code' => null, 'fake' => false],
596+
'PTK' => ['code' => null, 'fake' => false],
565597
],
566598
],
567599
[
@@ -578,6 +610,7 @@ public function serversDataProvider()
578610
'CSV' => ['code' => '091005', 'fake' => false],
579611
'HPD' => ['code' => null, 'fake' => false],
580612
'HAA' => ['code' => null, 'fake' => false],
613+
'PTK' => ['code' => null, 'fake' => false],
581614
],
582615
],
583616
];

0 commit comments

Comments
 (0)