I gonna to integrate payment gateway . My site located in vitural hosting. I'm sending curl to payment gateway to get from them payment url.
$data = array(
"amount" => $request->amount,
"currency" => 'KZT',
"merchant_order_id" => 12,
"description" => 'payment',
"email" => $user->email,
"name" => $user->name
);
$headers = [
'Authorization: Basic '.'YXRhbXVyYTopoPzQncxeDk=',
'Content-Type: application/json',
'Accept-Language: ru',
];
$url=$client->request('post', 'https://sandbox.com/orders/create',[
'headers' => $headers,
'form_params' => $data,
'cert' => ['/cert', 'bDsc1F2fmNeK']
]);
Here I sending basic auth and ssl .
My certificatation located in storage/cert.pem
cert route is Route::get('/cert', 'ProtectedController@getcert');
and getcert method is
public function getcert(){
$path = 'cert.pem';
return Storage::download($path);
}
First question is : Is this safe to store certification in storage and access it like this ? Can anyone download it if cert path will be revealed. Next question is I'm getting error
file_exists(): open_basedir restriction in effect. File(/cert) is not within the allowed path(s): (/var/www/vhosts/site.kz/:/tmp/)
as I understand Storage:download wants path storage to be in open_basedir . I asked hoster I cant change open_basedir in virtual hosting . Am I need to move to vds or there another way?