mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-19 20:44:01 +00:00
31 lines
853 B
PHP
31 lines
853 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Unity\Services;
|
|
|
|
use Config;
|
|
use Illuminate\Support\Facades\Http;
|
|
use App\Classes\Modules\Unity\Services\GetAccessToken;
|
|
|
|
class CreatesEntitySignature
|
|
{
|
|
private $getAccessToken;
|
|
|
|
private $createEntitySignatureEndpoint;
|
|
|
|
public function __construct(GetAccessToken $getAccessToken)
|
|
{
|
|
$this->createEntitySignatureEndpoint = Config::get('unity.url').Config::get('unity.endpoint.create_entity_signature');
|
|
$this->getAccessToken = $getAccessToken;
|
|
}
|
|
|
|
public function execute(string $entity_hash_id){
|
|
|
|
$accesToken=$this->getAccessToken->execute();
|
|
|
|
$response = Http::withToken($accesToken)->post($this->createEntitySignatureEndpoint,['entity_id'=>[$entity_hash_id], 'type'=>'1'])->object();
|
|
|
|
return (isset($response->data)) ? $response->data : null;
|
|
|
|
}
|
|
}
|