@@ -14,78 +14,78 @@ discard block |
||
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | // Retorna a listagem de cobranças |
| 17 | - public function getAll(array $filtros){ |
|
| 17 | + public function getAll(array $filtros) { |
|
| 18 | 18 | $filtro = ''; |
| 19 | - if(is_array($filtros)){ |
|
| 20 | - if($filtros){ |
|
| 21 | - foreach($filtros as $key => $f){ |
|
| 22 | - if(!empty($f)){ |
|
| 23 | - if($filtro){ |
|
| 19 | + if (is_array($filtros)) { |
|
| 20 | + if ($filtros) { |
|
| 21 | + foreach ($filtros as $key => $f) { |
|
| 22 | + if (!empty($f)) { |
|
| 23 | + if ($filtro) { |
|
| 24 | 24 | $filtro .= '&'; |
| 25 | 25 | } |
| 26 | - $filtro .= $key.'='.$f; |
|
| 26 | + $filtro .= $key . '=' . $f; |
|
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | - $filtro = '?'.$filtro; |
|
| 29 | + $filtro = '?' . $filtro; |
|
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | - return $this->http->get('/payments'.$filtro); |
|
| 32 | + return $this->http->get('/payments' . $filtro); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | // Retorna os dados da cobrança de acordo com o Id |
| 36 | - public function getById($id){ |
|
| 37 | - return $this->http->get('/payments/'.$id); |
|
| 36 | + public function getById($id) { |
|
| 37 | + return $this->http->get('/payments/' . $id); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | // Retorna a listagem de cobranças de acordo com o Id do Cliente |
| 41 | - public function getByCustomer($customer_id){ |
|
| 42 | - return $this->http->get('/payments?customer='.$customer_id); |
|
| 41 | + public function getByCustomer($customer_id) { |
|
| 42 | + return $this->http->get('/payments?customer=' . $customer_id); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // Retorna a listagem de cobranças de acordo com o Id da Assinaturas |
| 46 | - public function getBySubscription($subscription_id){ |
|
| 47 | - return $this->http->get('/payments?subscription='.$subscription_id); |
|
| 46 | + public function getBySubscription($subscription_id) { |
|
| 47 | + return $this->http->get('/payments?subscription=' . $subscription_id); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | // Insere uma nova cobrança |
| 51 | - public function create(array $dadosCobranca){ |
|
| 51 | + public function create(array $dadosCobranca) { |
|
| 52 | 52 | $dadosCobranca = $this->setCobranca($dadosCobranca); |
| 53 | - if(!empty($dadosCobranca['error'])){ |
|
| 53 | + if (!empty($dadosCobranca['error'])) { |
|
| 54 | 54 | return $dadosCobranca; |
| 55 | - }else { |
|
| 55 | + } else { |
|
| 56 | 56 | return $this->http->post('/payments', $dadosCobranca); |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | // Insere uma nova cobrança parcelada |
| 61 | - public function parcelada(array $dadosCobranca){ |
|
| 61 | + public function parcelada(array $dadosCobranca) { |
|
| 62 | 62 | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | // Insere uma nova cobrança com split |
| 66 | 66 | /* Saldo dividido em multiplas contas do Asaas*/ |
| 67 | - public function split(array $dadosCobranca){ |
|
| 67 | + public function split(array $dadosCobranca) { |
|
| 68 | 68 | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | // Atualiza os dados da cobrança |
| 72 | - public function update($id, array $dadosCobranca){ |
|
| 72 | + public function update($id, array $dadosCobranca) { |
|
| 73 | 73 | |
| 74 | 74 | return $this->http->post('/payments/' . $id, $dadosCliente); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | // Restaura cobrança removida |
| 78 | - public function restore($id){ |
|
| 78 | + public function restore($id) { |
|
| 79 | 79 | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | // Estorna cobrança |
| 83 | - public function estorno($id){ |
|
| 83 | + public function estorno($id) { |
|
| 84 | 84 | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | // Confirmação em dinheiro |
| 88 | - public function confirmacao($id, $dados){ |
|
| 88 | + public function confirmacao($id, $dados) { |
|
| 89 | 89 | $data = array( |
| 90 | 90 | "paymentDate" => "2019-09-03", |
| 91 | 91 | "value" => 100.00, |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | // Deleta uma cobrança |
| 97 | - public function delete($id){ |
|
| 98 | - return $this->http->get('/payments/'.$id,'','DELETE'); |
|
| 97 | + public function delete($id) { |
|
| 98 | + return $this->http->get('/payments/' . $id, '', 'DELETE'); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |