Skip to content

Commit

Permalink
fix error sintaxe
Browse files Browse the repository at this point in the history
  • Loading branch information
jhowbhz committed Nov 24, 2022
1 parent fdbd4dc commit ddf5f6d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/ApiBrasil.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@ public static function WhatsAppService(String $action = '', Array $data = []) {
$clear = ['serverhost', 'apitoken', 'method'];
$body = array_diff_key($data, array_flip($clear));

$header = [
$headers = [
'sessionkey' => $sessionkey
];

//verify is a start, is true, add new apitoken in header
//verify is a start, is true, add new apitoken in headers
if(isset($action) and $action === 'start'){

'sessionkey:'.$sessionkey
$header = [
$headers = [
'apitoken' => $apitoken,
'sessionkey' => $sessionkey
];
Expand All @@ -64,8 +63,8 @@ public static function WhatsAppService(String $action = '', Array $data = []) {
$action = $action."?session=$session&sessionkey=$sessionkey";
}

//guzzle json request post with header
$response = self::defaultRequest($method, $base_uri, $action, $header, $body);
//guzzle json request post with headers
$response = self::defaultRequest($method, $base_uri, $action, $headers, $body);

//return response json
return $response;
Expand Down

0 comments on commit ddf5f6d

Please sign in to comment.