Completed
Push — master ( 0ac77b...71996c )
by Rafael
19s queued 16s
created

BanklyCard::transactions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 5
1
<?php
2
3
namespace WeDevBr\Bankly;
4
5
use WeDevBr\Bankly\Auth\Auth;
6
use WeDevBr\Bankly\Traits\Rest;
7
8
/**
9
 * Class Card
10
 * @author Rafael Teixeira <[email protected]>
11
 * @package WeDevBr\Bankly
12
 */
13
class BanklyCard
14
{
15
    use Rest;
16
17
    /**
18
     * @param string $clientSecret
19
     * @param string $clientId
20
     */
21
    public function __construct($clientSecret = null, $clientId = null)
22
    {
23
        Auth::login()
24
            ->setClientId($clientId)
25
            ->setClientId($clientSecret);
26
    }
27
28
    /**
29
     * @param string $proxy
30
     * @param string $page
31
     * @param integer $pageSize
32
     * @param string $startDate
33
     * @param string $endDate
34
     * @return array
35
     */
36
    public function transactions(string $proxy, string $page, int $pageSize, string $startDate, string $endDate)
37
    {
38
        $query = [
39
            'page' => $page,
40
            'pageSize' => $pageSize,
41
            'startDate' => $startDate,
42
            'endDate' => $endDate
43
        ];
44
45
        return $this->get("/cards/{$proxy}/transactions", $query);
46
    }
47
}
48