Skip to content

Commit 9dfaddb

Browse files
authored
Merge pull request #53 from DiogoGraciano/2.0.6
Adicionado Endpoint do Checkout
2 parents 0330e3a + 5f8ec3e commit 9dfaddb

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/Asaas.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class Asaas {
3232
public $Conta;
3333
public $Finance;
3434
public $SubContas;
35+
public $Checkout;
3536

3637
private $connection;
3738

@@ -58,6 +59,7 @@ public function __construct($token, $status = false) {
5859
$this->Conta = new Conta($this->connection);
5960
$this->Finance = new Finance($this->connection);
6061
$this->SubContas = new SubContas($this->connection);
62+
$this->Checkout = new Checkout($this->connection);
6163
}
6264

6365
public function Assinatura(){
@@ -150,4 +152,8 @@ public function Webhook(){
150152
return $this->webhook;
151153
}
152154

155+
public function Checkout(){
156+
$this->Checkout = new Checkout($this->connection);
157+
return $this->Checkout;
158+
}
153159
}

src/Checkout.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace CodePhix\Asaas;
4+
5+
6+
class Checkout {
7+
8+
public $http;
9+
10+
public function __construct(Connection $connection)
11+
{
12+
$this->http = $connection;
13+
}
14+
15+
16+
public function create(array $dados){
17+
return $this->http->post('/checkouts/', $dados);
18+
}
19+
20+
public function cancel(string $id){
21+
return $this->http->post('/checkouts/'.$id.'/cancel',[]);
22+
}
23+
24+
}

0 commit comments

Comments
 (0)