Skip to content

Commit 68786e4

Browse files
PHPAY-33: feat: add function to update due date on efi library
1 parent 1e0c70b commit 68786e4

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

examples/efi/charges.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,12 @@
6868
$phpay
6969
->charge()
7070
->cancel($chargeId);
71+
72+
/**
73+
* update due date
74+
*/
75+
$c = $phpay
76+
->charge()
77+
->updateDueDate($chargeId, [
78+
'expire_at' => '2024-12-30',
79+
]);

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

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

157+
/**
158+
* update due date
159+
*
160+
* @param string $id
161+
* @param array<array|mixed> $data
162+
* @return array<array|mixed>
163+
*/
164+
public function updateDueDate(string $id, array $data): array
165+
{
166+
return $this->put("v1/charge/{$id}/billet", $data);
167+
}
168+
157169
/**
158170
* get status charge
159171
*

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

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

0 commit comments

Comments
 (0)