wip
This commit is contained in:
@@ -18,8 +18,8 @@ class CardBalanceRepository
|
||||
{
|
||||
/** @var \App\Modules\CardBalance\Types\CardBalanceResponse */
|
||||
$data = $this->fetchCardBalance(
|
||||
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_masked: Str::mask($record->number, '*', 6, 6),
|
||||
card_expire_date: $record->month.'/'.substr($record->year, 2),
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,4 +40,20 @@ trait UserAdjustments
|
||||
{
|
||||
return $this->options && array_key_exists($option, $this->options) ? $this->options[$option] : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Passport serie
|
||||
*/
|
||||
public function passport_serie(): string
|
||||
{
|
||||
return (string) $this->getOption('passport_serie');
|
||||
}
|
||||
|
||||
/**
|
||||
* Passport id
|
||||
*/
|
||||
public function passport_id(): string
|
||||
{
|
||||
return (string) $this->getOption('passport_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user