Skip to content

Commit b8d6ad5

Browse files
PHPAY-35: feat: mark charge as paid on efi library (#42)
2 parents bceeb68 + 01c6fc8 commit b8d6ad5

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

examples/efi/charges.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,12 @@
5252
$phpay
5353
->charge()
5454
->find($chargeId);
55+
56+
/**
57+
* confirm receipt
58+
*
59+
* @return array charge
60+
*/
61+
$phpay
62+
->charge()
63+
->confirmReceipt($chargeId, []);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function getQrCodePix(string $id): array
196196
*/
197197
public function confirmReceipt(string $id, array $data): array
198198
{
199-
return $this->post("payments/{$id}/receiveInCash", $data);
199+
return $this->put("v1/charge/{$id}/settle", $data);
200200
}
201201

202202
/**

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,11 @@ public function setCustomer(array $customer): Charge;
3636
* @return ChargeInterface
3737
*/
3838
public function setQueryParams(array $queryParams): ChargeInterface;
39+
40+
/**
41+
* @param string $id
42+
* @param array<mixed> $data
43+
* @return array<array|mixed>
44+
*/
45+
public function confirmReceipt(string $id, array $data): array;
3946
}

0 commit comments

Comments
 (0)