VariableDescription
$parameterBody request parameter array
$keyget it from api panel
$ivget it from api panel
public static function encrypt($parameter, $key, $iv)
{
  $data = json_encode($data, JSON_UNESCAPED_SLASHES);
  $ciphertext_raw = openssl_encrypt($data, "AES-256-CBC", $key, OPENSSL_RAW_DATA, $iv);
  return bin2hex($ciphertext_raw);
}

$encyptedBody = $this->encrypt($parameter, $key, $iv);

📘

For online reference

Aes Encryption