This commit is contained in:
2025-10-28 21:59:12 +05:00
parent 3409849fa3
commit 5edcde1e4c
3 changed files with 26 additions and 9 deletions

View File

@@ -20,16 +20,16 @@ class CardTransactionRepository
/**
* Download card transaction
*
* @param array{start_date: string, end_date: string} $data
* @param array<inst, string>|array{start_date: string, end_date: string} $data
*/
public function downloadCardTransaction(array $data, Card $record, Component $livewire)
public function downloadCardTransaction(array $data, Card $record, Component $livewire): null
{
$start_date = Carbon::create($data['start_date']);
$end_date = Carbon::create($data['end_date']);
$start_date = new Carbon($data['start_date']);
$end_date = new Carbon($data['end_date']);
$apiResponse = $this->fetchApi(
passport_serie: user()->getOption('passport_serie') ?? 'I',
passport_id: user()->getOption('passport_id') ?? '909090',
passport_serie: user()->passport_serie(),
passport_id: user()->passport_id(),
card_number_masked: Str::mask($record->number, '*', 6, 6),
card_expire_date: $record->month.'/'.substr($record->year, 2),
start_date: $start_date->format('d.m.Y'),
@@ -47,7 +47,7 @@ class CardTransactionRepository
->title($response->message)
->send();
return;
return null;
}
$url = $this->generateFileUrl($record, $response);
@@ -55,6 +55,7 @@ class CardTransactionRepository
// Tell Livewire to open it in a new tab
$livewire->js("window.open('{$url}', '_blank')");
return null;
}
/**