Skip to content

Commit 2a284d7

Browse files
committed
Added history of refunds
1 parent 9e9ad09 commit 2a284d7

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/Payments.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ public function deleteCard($cardId)
7777
return $this->delete("/payments/cards/{$cardId}");
7878
}
7979

80+
public function getHistoryRefunds($id)
81+
{
82+
return $this->get("/payments/payment/{$id}/refunds");
83+
}
84+
8085
public function getPaymentInstruments($goid, $currency)
8186
{
8287
return $this->get("/eshops/eshop/{$goid}/payment-instruments/{$currency}");

tests/integration/RefundTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace GoPay;
44

55
use PHPUnit\Framework\TestCase;
6+
use function PHPUnit\Framework\assertArrayNotHasKey;
67
use function PHPUnit\Framework\assertNotEmpty;
78
use function PHPUnit\Framework\assertArrayHasKey;
89
use function PHPUnit\Framework\assertEquals;
@@ -41,4 +42,21 @@ public function testRefundPayment()
4142

4243
echo print_r($response->json, true);
4344
}
45+
46+
public function testHistoryOfRefunds()
47+
{
48+
{
49+
$cardId = 3178283550;
50+
51+
$response = $this->gopay->getHistoryRefunds($cardId);
52+
$responseBody = $response->json;
53+
54+
echo print_r($responseBody, true);
55+
56+
assertNotEmpty($responseBody);
57+
assertArrayNotHasKey('errors', $responseBody);
58+
59+
echo print_r($responseBody, true);
60+
}
61+
}
4462
}

0 commit comments

Comments
 (0)