Dodano logiranje api klicev za placila (errorji in uspesni klici)
This commit is contained in:
parent
08e6860694
commit
23f71002b0
@ -18,6 +18,7 @@ class SurveyLog {
|
||||
const INFO = 'INFO';
|
||||
const MAILER = 'MAILER';
|
||||
const IZVOZ = 'IZVOZ';
|
||||
const PAYMENT = 'PLACILO';
|
||||
|
||||
|
||||
private $messages = array();
|
||||
|
@ -22,6 +22,7 @@ class ApiNarocilaController{
|
||||
// Preberemo poslane podatke
|
||||
$this->processCall();
|
||||
|
||||
|
||||
// Preverimo, ce je klic ok (token)
|
||||
//if($this->checkToken()){
|
||||
|
||||
@ -29,6 +30,28 @@ class ApiNarocilaController{
|
||||
$this->executeAction();
|
||||
//}
|
||||
|
||||
|
||||
// Logiramo response klica
|
||||
$SL = new SurveyLog();
|
||||
|
||||
if($this->response['success'] == true){
|
||||
|
||||
if(isset($this->data['email']))
|
||||
$call_data = ', '.$this->data['email'];
|
||||
elseif(isset($this->data['narocilo_id']))
|
||||
$call_data = ', '.$this->data['narocilo_id'];
|
||||
else
|
||||
$call_data = '';
|
||||
|
||||
$SL->addMessage(SurveyLog::PAYMENT, "USPEŠEN KLIC (".$this->params['action'] . $call_data.")");
|
||||
}
|
||||
else{
|
||||
$SL->addMessage(SurveyLog::PAYMENT, "NAPAKA pri klicu za plačevanje ".$this->params['action'].": ".$this->response['error']);
|
||||
}
|
||||
|
||||
$SL->write();
|
||||
|
||||
|
||||
// Vrnemo json objekt responsa
|
||||
$this->processReturn();
|
||||
}
|
||||
@ -76,6 +99,7 @@ class ApiNarocilaController{
|
||||
return true;
|
||||
else{
|
||||
$this->response['error'] = 'Napaka! Napačen token.';
|
||||
$this->response['success'] = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -88,6 +112,7 @@ class ApiNarocilaController{
|
||||
|
||||
if (!isset($this->params['action'])) {
|
||||
$this->response['error'] = 'Napaka! Manjkajo parametri!';
|
||||
$this->response['success'] = false;
|
||||
}
|
||||
else {
|
||||
|
||||
@ -122,6 +147,7 @@ class ApiNarocilaController{
|
||||
}
|
||||
else{
|
||||
$this->response['error'] = 'Napaka! Manjka ID narocila!';
|
||||
$this->response['success'] = false;
|
||||
}
|
||||
|
||||
break;
|
||||
@ -135,6 +161,7 @@ class ApiNarocilaController{
|
||||
}
|
||||
else{
|
||||
$this->response['error'] = 'Napaka! Manjka ID narocila!';
|
||||
$this->response['success'] = false;
|
||||
}
|
||||
|
||||
break;
|
||||
@ -208,6 +235,8 @@ class ApiNarocilaController{
|
||||
|
||||
if($usr_id == '' || $usr_id == 0){
|
||||
$this->response['error'] = 'ERROR! Missing user ID.';
|
||||
$this->response['success'] = false;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user