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