mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-20 13:04:11 +00:00
35 lines
916 B
PHP
35 lines
916 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Unity\Services;
|
|
|
|
use Illuminate\Support\Facades\Config;
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
class CreatesContract
|
|
{
|
|
/** @var GetAccessToken */
|
|
private $getAccessToken;
|
|
|
|
private $createContract;
|
|
|
|
private $contract_hash_id;
|
|
|
|
public function __construct(GetAccessToken $getAccessToken)
|
|
{
|
|
dd(Config::get('unity.url'));
|
|
$this->createContract = Config::get('unity.url').Config::get('unity.endpoint.create_contract');
|
|
$this->getAccessToken = $getAccessToken;
|
|
$this->contract_hash_id = Config::get('unity.contract_template_hash_id');
|
|
}
|
|
|
|
public function execute(){
|
|
|
|
$accessToken= $this->getAccessToken->execute();
|
|
|
|
$response = Http::withToken($accessToken)->post($this->createContract,['contract_template_id'=>[$this->contract_hash_id]])->object();
|
|
dd($response);
|
|
return $response->data;
|
|
|
|
}
|
|
}
|