closeSession method

Future<Response> closeSession(
  1. String authCode,
  2. String amountCharged,
  3. String sessionId,
  4. String volume,
  5. String volumeMeasure,
)

Implementation

Future<http.Response> closeSession(String authCode, String amountCharged,
    String sessionId, String volume, String volumeMeasure) async {
  var jsonBody = {
    "auth_code": authCode,
    "session_id": sessionId,
    "amount_charged": amountCharged,
    "volume": volume,
    "volume_measure": volumeMeasure
  };
  var url = Uri.parse(APIConst.closeSession);

  Map<String, String> headers = {
    "Content-type": "application/x-www-form-urlencoded",
    'Accept': 'application/json'
  };

  log('CLOSE_SESSION_REQUEST ::: $url :: $jsonBody');

  return await http
      .post(url, headers: headers, body: jsonBody)
      .timeout(Duration(seconds: timeOutSecond));
}