Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AmiBX
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bitrix
AmiBX
Commits
563221c8
Commit
563221c8
authored
Feb 12, 2022
by
Kulya
😊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add billz clientId to order 1
parent
afd25a23
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
18 deletions
+40
-18
AloVoiceConnector.php
vendor/alovoice/src/AloVoiceConnector.php
+21
-1
AloVoiceHandle.php
vendor/alovoice/src/AloVoiceHandle.php
+4
-0
AloVoiceRest.php
vendor/alovoice/src/AloVoiceRest.php
+10
-9
BillzRest.php
vendor/alovoice/src/BillzRest.php
+5
-8
No files found.
vendor/alovoice/src/AloVoiceConnector.php
View file @
563221c8
...
...
@@ -2338,6 +2338,25 @@ CFU=';
public
function
beginCall
(
$data
){
if
(
!
empty
(
$data
[
"BX24_CALLID"
])){
$updRes
=
self
::
statAPI
(
"update"
,[
"ID"
=>
$data
[
"BX24_CALLID"
],
"KEY"
=>
"4Ad49wD"
,
'fields'
=>
[
"CALLDATE"
=>
date
(
"Y-m-d"
),
"CHANNEL"
=>
(
!
empty
(
$data
[
"channel"
]))
?
$data
[
"channel"
]
:
""
,
"TIME_BEGINCALL"
=>
time
(),
"DIALSTATUS"
=>
'BEGIN'
,
"CALL_DATETIME"
=>
date
(
"Y-m-d H:i:s"
),
"HOUR"
=>
date
(
"H"
),
]
]);
self
::
eLog
(
$updRes
,
"--== beginCall STATAPI UPD RES:"
);
return
$data
[
"BX24_CALLID"
];
}
$stRes
=
self
::
statAPI
(
"insert"
,[
"KEY"
=>
"4Ad49wD"
,
'fields'
=>
[
...
...
@@ -2358,6 +2377,7 @@ CFU=';
else
{
return
0
;
}
}
public
function
startCall
(
$queryData
,
$full
=
[]){
...
...
vendor/alovoice/src/AloVoiceHandle.php
View file @
563221c8
...
...
@@ -244,6 +244,10 @@ class AloVoiceHandle implements \PAMI\Listener\IEventListener
elseif
(
$eventName
==
"Newchannel"
&&
$eventKeys
[
"priority"
]
==
"1"
&&
$eventKeys
[
"uniqueid"
]
==
$eventKeys
[
"linkedid"
])
{
self
::
eLog
(
$eventKeys
,
"--== NEW NewchannelEvent new Call Handle"
.
$eventKeys
[
"linkedid"
]
);
$calls
[
$eventKeys
[
"linkedid"
]]
=
$eventKeys
;
//new AloVoiceHandle($event);
if
(
!
empty
(
$bxchannels
[
$eventKeys
[
"linkedid"
]][
"BX24_CALLID"
])){
$eventKeys
[
"BX24_CALLID"
]
=
$bxchannels
[
$eventKeys
[
"linkedid"
]][
"BX24_CALLID"
];
}
$bxchannels
[
$eventKeys
[
"linkedid"
]]
=
$eventKeys
;
$bxchannels
[
$eventKeys
[
"linkedid"
]][
"BX24_begincall"
]
=
time
();
$bxchannels
[
$eventKeys
[
"linkedid"
]][
"BX24_CALLTONUM"
]
=
$eventKeys
[
"exten"
];
...
...
vendor/alovoice/src/AloVoiceRest.php
View file @
563221c8
...
...
@@ -754,9 +754,12 @@ class AloVoiceRest
];
if
(
$order_client_id
=
self
::
process_order_client
(
$order
[
"id"
])){
$arOrderParams
[
"client_id"
]
=
$order_client_id
;
}
$arResOrders
[]
=
BillzRest
::
createOrder
(
$arOrderParams
);
$arOrder
=
self
::
process_order_client
(
$order
[
"id"
]);
}
self
::
set_orders_last_update
();
...
...
@@ -778,7 +781,7 @@ class AloVoiceRest
if
(
empty
(
$id
)){
$id
=
56
;
}
$res
=
BxRest
::
call
(
"sale.order.get"
,[
"id"
=>
$id
]);
ALVC
::
eLog
(
$res
[
"result"
],
"------ Billz :: Order RES:"
);
//
ALVC::eLog($res["result"],"------ Billz :: Order RES:");
if
(
empty
(
$res
[
"result"
][
"order"
][
'clients'
])){
return
false
;
}
$client
=
$res
[
"result"
][
"order"
][
'clients'
][
0
];
...
...
@@ -786,7 +789,7 @@ class AloVoiceRest
$clientTypeId
=
$client
[
"entityTypeId"
];
if
(
$clientTypeId
==
3
){
$resCont
=
BxRest
::
call
(
"crm.contact.get"
,[
"id"
=>
$clientId
]);
ALVC
::
eLog
(
$resCont
[
"result"
],
"------ Billz :: Client(contact) RES:"
);
//
ALVC::eLog($resCont["result"],"------ Billz :: Client(contact) RES:");
if
(
empty
(
$resCont
[
"result"
])){
return
false
;
...
...
@@ -806,19 +809,17 @@ class AloVoiceRest
$arClientParams
[
'birthDate'
]
=
$arBdate
[
0
];
}
ALVC
::
eLog
(
$arClientParams
,
"------ Billz :: Client Add PARAMS:"
);
$clientAddRes
=
BillzRest
::
createClient
(
$arClientParams
);
ALVC
::
eLog
(
$clientAddRes
,
"------ Billz :: Client Add RES:"
);
//
ALVC::eLog($clientAddRes,"------ Billz :: Client Add RES:");
if
(
!
empty
(
$clientAddRes
[
"answer"
][
"result"
][
"clientId"
])){
$blzClientID
=
$clientAddRes
[
"answer"
][
"result"
][
"clientId"
];
$resContUpd
=
BxRest
::
call
(
"crm.contact.update"
,[
"id"
=>
$clientId
,
"fields"
=>
[
"UF_CRM_1644411792448"
=>
$blzClientID
]
]);
ALVC
::
eLog
(
$resContUpd
,
"------ Billz :: Client(contact) Update RES:"
);
//
ALVC::eLog($resContUpd,"------ Billz :: Client(contact) Update RES:");
return
$blzClientID
;
}
}
}
return
false
;
}
private
function
get_bx_order_products
(
$id
=
false
)
{
...
...
vendor/alovoice/src/BillzRest.php
View file @
563221c8
...
...
@@ -90,7 +90,9 @@ require_once (__DIR__.'/keys.php');
];
$qPparams
[
'subTotalPrice'
]
=
$qPparams
[
'subTotalPrice'
]
+
$price
;
}
if
(){
$qPparams
[
'clientId'
]
=
$params
[
"client_id"
];
}
$qPparams
[
'orderID'
]
=
$params
[
"order_id"
];
$qPparams
[
'dateCreated'
]
=
date
(
'Y-m-d'
)
.
'T'
.
date
(
'H:i:s'
)
.
'Z'
;
$qPparams
[
'datePaid'
]
=
date
(
'Y-m-d'
)
.
'T'
.
date
(
'H:i:s'
)
.
'Z'
;
...
...
@@ -189,7 +191,7 @@ require_once (__DIR__.'/keys.php');
$result
=
[];
if
(
!
empty
(
$arSettings
))
{
if
(
$method
==
"orders.create"
)
{
$arSettings
[
"apiversion"
]
=
"v
2"
;
}
if
(
$method
==
"orders.create"
)
{
$arSettings
[
"apiversion"
]
=
"v
3"
;
}
//v2
if
(
$method
==
"client.create"
)
{
$arSettings
[
"apiversion"
]
=
"v1"
;
}
$url
=
$arSettings
[
"url"
]
.
$arSettings
[
"apiversion"
]
.
"/"
;
...
...
@@ -201,12 +203,7 @@ require_once (__DIR__.'/keys.php');
];
$sendData
=
json_encode
(
$arData
);
ALVC
::
eLog
(
$sendData
,
"------ Billz :: curl req_Orig:"
);
if
(
$method
==
"client.create"
){
$rsendData
=
'{"jsonrpc":"2.0","method":"client.create","params":{"phone":"998931830000","firstName":"Ivan","lastName":"Petrov","gender":1,"birthDate":"1999-01-17"},"id":"1"}'
;
ALVC
::
eLog
(
$rsendData
,
"------ Billz :: curl req_True:"
);
}
// ALVC::eLog($sendData,"------ Billz :: curl req_Orig:");
$result
[
"params"
]
=
$sendData
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment