From 81ed0d78284f8f4211710826c9dec04210ea84d8 Mon Sep 17 00:00:00 2001 From: Wojtazzzz Date: Tue, 6 Jan 2026 17:10:24 +0100 Subject: [PATCH 1/2] docs: add throw tags --- .../Application/Service/TransactionService.php | 13 ++++++++++++- src/Shared/Http/HttpClient.php | 6 ++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Payment/Application/Service/TransactionService.php b/src/Payment/Application/Service/TransactionService.php index 5cf31a6..eaabb49 100644 --- a/src/Payment/Application/Service/TransactionService.php +++ b/src/Payment/Application/Service/TransactionService.php @@ -5,11 +5,13 @@ namespace Paymentic\Sdk\Payment\Application\Service; use Exception; +use JsonException; use Paymentic\Sdk\Payment\Application\Contract\TransactionServiceContract; use Paymentic\Sdk\Payment\Application\DTO\CreateTransactionRequest; use Paymentic\Sdk\Payment\Application\DTO\CreateTransactionResponse; use Paymentic\Sdk\Payment\Application\Mapper\TransactionMapper; use Paymentic\Sdk\Payment\Domain\Entity\Transaction; +use Paymentic\Sdk\Shared\Exception\PaymenticException; use Paymentic\Sdk\Shared\Http\HttpClient; final readonly class TransactionService implements TransactionServiceContract @@ -19,6 +21,10 @@ public function __construct( ) { } + /** + * @throws PaymenticException + * @throws JsonException + */ public function create(string $pointId, CreateTransactionRequest $request): CreateTransactionResponse { $response = $this->httpClient->post( @@ -30,7 +36,8 @@ public function create(string $pointId, CreateTransactionRequest $request): Crea } /** - * @throws Exception + * @throws PaymenticException + * @throws JsonException */ public function get(string $pointId, string $transactionId): Transaction { @@ -41,6 +48,10 @@ public function get(string $pointId, string $transactionId): Transaction return TransactionMapper::fromArray($response['data']); } + /** + * @throws PaymenticException + * @throws JsonException + */ public function capture(string $pointId, string $transactionId): void { $this->httpClient->patch( diff --git a/src/Shared/Http/HttpClient.php b/src/Shared/Http/HttpClient.php index 597857b..d4ca2ee 100644 --- a/src/Shared/Http/HttpClient.php +++ b/src/Shared/Http/HttpClient.php @@ -24,6 +24,8 @@ public function __construct( /** * @param array $data * @return array + * @throws JsonException + * @throws PaymenticException */ public function post(string $uri, array $data = []): array { @@ -32,6 +34,8 @@ public function post(string $uri, array $data = []): array /** * @return array + * @throws JsonException + * @throws PaymenticException */ public function get(string $uri): array { @@ -41,6 +45,8 @@ public function get(string $uri): array /** * @param array $data * @return array + * @throws JsonException + * @throws PaymenticException */ public function patch(string $uri, array $data = []): array { From 8f3a9a7e978c7a6183599e7fcaaefc632bac579d Mon Sep 17 00:00:00 2001 From: Wojtazzzz Date: Tue, 6 Jan 2026 17:11:21 +0100 Subject: [PATCH 2/2] docs: add throw tag --- src/Payment/Application/Service/TransactionService.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Payment/Application/Service/TransactionService.php b/src/Payment/Application/Service/TransactionService.php index eaabb49..24945bb 100644 --- a/src/Payment/Application/Service/TransactionService.php +++ b/src/Payment/Application/Service/TransactionService.php @@ -38,6 +38,7 @@ public function create(string $pointId, CreateTransactionRequest $request): Crea /** * @throws PaymenticException * @throws JsonException + * @throws Exception */ public function get(string $pointId, string $transactionId): Transaction {