fix gitlab tests
This commit is contained in:
@@ -18,7 +18,8 @@ class RefundRequestService
|
||||
private RefundSummaryService $summaryService,
|
||||
private RefundNotificationService $notifications,
|
||||
private ApplicationUrlService $urls,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
public function requestRefund(array $payload, int $actorId): array
|
||||
{
|
||||
@@ -29,12 +30,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.'];
|
||||
}
|
||||
|
||||
@@ -100,19 +101,18 @@ 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.'];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user