Commit b87826cc authored by Antonio.Suerte's avatar Antonio.Suerte

Zendesk API Params Enhancement

parent 6c20b063
...@@ -128,7 +128,7 @@ class LogicSupport extends SupportModelClass { ...@@ -128,7 +128,7 @@ class LogicSupport extends SupportModelClass {
if($ticketingConf -> staging) if($ticketingConf -> staging)
$template["body"] = "[STAGING TICKET]\n{$template["body"]}"; $template["body"] = "[STAGING TICKET]\n{$template["body"]}";
$params = [ $params = json_encode([
"ticket" => [ "ticket" => [
"subject" => $template["title"], "subject" => $template["title"],
"priority" => "urgent", "priority" => "urgent",
...@@ -142,7 +142,7 @@ class LogicSupport extends SupportModelClass { ...@@ -142,7 +142,7 @@ class LogicSupport extends SupportModelClass {
"email" => $this -> getEmail() "email" => $this -> getEmail()
] ]
] ]
]; ]);
curl_setopt_array($handle, [ curl_setopt_array($handle, [
CURLOPT_URL => $ticketingConf -> endpoint_url, CURLOPT_URL => $ticketingConf -> endpoint_url,
...@@ -151,7 +151,7 @@ class LogicSupport extends SupportModelClass { ...@@ -151,7 +151,7 @@ class LogicSupport extends SupportModelClass {
CURLOPT_ENCODING => "utf8", CURLOPT_ENCODING => "utf8",
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => $ticketingConf -> request_method, CURLOPT_CUSTOMREQUEST => $ticketingConf -> request_method,
CURLOPT_POSTFIELDS => json_encode($params), CURLOPT_POSTFIELDS => $params,
CURLOPT_HTTPHEADER => [ CURLOPT_HTTPHEADER => [
"Content-type: application/json", "Content-type: application/json",
"Authorization: Basic {$hashed}" "Authorization: Basic {$hashed}"
...@@ -167,8 +167,9 @@ class LogicSupport extends SupportModelClass { ...@@ -167,8 +167,9 @@ class LogicSupport extends SupportModelClass {
$details = [ $details = [
"response_code" => $httpcode, "response_code" => $httpcode,
"ticket_body" => "ticket_body" =>
"<subject>{$template["title"]}</subject>\n". "<subject>{$template["title"]}\n</subject>\n".
"<content>\n{$template["body"]}</content>", "<content>\n{$template["body"]}\n</content>\n".
"<params>\n{$params}\n</params>",
"response_str" => $output "response_str" => $output
]; ];
......
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