diff --git a/examples/efi/charges.php b/examples/efi/charges.php index 6a4c062..46b8d6c 100644 --- a/examples/efi/charges.php +++ b/examples/efi/charges.php @@ -43,3 +43,12 @@ 'status' => 'unpaid', ]) ->getAll(); + +/** + * find charge by id + * + * @return array charge + */ +$phpay + ->charge() + ->find($chargeId); diff --git a/src/Gateways/Efi/Resources/Charge/Charge.php b/src/Gateways/Efi/Resources/Charge/Charge.php index 00e77cf..257713b 100644 --- a/src/Gateways/Efi/Resources/Charge/Charge.php +++ b/src/Gateways/Efi/Resources/Charge/Charge.php @@ -96,6 +96,16 @@ public function getAll(): array return $this->get('v1/charges', $this->queryParams); } + /** + * find charge by id + * + * @return array + */ + public function find(string $id): array + { + return $this->get("v1/charge/{$id}"); + } + /** * create charge * diff --git a/src/Gateways/Efi/Resources/Charge/Interface/ChargeInterface.php b/src/Gateways/Efi/Resources/Charge/Interface/ChargeInterface.php index 6dadcfe..06bdcf5 100644 --- a/src/Gateways/Efi/Resources/Charge/Interface/ChargeInterface.php +++ b/src/Gateways/Efi/Resources/Charge/Interface/ChargeInterface.php @@ -13,6 +13,14 @@ interface ChargeInterface */ public function getAll(): array; + /** + * find charge by id + * + * @param string $id + * @return array + */ + public function find(string $id): array; + /** * set customer *