Back to Collection Items
// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;
import android.app.Activity;
import com.chilkatsoft.*;
import android.widget.TextView;
import android.os.Bundle;
public class SimpleActivity extends Activity {
private static final String TAG = "Chilkat";
// Called when the activity is first created.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkHttp http = new CkHttp();
boolean success;
CkJsonObject queryParams = new CkJsonObject();
queryParams.UpdateString("merchid","{{merchid}}");
queryParams.UpdateString("batchid","1900940023");
http.SetRequestHeader("Authorization","Basic dGVzdGluZzp0ZXN0aW5nMTIz");
http.SetRequestHeader("Content-Type","application/json");
CkHttpResponse resp = http.QuickRequestParams("GET","https://domain.com/settlestat",queryParams);
if (http.get_LastMethodSuccess() == false) {
Log.i(TAG, http.lastErrorText());
return;
}
Log.i(TAG, String.valueOf(resp.get_StatusCode()));
Log.i(TAG, resp.bodyStr());
}
static {
System.loadLibrary("chilkat");
// Note: If the incorrect library name is passed to System.loadLibrary,
// then you will see the following error message at application startup:
//"The application <your-application-name> has stopped unexpectedly. Please try again."
}
}
Curl Command
curl -G -d "merchid=%7B%7Bmerchid%7D%7D"
-d "batchid=1900940023"
-H "Authorization: Basic dGVzdGluZzp0ZXN0aW5nMTIz"
-H "Content-Type: application/json"
https://domain.com/settlestat
Postman Collection Item JSON
{
"name": "Settlement Status (Batch ID)",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Basic dGVzdGluZzp0ZXN0aW5nMTIz"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{url}}/settlestat?merchid={{merchid}}&batchid=1900940023",
"host": [
"{{url}}"
],
"path": [
"settlestat"
],
"query": [
{
"key": "merchid",
"value": "{{merchid}}"
},
{
"key": "batchid",
"value": "1900940023"
}
]
},
"description": "[Settlement Status Documentation](https://developer.cardconnect.com/cardconnect-api#settlement-status)"
},
"response": [
]
}