@@ 16-26 (lines=11) @@ | ||
13 | return $this->parseResponse($response); |
|
14 | } |
|
15 | ||
16 | public static function cnpj_cpf($cnpj_cpf) { |
|
17 | if (!$cnpj_cpf) { |
|
18 | throw new \Exception("Couldn't find ".get_called_class()." without an cnpj or cpf."); |
|
19 | } |
|
20 | $response = self::sendRequest('GET', 'bank_billets/cnpj_cpf', ['query' => ['q' => $cnpj_cpf]]); |
|
21 | $collection = []; |
|
22 | foreach ($response->json() as $attributes) { |
|
23 | $collection[] = new BankBillet($attributes); |
|
24 | } |
|
25 | return $collection; |
|
26 | } |
|
27 | ||
28 | public static function status($status) { |
|
29 | if (!$status) { |
|
@@ 28-38 (lines=11) @@ | ||
25 | return $collection; |
|
26 | } |
|
27 | ||
28 | public static function status($status) { |
|
29 | if (!$status) { |
|
30 | throw new \Exception("Couldn't find ".get_called_class()." without an status."); |
|
31 | } |
|
32 | $response = self::sendRequest('GET', 'bank_billets/status', ['query' => ['q' => $status]]); |
|
33 | $collection = []; |
|
34 | foreach ($response->json() as $attributes) { |
|
35 | $collection[] = new BankBillet($attributes); |
|
36 | } |
|
37 | return $collection; |
|
38 | } |
|
39 | ||
40 | public static function our_number($our_number) { |
|
41 | if (!$our_number) { |
|
@@ 40-50 (lines=11) @@ | ||
37 | return $collection; |
|
38 | } |
|
39 | ||
40 | public static function our_number($our_number) { |
|
41 | if (!$our_number) { |
|
42 | throw new \Exception("Couldn't find ".get_called_class()." without an our_number."); |
|
43 | } |
|
44 | $response = self::sendRequest('GET', 'bank_billets/our_number', ['query' => ['q' => $our_number]]); |
|
45 | $collection = []; |
|
46 | foreach ($response->json() as $attributes) { |
|
47 | $collection[] = new BankBillet($attributes); |
|
48 | } |
|
49 | return $collection; |
|
50 | } |
|
51 | } |