broker contact sender fixed
This commit is contained in:
parent
74da87ecea
commit
96362d7ed4
@ -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)
|
||||
{
|
||||
|
||||
@ -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 = [
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user