Skip to content

Commit 43535a5

Browse files
PHPAY-34: feat: cancel charge on efi library
1 parent 395dd42 commit 43535a5

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

examples/efi/charges.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,10 @@
6868
$phpay
6969
->charge()
7070
->destroy($chargeId);
71+
72+
/**
73+
* cancel charge
74+
*/
75+
$phpay
76+
->charge()
77+
->cancel($chargeId);

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,17 @@ public function destroy(string $id): array
154154
return $this->put("v1/charge/{$id}/cancel", []);
155155
}
156156

157+
/**
158+
* cancel charge
159+
*
160+
* @param string $id
161+
* @return array<array|mixed>
162+
*/
163+
public function cancel(string $id): array
164+
{
165+
return $this->put("v1/charge/{$id}/cancel", []);
166+
}
167+
157168
/**
158169
* get status charge
159170
*

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,12 @@ public function confirmReceipt(string $id): array;
5050
* @return array<array|mixed>
5151
*/
5252
public function destroy(string $id): array;
53+
54+
/**
55+
* cancel charge by id
56+
*
57+
* @param string $id
58+
* @return array<array|mixed>
59+
*/
60+
public function cancel(string $id): array;
5361
}

0 commit comments

Comments
 (0)