Skip to content

Commit bceeb68

Browse files
PHPAY-32: feat: find charge by id on efi gateway (#41)
2 parents d7e7a7f + 8c2df86 commit bceeb68

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

examples/efi/charges.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,12 @@
4343
'status' => 'unpaid',
4444
])
4545
->getAll();
46+
47+
/**
48+
* find charge by id
49+
*
50+
* @return array charge
51+
*/
52+
$phpay
53+
->charge()
54+
->find($chargeId);

src/Gateways/Efi/Resources/Charge/Charge.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ public function getAll(): array
9696
return $this->get('v1/charges', $this->queryParams);
9797
}
9898

99+
/**
100+
* find charge by id
101+
*
102+
* @return array<array|mixed>
103+
*/
104+
public function find(string $id): array
105+
{
106+
return $this->get("v1/charge/{$id}");
107+
}
108+
99109
/**
100110
* create charge
101111
*

src/Gateways/Efi/Resources/Charge/Interface/ChargeInterface.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ interface ChargeInterface
1313
*/
1414
public function getAll(): array;
1515

16+
/**
17+
* find charge by id
18+
*
19+
* @param string $id
20+
* @return array<array|mixed>
21+
*/
22+
public function find(string $id): array;
23+
1624
/**
1725
* set customer
1826
*

0 commit comments

Comments
 (0)