broker contact sender fixed

This commit is contained in:
Thekindbull 2025-08-29 10:42:11 +08:00
parent 74da87ecea
commit 96362d7ed4
3 changed files with 14 additions and 1 deletions

View File

@ -176,11 +176,15 @@ public function sendToBitrix(Deal $deal)
'BROKER_SECOND_NAME' => $agentName['secondName'],
'BROKER_PHONE' => $agent->user->phone,
'BROKER_INN' => $agent->company->inn,
'BROKER_CONTACT_ID' => $agent->bitrixId(),
//'BROKER_CONTACT' => $agent->bitrixId(),
'OBJECT_NAME' => Complex::find($this->client['complexId'])->name,
'CALLBACK_URL' => route('api.client', ['hash' => $deal->confirmToken]),
];
$sender = new SendClient($deal->id, $data);
if ($bitrixId = $agent->bitrixId())
{
$sender->setAgentId($bitrixId);
}
$response = $sender->send();
if ($response)
{

View File

@ -22,6 +22,8 @@ class SendClient
const BROKER_PHONE = "PROPERTY_99";
const OBJECT_NAME = "PROPERTY_100";
const CALLBACK_URL = "PROPERTY_105";
const BROKER_CONTACT = "PROPERTY_108";
private $data = [];
public function __construct($id, $data)
@ -50,6 +52,12 @@ public function setBitrixId($id)
{
$this->data['PROPERTY_123'] = $id;
}
public function setAgentId($id)
{
$this->data['PROPERTY_108'] = $id;
}
public function send()
{
$data = [

View File

@ -121,6 +121,7 @@ function sendDealToBitrix(Deal $deal)
];
$sender = new SendClient($deal->id, $data);
$sender->setBitrixId($deal->bitrixId());
$sender->setAgentId($deal->agent->bitrixId());
$response = $sender->send();
if ($response)
{