getTDR method

Future<Response> getTDR(
  1. CFSession session,
  2. String bin
)

Implementation

Future<http.Response> getTDR(CFSession session, String bin) async {
  var url = "api.cashfree.com";
  if(session.getEnvironmentEnum() == CFEnvironment.SANDBOX) {
    url = "sandbox.cashfree.com";
  }
  var uri = Uri.https(url, '/pg/sdk/js/${session.getPaymentSessionId()}/v2/tdr');
  var response = await http.post(uri, body: jsonEncode({
    "code": bin,
    "code_type": "bin"
  }), headers: {
    "Content-Type": "application/json"
  });
  return response;
}