Commit 4ae6225f authored by Kulya's avatar Kulya 😊

Begin adding Client to Billz 4

parent 5e9295eb
......@@ -787,11 +787,23 @@ class AloVoiceRest
$resCont = BxRest::call("crm.contact.get",[ "id" => $clientId ]);
ALVC::eLog($resCont["result"],"------ Billz :: Client(contact) RES:");
if(!empty($resCont["UF_CRM_1644411792448"])){
if(empty($resCont["UF_CRM_1644411792448"]) && !empty($resCont["PHONE"][0]["VALUE"])){
$arClientParams = [ "phone" => $resCont["PHONE"][0]["VALUE"] ];
if(!empty( $resCont["NAME"] )){
$arClientParams['firstName'] = $resCont["NAME"];
}
if(!empty( $resCont["SECOND_NAME"] )){
$arClientParams['lastName'] = $resCont["SECOND_NAME"];
}
if(!empty( $resCont["BIRTHDATE"] )){
$arClientParams['birthDate'] = $resCont["BIRTHDATE"];
}
$clientAddRes = BillzRest::createOrder($arClientParams);
ALVC::eLog($clientAddRes,"------ Billz :: Client Add RES:");
}
}
//
}
private function get_bx_order_products($id=false) {
......
......@@ -48,10 +48,7 @@ require_once (__DIR__.'/keys.php');
}
*/
$client_params = [ "firstName" => (!empty($params["NAME"])) ? $params["NAME"] : "New Client"];
// if(!empty())
$result = static::callCurl("client.create",$client_params);
$result = static::callCurl("client.create",$params);
return $result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment