getHeaders method Null safety

Map<String, String> getHeaders(
  1. Map<String, dynamic> params
)
inherited

Get headers.

Returns a Map containing the headers needed to authenticate the http requests to the Veryfi API using the credentials and the params.

Implementation

Map<String, String> getHeaders(Map<String, dynamic> params) {
  final timestamp = DateTime.now().millisecondsSinceEpoch;
  final signature = generateSignature(params);
  final headers = {
    'User-Agent': 'Veryfi-Dart/${Constants.packageVersion}',
    'Accept': 'application/json',
    'Content-Type': 'application/json',
    'Client-Id': credentials.clientId,
    'Authorization': 'apikey ${credentials.username}:${credentials.apiKey}',
    'X-Veryfi-Request-Timestamp': timestamp.toString(),
    'X-Veryfi-Request-Signature': signature
  };
  return headers;
}