Commit 3c3c2595 authored by Kulya's avatar Kulya 😊

Payment Events triggers

parent 9e3522b2
push
orig* orig*
*.log *.log
logs/* logs/*
......
...@@ -1883,7 +1883,38 @@ function(result){ ...@@ -1883,7 +1883,38 @@ function(result){
'title'=>'Вкладки скриптов', 'title'=>'Вкладки скриптов',
'status'=>'off', 'status'=>'off',
)]; )];
// $res['nextintegration'] = 'status_useradd'; $res['nextintegration'] = 'status_salepaymentsave';
$res['rescheck'] = $arResults;
return $res;
}
private function status_salepaymentsave($r=false) {
//OnPaymentEntitySaved salepaymentsave
$arResults = BxRest::call('event.get');
$integrations = [];
if(!empty($arResults["result"])){
foreach($arResults["result"] as $itg){
if( strtoupper($itg["event"]) == "ONPAYMENTENTITYSAVED" ){
if( $itg["handler"] == $this->config["alovoice_host"] ){
$integrations[] = array(
'code'=>'salepaymentsave',
'title'=>'Отслеживания оплат',
'status'=>'on',
);
}
}
}
}
$res['lines'] = (!empty($integrations)) ? $integrations : [array(
'code'=>'salepaymentsave',
'title'=>'Отслеживания оплат',
'status'=>'off',
)];
// $res['nextintegration'] = 'status_alvcrmmenus';
$res['rescheck'] = $arResults; $res['rescheck'] = $arResults;
return $res; return $res;
...@@ -2149,6 +2180,15 @@ function(result){ ...@@ -2149,6 +2180,15 @@ function(result){
return array( 'do' => $doResult,'more' => $moreResult, 'result' => 'success'); return array( 'do' => $doResult,'more' => $moreResult, 'result' => 'success');
} }
if($r["code"]=='salepaymentsave'){
//OnPaymentEntitySaved salepaymentsave
$doResult = BxRest::call('event.bind',[
'event'=>'ONPAYMENTENTITYSAVED',
'handler'=>$this->config["alovoice_host"],
]);
return array( 'do' => $doResult, 'result' => 'success');
}
if($r["code"]=='contactupdate'){ if($r["code"]=='contactupdate'){
$doResult = BxRest::call('event.bind',[ $doResult = BxRest::call('event.bind',[
'event'=>'ONCRMCONTACTUPDATE', 'event'=>'ONCRMCONTACTUPDATE',
...@@ -2458,6 +2498,15 @@ function(result){ ...@@ -2458,6 +2498,15 @@ function(result){
return array( 'do' => $aloCallScrpUnBindPlcResult, 'result' => 'success'); return array( 'do' => $aloCallScrpUnBindPlcResult, 'result' => 'success');
} }
if($r["code"]=='salepaymentsave'){
//OnPaymentEntitySaved salepaymentsave
$doResult = BxRest::call('event.unbind',[
'event'=>'ONPAYMENTENTITYSAVED',
'handler'=>$this->config["alovoice_host"],
]);
return array( 'do' => $doResult, 'result' => 'success');
}
if($r["code"]=='callcard'){ if($r["code"]=='callcard'){
$doResult = BxRest::call('placement.unbind',[ $doResult = BxRest::call('placement.unbind',[
......
...@@ -138,7 +138,8 @@ require_once (__DIR__.'/keys.php'); ...@@ -138,7 +138,8 @@ require_once (__DIR__.'/keys.php');
public static function getAppSettings() public static function getAppSettings()
{ {
return [ return [
"url" => "https://api.billz.uz/v4/", // "url" => "https://api.billz.uz/v4/",
"url" => "https://api.billz.uz/v1/",
"iss" => "qam.bitrix24.ru", "iss" => "qam.bitrix24.ru",
"sub" => "qamar.bitrix24", "sub" => "qamar.bitrix24",
"secret" => "iRPiwoNhnyhyyLMtADtINSuxHyVmsrXpvtejrAuERdyhhj2EPtMxUorppLUnELVhRmIpnGWsHSpwCzCWsjJLENekd9WumpLjPHvUQDwWmcuwotmhvEyIzzSVkejywICwzKrSDXucLE3SGQtyDVcmpeFBneSMmxuKMjo6Q2kGIGbfQkupBm3mMGXmPIEpwMNYNV38VcemDd6fPYQnRcyYERXctSGMTXFwdmDLoYBE6btCfNZfkdoBFmbhpQJpBkifPUScyQRGeRbkFxjEwvnXjhCSCMbpkjjfWkFeesnPupKkiKKKL8MkSKx6HuRIzbmbcGNJNWtrkx3sSM1MjPzCTiWE2wM1SZQWVYu8hDBVUVDKxBeRisKTjjeidboGWJNhWcpzQEJe4cMSjBvNNxxBiveZ0iDdMpcSYsJNfoVTT8mSkavRzmHeeSGXKSDDTmwjUwfoPsHhWJTt7BrauLIRhIrjKnsYZscNvSGYRDyVwBXaS8YfELUBUMSFjYnpjJVs" "secret" => "iRPiwoNhnyhyyLMtADtINSuxHyVmsrXpvtejrAuERdyhhj2EPtMxUorppLUnELVhRmIpnGWsHSpwCzCWsjJLENekd9WumpLjPHvUQDwWmcuwotmhvEyIzzSVkejywICwzKrSDXucLE3SGQtyDVcmpeFBneSMmxuKMjo6Q2kGIGbfQkupBm3mMGXmPIEpwMNYNV38VcemDd6fPYQnRcyYERXctSGMTXFwdmDLoYBE6btCfNZfkdoBFmbhpQJpBkifPUScyQRGeRbkFxjEwvnXjhCSCMbpkjjfWkFeesnPupKkiKKKL8MkSKx6HuRIzbmbcGNJNWtrkx3sSM1MjPzCTiWE2wM1SZQWVYu8hDBVUVDKxBeRisKTjjeidboGWJNhWcpzQEJe4cMSjBvNNxxBiveZ0iDdMpcSYsJNfoVTT8mSkavRzmHeeSGXKSDDTmwjUwfoPsHhWJTt7BrauLIRhIrjKnsYZscNvSGYRDyVwBXaS8YfELUBUMSFjYnpjJVs"
......
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