TransactionEndpoint::list()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Ipag\Sdk\Endpoint;
4
5
use Ipag\Sdk\Core\Endpoint;
6
use Ipag\Sdk\Http\Response;
7
8
/**
9
 * TransactionEndpoint class
10
 *
11
 * Classe responsável pelo controle dos endpoints do recurso Transaction.
12
 */
13
class TransactionEndpoint extends Endpoint
14
{
15
    protected string $location = '/service/resources/transactions';
16
17
    /**
18
     * Endpoint para obter um recurso Transaction
19
     *
20
     * @param integer $id
21
     * @return Response
22
     *
23
     * @codeCoverageIgnore
24
     */
25
    public function get(int $id): Response
26
    {
27
        return $this->_GET(['id' => $id]);
28
    }
29
30
    /**
31
     * Endpoint para listar recursos Transaction
32
     *
33
     * @param array|null $filters
34
     * @return Response
35
     *
36
     */
37
    public function list(?array $filters = []): Response
38
    {
39
        return $this->_GET($filters ?? []);
40
    }
41
42
    /**
43
     * Endpoint para liberar recebíveis de recurso Transaction
44
     *
45
     * @param integer $sellerId
46
     * @param integer $transactionId
47
     * @return Response
48
     *
49
     * @codeCoverageIgnore
50
     */
51
    public function releaseReceivables(int $sellerId, int $transactionId): Response
52
    {
53
        return $this->_POST(['seller_id' => $sellerId, 'transaction_id' => $transactionId]);
54
    }
55
56
}