Skip to content

Commit 3293668

Browse files
committed
PHPAY-52: wip: resource pix find key by id
1 parent 86532d3 commit 3293668

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

examples/asaas/pix.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,14 @@
1212
*/
1313
$phpay = new PHPay(new AsaasGateway(TOKEN_ASAAS_SANDBOX));
1414

15-
/**
16-
* create pix key
17-
*
18-
* @return string $pixKey
19-
*/
2015
$phpay
2116
->pix()
2217
->createKey();
2318

24-
/**
25-
* get all pix keys
26-
*
27-
* @return array $pixKeys
28-
*/
19+
$phpay
20+
->pix()
21+
->find(ID_PIX_KEY);
22+
2923
$phpay
3024
->pix()
3125
->getAll();

src/Gateways/Asaas/Resources/Pix/Pix.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,17 @@ public function createKey(): array
6363
]);
6464
}
6565

66+
/**
67+
* find pix key
68+
*
69+
* @param string $id
70+
* @return array<mixed>
71+
*/
72+
public function find(string $id): array
73+
{
74+
return $this->get("pix/addressKeys/{$id}");
75+
}
76+
6677
/**
6778
* get all pix keys
6879
*

0 commit comments

Comments
 (0)