diff --git a/lib/Checkout/Disputes/DisputesClient.php b/lib/Checkout/Disputes/DisputesClient.php index 4ce58e1c..2d72aaa7 100644 --- a/lib/Checkout/Disputes/DisputesClient.php +++ b/lib/Checkout/Disputes/DisputesClient.php @@ -10,6 +10,7 @@ class DisputesClient extends FilesClient const DISPUTES_PATH = "disputes"; const ACCEPT_PATH = "accept"; const EVIDENCE_PATH = "evidence"; + const SUBMITTED_PATH = "submitted"; const SCHEME_FILES_PATH = "schemefiles"; /** @@ -95,6 +96,19 @@ public function submitEvidence($disputeId) ); } + /** + * @param string $disputeId + * @return array + * @throws CheckoutApiException + */ + public function getCompiledSubmittedEvidence($disputeId) + { + return $this->apiClient->get( + $this->buildPath(self::DISPUTES_PATH, $disputeId, self::EVIDENCE_PATH, self::SUBMITTED_PATH), + $this->sdkAuthorization() + ); + } + /** * @param string $disputeId * @return array diff --git a/test/Checkout/Tests/Disputes/DisputesClientTest.php b/test/Checkout/Tests/Disputes/DisputesClientTest.php index c4f0e097..67cf0bc0 100644 --- a/test/Checkout/Tests/Disputes/DisputesClientTest.php +++ b/test/Checkout/Tests/Disputes/DisputesClientTest.php @@ -120,6 +120,20 @@ public function shouldSubmitEvidence() $this->assertNotNull($response); } + /** + * @test + * @throws CheckoutApiException + */ + public function shouldGetCompiledSubmittedEvidence() + { + $this->apiClient + ->method("get") + ->willReturn("foo"); + + $response = $this->client->getCompiledSubmittedEvidence("dispute_id"); + $this->assertNotNull($response); + } + /** * @test * @throws CheckoutApiException diff --git a/test/Checkout/Tests/Disputes/DisputesIntegrationTest.php b/test/Checkout/Tests/Disputes/DisputesIntegrationTest.php index 33b6a27a..ac420631 100644 --- a/test/Checkout/Tests/Disputes/DisputesIntegrationTest.php +++ b/test/Checkout/Tests/Disputes/DisputesIntegrationTest.php @@ -142,6 +142,17 @@ function () use (&$filter) { self::assertArrayHasKey("http_metadata", $updateResponse); self::assertEquals(204, $updateResponse["http_metadata"]->getStatusCode()); + //Get compiled submitted evidence + $compiledSubmittedEvidenceResponse + = $this->checkoutApi->getDisputesClient()->getCompiledSubmittedEvidence($disputeId); + $this->assertResponse( + $compiledSubmittedEvidenceResponse, + "file_id", + "_links", + "_links.self" + ); + + $evidence = $this->checkoutApi->getDisputesClient()->getEvidence($disputeId); $this->assertResponse( $evidence,