improve
This commit is contained in:
1 parent
bf5d8f6d05
commit
4b5e2a9f94
2 files changed
+11
-6
No files matched your search
@@ -18,8 +18,8 @@ public function showCardBalance(Card $record): View
|
||||
{
|
||||
/** @var \App\Modules\CardBalance\Type\CardBalanceResponse */
|
||||
$data = $this->fetchCardBalance(
|
||||
passport_serie: user()->getOption('passport_serie'),
|
||||
passport_id: user()->getOption('passport_id'),
|
||||
passport_serie: user()->getOption('passport_serie') ?? 'I',
|
||||
passport_id: user()->getOption('passport_id') ?? '909090',
|
||||
card_masked: Str::mask($record->number, '*', 6, 6),
|
||||
card_expire_date: $record->month.'/'.substr($record->year, 2),
|
||||
);
|
||||
@@ -68,8 +68,11 @@ public function fetchCardBalance($passport_serie, $passport_id, $card_masked, $c
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
return Str::isJson($response)
|
||||
/** @var object */
|
||||
$safeResponse = Str::isJson($response)
|
||||
? json_decode($response)
|
||||
: emptyClass(errCode: 1, message: 'Connection issue to VP');
|
||||
|
||||
return $safeResponse;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user