Chilkat Online Tools

unicodeCpp / CardPointe API Integration / Settlement Status (Batch ID)

Back to Collection Items

#include <CkHttpW.h>
#include <CkJsonObjectW.h>
#include <CkHttpResponseW.h>

void ChilkatSample(void)
    {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkHttpW http;
    bool success;

    CkJsonObjectW queryParams;
    queryParams.UpdateString(L"merchid",L"{{merchid}}");
    queryParams.UpdateString(L"batchid",L"1900940023");

    http.SetRequestHeader(L"Authorization",L"Basic dGVzdGluZzp0ZXN0aW5nMTIz");
    http.SetRequestHeader(L"Content-Type",L"application/json");

    CkHttpResponseW *resp = http.QuickRequestParams(L"GET",L"https://domain.com/settlestat",queryParams);
    if (http.get_LastMethodSuccess() == false) {
        wprintf(L"%s\n",http.lastErrorText());
        return;
    }

    wprintf(L"%d\n",resp->get_StatusCode());
    wprintf(L"%s\n",resp->bodyStr());
    delete resp;
    }

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": [
  ]
}