diff --git a/examples/efi/charges.php b/examples/efi/charges.php index 46b8d6c..a35c63e 100644 --- a/examples/efi/charges.php +++ b/examples/efi/charges.php @@ -52,3 +52,12 @@ $phpay ->charge() ->find($chargeId); + +/** + * confirm receipt + * + * @return array charge + */ +$phpay + ->charge() + ->confirmReceipt($chargeId, []); diff --git a/src/Gateways/Efi/Resources/Charge/Charge.php b/src/Gateways/Efi/Resources/Charge/Charge.php index 257713b..72de33b 100644 --- a/src/Gateways/Efi/Resources/Charge/Charge.php +++ b/src/Gateways/Efi/Resources/Charge/Charge.php @@ -196,7 +196,7 @@ public function getQrCodePix(string $id): array */ public function confirmReceipt(string $id, array $data): array { - return $this->post("payments/{$id}/receiveInCash", $data); + return $this->put("v1/charge/{$id}/settle", $data); } /** diff --git a/src/Gateways/Efi/Resources/Charge/Interface/ChargeInterface.php b/src/Gateways/Efi/Resources/Charge/Interface/ChargeInterface.php index 06bdcf5..3e1e0f0 100644 --- a/src/Gateways/Efi/Resources/Charge/Interface/ChargeInterface.php +++ b/src/Gateways/Efi/Resources/Charge/Interface/ChargeInterface.php @@ -36,4 +36,11 @@ public function setCustomer(array $customer): Charge; * @return ChargeInterface */ public function setQueryParams(array $queryParams): ChargeInterface; + + /** + * @param string $id + * @param array $data + * @return array + */ + public function confirmReceipt(string $id, array $data): array; }