2020-04-15 23:09:27 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
namespace App\Services;
|
|
|
|
|
|
|
|
|
|
|
|
use App\Traits\ConsumesExternalService;
|
|
|
|
|
|
|
|
class WalletService
|
|
|
|
{
|
|
|
|
use ConsumesExternalService;
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $baseUri ;
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $key ;
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this->baseUri = config('services.wallet_service.base_uri');
|
|
|
|
$this->key = config('services.wallet_service.key');
|
|
|
|
}
|
|
|
|
|
2020-04-28 17:35:28 +00:00
|
|
|
public function post($uri , $data, $headers)
|
2020-04-15 23:09:27 +00:00
|
|
|
{
|
2020-04-28 17:35:28 +00:00
|
|
|
return $this->perfomRequest('POST',$uri,$data,$headers);
|
2020-04-15 23:09:27 +00:00
|
|
|
}
|
|
|
|
|
2020-06-20 15:09:37 +00:00
|
|
|
public function postFiles($uri , $data, $headers)
|
|
|
|
{
|
|
|
|
return $this->perfomRequestWithFiles('POST',$uri,$data,$headers);
|
|
|
|
}
|
|
|
|
|
2020-04-28 17:35:28 +00:00
|
|
|
public function get($uri , $data, $headers)
|
2020-04-15 23:09:27 +00:00
|
|
|
{
|
2020-04-28 17:35:28 +00:00
|
|
|
return $this->perfomRequest('GET',$uri,$data,$headers);
|
2020-04-15 23:09:27 +00:00
|
|
|
}
|
2020-04-25 11:43:44 +00:00
|
|
|
|
2020-04-28 17:35:28 +00:00
|
|
|
public function put($uri , $data, $headers)
|
2020-04-25 11:43:44 +00:00
|
|
|
{
|
2020-04-28 17:35:28 +00:00
|
|
|
return $this->perfomRequest('PUT',$uri,$data,$headers);
|
2020-04-25 11:43:44 +00:00
|
|
|
}
|
2020-06-11 13:44:34 +00:00
|
|
|
|
|
|
|
public function delete($uri , $data, $headers)
|
|
|
|
{
|
|
|
|
return $this->perfomRequest('DELETE',$uri,$data,$headers);
|
|
|
|
}
|
2020-04-15 23:09:27 +00:00
|
|
|
}
|