Fix hooks issues
This commit is contained in:
@@ -43,6 +43,7 @@ abstract class BaseController extends Controller
|
|||||||
public $primary_image_sever='';
|
public $primary_image_sever='';
|
||||||
public $server_tag='';
|
public $server_tag='';
|
||||||
public $wrenchboard=null;
|
public $wrenchboard=null;
|
||||||
|
public $micro_service_net1;
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
@@ -59,6 +60,7 @@ abstract class BaseController extends Controller
|
|||||||
$this->current_env = $this->getSiteConfigurations("system.live");
|
$this->current_env = $this->getSiteConfigurations("system.live");
|
||||||
$this->primary_image_sever = $this->getSiteConfigurations("system.primary_image_sever");
|
$this->primary_image_sever = $this->getSiteConfigurations("system.primary_image_sever");
|
||||||
$this->server_tag = $this->getSiteConfigurations("system.server_tag");
|
$this->server_tag = $this->getSiteConfigurations("system.server_tag");
|
||||||
|
$this->micro_service_net1 = $this->getSiteConfigurations("system.micro_service_net1"); //"10.10.1
|
||||||
//$this->cache_server = $this->getSiteConfigurations("system.cache_host");
|
//$this->cache_server = $this->getSiteConfigurations("system.cache_host");
|
||||||
|
|
||||||
// $redis = [
|
// $redis = [
|
||||||
|
|||||||
@@ -65,10 +65,11 @@ class WrenchBanners extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$current_env = $this->getSiteConfigurations("system.live");
|
|
||||||
$primary_image_sever = $this->getSiteConfigurations("system.primary_image_sever");
|
// $current_env = $this->getSiteConfigurations("system.live");
|
||||||
$server_tag = $this->getSiteConfigurations("system.server_tag");
|
// $primary_image_sever = $this->getSiteConfigurations("system.primary_image_sever");
|
||||||
$micro_service_net1 = $this->getSiteConfigurations("system.micro_service_net1"); //"10.10.10.120";
|
// $server_tag = $this->getSiteConfigurations("system.server_tag");
|
||||||
|
//$micro_service_net1 = $this->getSiteConfigurations("system.micro_service_net1"); //"10.10.10.120";
|
||||||
|
|
||||||
// echo "EXYTACT INPUT DATA HERE";
|
// echo "EXYTACT INPUT DATA HERE";
|
||||||
$raw_json = file_get_contents('php://input');
|
$raw_json = file_get_contents('php://input');
|
||||||
@@ -98,7 +99,7 @@ class WrenchBanners extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $call_backend == true && $in["action"] !='' ){
|
if ( $call_backend == true && $in["action"] !='' ){
|
||||||
$local_url = "http://".$micro_service_net1.":3032/familybanners";
|
$local_url = "http://".$this->micro_service_net1.":3032/familybanners";
|
||||||
$out = $this->APIcall('GET', $local_url, $in);
|
$out = $this->APIcall('GET', $local_url, $in);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -107,13 +108,15 @@ class WrenchBanners extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->doCacheStep($in, $out);
|
$this->doCacheStep($in, $out);
|
||||||
$final_out = $out; // start from all out
|
// $final_out = $out; // start from all out
|
||||||
$final_out["environment"] = $current_env + 0; // force convert to interger = $this->getSiteConfigurations("system.live");
|
// $final_out["environment"] = $current_env + 0; // force convert to interger = $this->getSiteConfigurations("system.live");
|
||||||
$final_out["session_image_server"] = $primary_image_sever; // ( $final_out["environment"] > 0 )? 'https://apigate.nebula.g1.wrenchboard.com/en/wrench/api/v1/getmedia/' : "https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1/getmedia/";
|
// $final_out["session_image_server"] = $primary_image_sever; // ( $final_out["environment"] > 0 )? 'https://apigate.nebula.g1.wrenchboard.com/en/wrench/api/v1/getmedia/' : "https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1/getmedia/";
|
||||||
$final_out["server_tag"] = $server_tag;
|
// $final_out["server_tag"] = $server_tag;
|
||||||
$final_out["language"] = "en";
|
// $final_out["language"] = "en";
|
||||||
$final_out["ip_loc"] = $ip_loc;
|
// $final_out["ip_loc"] = $ip_loc;
|
||||||
return json_encode( $final_out );
|
// return json_encode( $final_out );
|
||||||
|
return $this->summaryReturnData($in,$out); //json_encode( $final_out );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -27,6 +27,8 @@ class WrenchHooks extends BaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
public function flutter(){
|
public function flutter(){
|
||||||
|
$enable_event_publish = true;
|
||||||
|
$microPort = "3037"; // wallet service port
|
||||||
|
|
||||||
$raw_json = file_get_contents('php://input');
|
$raw_json = file_get_contents('php://input');
|
||||||
$raw_array = json_decode($raw_json, true);
|
$raw_array = json_decode($raw_json, true);
|
||||||
@@ -37,48 +39,57 @@ class WrenchHooks extends BaseController
|
|||||||
log_message('critical', "WrenchHooks flutter fail => ".$e->getMessage());
|
log_message('critical', "WrenchHooks flutter fail => ".$e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( $enable_event_publish == true && !empty($in) ){
|
||||||
|
$local_url = "http://".$this->micro_service_net1.":".$microPort."/flutterOkHook";
|
||||||
|
$out = $this->APIcall('GET', $local_url, $in);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isset( $in["event"]) & isset($in["data"]) ){
|
||||||
|
$inx = $in["data"];
|
||||||
|
$inx["txRef"] = $in["tx_ref"];
|
||||||
|
$inx["orderRef"] = $in["flw_ref"];
|
||||||
|
$inx["flwRef"] = $in["flw_ref"];
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
log_message('critical', "WrenchHooks flutter");
|
log_message('critical', "WrenchHooks flutter");
|
||||||
log_message('critical', "WrenchHooks ***************************** flutter");
|
log_message('critical', "WrenchHooks ***************************** flutter");
|
||||||
log_message('critical', "WrenchHooks-CALL PREPARE DATA".serialize($in) );
|
log_message('critical', "WrenchHooks-CALL PREPARE DATA".serialize($in) );
|
||||||
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$in["event.type"] );
|
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$inx["event.type"] );
|
||||||
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$in["status"] );
|
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$inx["status"] );
|
||||||
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$in["txRef"] );
|
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$inx["txRef"] );
|
||||||
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$in["flwRef"] );
|
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$inx["flwRef"] );
|
||||||
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$in["orderRef"] );
|
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$inx["orderRef"] );
|
||||||
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$in["amount"] );
|
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$inx["amount"] );
|
||||||
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$in["appfee"] );
|
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$inx["appfee"] );
|
||||||
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$in["customer"]["id"] );
|
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$inx["customer"]["id"] );
|
||||||
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$in["customer"]["AccountId"] );
|
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$inx["customer"]["AccountId"] );
|
||||||
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$in["customer"]["fullName"] );
|
log_message('critical', "WrenchHooks-CALL ********** RETURN *************** DATA".$inx["customer"]["fullName"] );
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
log_message('critical', "WrenchHooks flutter fail => ".$e->getMessage());
|
log_message('critical', "WrenchHooks flutter fail => ".$e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
"event_type" => $in["event.type"],
|
"event_type" => $inx["event.type"],
|
||||||
"status" => $in["status"],
|
"status" => $inx["status"],
|
||||||
"txRef" => $in["txRef"],
|
"txRef" => $inx["txRef"],
|
||||||
"flwRef" => $in["orderRef"],
|
"flwRef" => $inx["orderRef"],
|
||||||
"orderRef" => $in["orderRef"] ,
|
"orderRef" => $inx["orderRef"] ,
|
||||||
"amount" => $in["amount"]*100 ,
|
"amount" => $inx["amount"]*100 ,
|
||||||
"appfee" => $in["appfee"]*100,
|
"appfee" => $inx["appfee"]*100,
|
||||||
"customer_id" => $in["customer"]["id"],
|
"customer_id" => $inx["customer"]["id"],
|
||||||
"AccountId" => $in["customer"]["AccountId"],
|
"AccountId" => $inx["customer"]["AccountId"],
|
||||||
"fullName" => $in["customer"]["fullName"],
|
"fullName" => $inx["customer"]["fullName"],
|
||||||
"action" => WRECNH_CREDIT_HOOKS_FULUTTER,
|
"action" => WRECNH_CREDIT_HOOKS_FULUTTER,
|
||||||
"raw_result" => serialize($in),
|
"raw_result" => serialize($in),
|
||||||
];
|
];
|
||||||
|
|
||||||
if ( $data["action"] !='' ){
|
if ( $data["action"] !='' ){
|
||||||
//$wrenchboard = new \App\Models\BackendModel(); in base controller now
|
|
||||||
$ret = $this->wrenchboard->wrenchboard_api($data, $out);
|
$ret = $this->wrenchboard->wrenchboard_api($data, $out);
|
||||||
$out['internal_return'] = $ret;
|
$out['internal_return'] = $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user