wip
This commit is contained in:
@@ -3,12 +3,14 @@
|
||||
use App\Events\EventType;
|
||||
use App\Models\System\Roles\Permission;
|
||||
use App\Models\System\Verification;
|
||||
use App\Nova\Resources\Order\Card\CardTransaction\Actions\DownloadCardTransaction;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Psr7\Request as GuzzleRequest;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Str;
|
||||
use Stevebauman\Location\Facades\Location;
|
||||
use Symfony\Component\HttpFoundation\IpUtils;
|
||||
|
||||
@@ -290,6 +292,9 @@ function cached(string $name, mixed $value, int $seconds = 60): mixed
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* view-loan-order-permission-id
|
||||
*/
|
||||
function view_loan_order_permission_id(): int
|
||||
{
|
||||
return Cache::rememberForever('view_loan_order_permission_id', function () {
|
||||
@@ -297,6 +302,29 @@ function view_loan_order_permission_id(): int
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* VP fetch client info all
|
||||
*
|
||||
* @param $model
|
||||
* @param $start_date
|
||||
* @param $end_date
|
||||
*/
|
||||
function vp_fetch_ClientInfoAll($model, $start_date, $end_date)
|
||||
{
|
||||
$response = DownloadCardTransaction::make()->fetchApi(
|
||||
passport_serie: $model->passport_serie,
|
||||
passport_id: $model->passport_id,
|
||||
card_number_masked: Str::mask($model->card_number, '*', 6, 6),
|
||||
card_expire_date: $model->card_month.'/'.substr($model->card_year, 2),
|
||||
start_date: $start_date,
|
||||
end_date: $end_date,
|
||||
);
|
||||
|
||||
return Str::isJson($response)
|
||||
? json_decode($response)
|
||||
: emptyClass(errCode: 1, message: 'Connection issue to VP');
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an anonymous class that acts as a dynamic object.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user