|
@@ 6-12 (lines=7) @@
|
| 3 |
|
namespace BoletoSimples; |
| 4 |
|
|
| 5 |
|
class Customer extends BaseResource { |
| 6 |
|
public static function cnpj_cpf($cnpj_cpf) { |
| 7 |
|
if (!$cnpj_cpf) { |
| 8 |
|
throw new \Exception("Couldn't find ".get_called_class()." without an cnpj or cpf."); |
| 9 |
|
} |
| 10 |
|
$response = self::sendRequest('GET', 'customers/cnpj_cpf', ['query' => ['q' => $cnpj_cpf]]); |
| 11 |
|
return $this->parseResponse($response); |
| 12 |
|
} |
| 13 |
|
public static function email($email) { |
| 14 |
|
if (!$email) { |
| 15 |
|
throw new \Exception("Couldn't find ".get_called_class()." without an email."); |
|
@@ 13-19 (lines=7) @@
|
| 10 |
|
$response = self::sendRequest('GET', 'customers/cnpj_cpf', ['query' => ['q' => $cnpj_cpf]]); |
| 11 |
|
return $this->parseResponse($response); |
| 12 |
|
} |
| 13 |
|
public static function email($email) { |
| 14 |
|
if (!$email) { |
| 15 |
|
throw new \Exception("Couldn't find ".get_called_class()." without an email."); |
| 16 |
|
} |
| 17 |
|
$response = self::sendRequest('GET', 'customers/email', ['query' => ['q' => $email]]); |
| 18 |
|
return $this->parseResponse($response); |
| 19 |
|
} |
| 20 |
|
} |
| 21 |
|
|