mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-21 21:44:09 +00:00
43 lines
1.0 KiB
PHP
43 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Unity\Services;
|
|
|
|
use Illuminate\Support\Facades\Config;
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
class CreatesContract
|
|
{
|
|
/** @var GetAccessToken */
|
|
private $getAccessToken;
|
|
|
|
/** @var string */
|
|
private $createContract;
|
|
|
|
/** @var string */
|
|
private $contract_hash_id;
|
|
|
|
/**
|
|
* CreatesContract constructor.
|
|
* @param GetAccessToken $getAccessToken
|
|
* @param string $createContract
|
|
* @param string $contract_hash_id
|
|
*/
|
|
public function __construct(GetAccessToken $getAccessToken, string $createContract, string $contract_hash_id)
|
|
{
|
|
$this->getAccessToken = $getAccessToken;
|
|
$this->createContract = $createContract;
|
|
$this->contract_hash_id = $contract_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;
|
|
|
|
}
|
|
}
|