mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-30 09:54:16 +00:00
Completes Order Steps on Unity
This commit is contained in:
@@ -10,19 +10,21 @@ class UpdatesContractObligation
|
||||
{
|
||||
private $getAccessToken;
|
||||
|
||||
private $createEntityEndpoint;
|
||||
private $updateContractStatusEndpoint;
|
||||
|
||||
public function __construct(GetAccessToken $getAccessToken)
|
||||
{
|
||||
$this->createEntityEndpoint = Config::get('unity.url').Config::get('unity.create_entity_endpoint');
|
||||
$this->updateContractStatusEndpoint = Config::get('unity.url').Config::get('unity.endpoint.update_obligation_status');
|
||||
$this->getAccessToken = $getAccessToken;
|
||||
}
|
||||
|
||||
public function execute($entity_name){
|
||||
public function execute($contract_entity_signature, $obligation_hash_id){
|
||||
|
||||
$accesToken=$this->getAccessToken->execute();
|
||||
$accessToken=$this->getAccessToken->execute();
|
||||
|
||||
$response = Http::withToken($accesToken)->post($this->createEntityEndpoint,['name'=>$entity_name])->object();
|
||||
$this->updateContractStatusEndpoint = str_replace('{hash}',$obligation_hash_id,$this->updateContractStatusEndpoint);
|
||||
|
||||
$response = Http::withToken($accessToken)->put($this->updateContractStatusEndpoint,['entity_signature_id'=>$contract_entity_signature])->object();
|
||||
|
||||
return (isset($response->data)) ? $response->data : null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user