if ($isJson) {
$argString = json_encode($data);
} else {
$argString = $data;
}
$token = $this->pbkdf2($this->encPass, $this->encSalt, 1000, 32);
$crypt = $this->encrypt($argString, $token, true);
$defaults = array(
CURLOPT_POST => 1,
CURLOPT_HEADER => 0,
CURLOPT_URL => $this->server . $method,
CURLOPT_USERAGENT => 'OpenBay Pro for Amazon/Opencart',
CURLOPT_FRESH_CONNECT => 1,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_FORBID_REUSE => 1,
CURLOPT_TIMEOUT => 30,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_POSTFIELDS => 'token=' . $this->token . '&data=' . rawurlencode($crypt),
);
$ch = curl_init();
curl_setopt_array($ch, $defaults);
$response = curl_exec($ch);
curl_close($ch);
return $response;