Skip to content

Commit 43c3542

Browse files
committed
PHPAY-52: feat: adding manager pix keys resource
1 parent f4cd314 commit 43c3542

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

examples/asaas/pix.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,11 @@
2727
$phpay
2828
->pix()
2929
->destroy(ID_PIX_KEY);
30+
31+
$phpay
32+
->pix()
33+
->staticQrCode($staticQrCodeParams);
34+
35+
$phpay
36+
->pix()
37+
->destroyStaticQrCode($statiQrCodeId);

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,20 @@ public function getAll(): array;
4242
* @return bool
4343
*/
4444
public function destroy(string $id): bool;
45+
46+
/**
47+
* static qr code
48+
*
49+
* @param array<mixed> $params
50+
* @return array<mixed>
51+
*/
52+
public function staticQrCode(array $params): array;
53+
54+
/**
55+
* destroy static qr code
56+
*
57+
* @param string $id
58+
* @return bool
59+
*/
60+
public function destroyStaticQrCode(string $id): bool;
4561
}

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ public function getAll(): array
8888
$params = [
8989
'offset' => 0,
9090
'limit' => 100,
91-
'status' => 'ACTIVE',
9291
];
9392
}
9493

@@ -105,4 +104,27 @@ public function destroy(string $id): bool
105104
{
106105
return $this->delete("pix/addressKeys/{$id}");
107106
}
107+
108+
/**
109+
* static qr code
110+
*
111+
* @param array<mixed> $params
112+
* @return array<mixed>
113+
* @see params in https://docs.asaas.com/reference/create-static-qrcode
114+
*/
115+
public function staticQrCode(array $params): array
116+
{
117+
return $this->post('pix/qrCodes/static', $params);
118+
}
119+
120+
/**
121+
* destroy static qr code
122+
*
123+
* @param string $id
124+
* @return bool
125+
*/
126+
public function destroyStaticQrCode(string $id): bool
127+
{
128+
return $this->delete("pix/qrCodes/static/{$id}");
129+
}
108130
}

0 commit comments

Comments
 (0)