fix tests

This commit is contained in:
root
2026-06-11 11:46:12 -04:00
parent c91fa2ce4d
commit 5ead80fdc7
1489 changed files with 11349 additions and 10305 deletions
@@ -18,8 +18,7 @@ class RefundRequestService
private RefundSummaryService $summaryService,
private RefundNotificationService $notifications,
private ApplicationUrlService $urls,
) {
}
) {}
public function requestRefund(array $payload, int $actorId): array
{
@@ -30,12 +29,12 @@ class RefundRequestService
$paymentId = isset($payload['payment_id']) ? (int) $payload['payment_id'] : null;
$reason = $payload['reason'] ?? null;
if (!in_array($requestType, self::REQUEST_TYPES, true)) {
if (! in_array($requestType, self::REQUEST_TYPES, true)) {
return ['ok' => false, 'message' => 'Invalid refund request type.'];
}
$parent = User::query()->find($parentId);
if (!$parent) {
if (! $parent) {
return ['ok' => false, 'message' => 'Parent not found.'];
}
@@ -101,18 +100,19 @@ class RefundRequestService
'status' => Refund::STATUS_PENDING,
'reason' => $reason,
'request' => $requestType,
'note' => $paymentId ? ('duplicate-of-payment#' . $paymentId) : null,
'note' => $paymentId ? ('duplicate-of-payment#'.$paymentId) : null,
'requested_at' => utc_now(),
'created_at' => utc_now(),
'updated_at' => utc_now(),
'updated_by' => $actorId,
]);
if (!$refund) {
if (! $refund) {
Log::error('Failed to create refund request.', [
'parent_id' => $parentId,
'type' => $requestType,
]);
return ['ok' => false, 'message' => 'Failed to create refund request.'];
}